sbt-classfinder alternatives and similar packages
Based on the "Sbt plugins" category.
Alternatively, view sbt-classfinder alternatives based on common mentions on social networks and blogs.
-
sbt-ensime
DISCONTINUED. Generates .ensime config files for SBT projects http://ensime.org/build_tools/sbt -
sbt-dependency-check
SBT Plugin for OWASP DependencyCheck. Monitor your dependencies and report if there are any publicly known vulnerabilities (e.g. CVEs). :rainbow: -
sbt-unidoc
sbt plugin to create a unified Scaladoc or Javadoc API document across multiple subprojects.
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of sbt-classfinder or a related project?
README
sbt-classfinder
sbt-classfinder is a SBT plugin for retrieving runtime information about the classes and traits in a project and searching for specific classes according to some criteria, such as their superclasses or annotations. It allows one to modify the behavior and dependencies of other post-compile SBT tasks according to the compiled code or the classpath.
Quick Start
To use sbt-classfinder in an existing SBT project using SBT 0.13.5+, add the following dependency to your project/plugins.sbt
:
addSbtPlugin("net.ruippeixotog" % "sbt-classfinder" % "0.1.2")
Tasks
classFinderClasspath
: determines the classpath to be searched. The scope of the classpath depends on the value of theclassFinderScope
setting;classFinder
: returns aClassFinder
instance containing several utility methods for listing and finding classes in the specified classpath;allClassesInfo
: an utility task for retrieving a stream with the information of all classes.
Settings
classFinderScope
: defines what should and should not be searched in the build classpath. One of:Config
: search the build products of the scoped SBT configuration, e.g.Compile
classes forcompile:classFinderScope
andTest
classes fortest:classFinderScope
;Build
: search the build products of the whole SBT build, including other projects in multi-project builds;BuildAndDeps
: search the full classpath, including external dependencies.
Examples
Run the main class marked with the annotation QuickRun
:
// build.sbt
lazy val markedMain = TaskKey[String]("markedMain")
lazy val runMarked = TaskKey[Unit]("runMarked")
markedMain := {
val className = (classFinder in Compile).value.classesAnnotatedWith("QuickRun").head.name
if (className.endsWith("$")) className.dropRight(1) else className
}
runMarked <<= std.FullInstance.flatten {
markedMain.map { mMain => (runMain in Compile).toTask(" " + mMain) }
}
Make test
run also subclasses of MyTest
using a custom test executor:
// build.sbt
lazy val myTests = TaskKey[Seq[String]]("myTests")
def myTestExecutor(testClass: String) = ???
myTests := (classFinder in Test).value.subtypesOf("MyTest").map(_.name).toSeq
test <<= myTests.map { testSeq => testSeq.map(myTestExecutor) }
Copyright
Copyright (c) 2015 Rui Gonçalves. See LICENSE for details.
*Note that all licence references and agreements mentioned in the sbt-classfinder README section above
are relevant to that project's source code only.