pttrt alternatives and similar packages
Based on the "Sbt plugins" category.
Alternatively, view pttrt alternatives based on common mentions on social networks and blogs.
-
sbt-assembly
Deploy über-JARs. Restart processes. (port of codahale/assembly-sbt) -
sbt-dependency-graph
sbt plugin to create a dependency graph for your project -
sbt-jmh
"Trust no one, bench everything." - sbt plugin for JMH (Java Microbenchmark Harness) -
sbt-revolver
An SBT plugin for dangerously fast development turnaround in Scala -
sbt-updates
sbt plugin that can check Maven and Ivy repositories for dependency updates -
better-monadic-for
Desugaring scala `for` without implicit `withFilter`s -
sbt-microsites
An sbt plugin to create awesome microsites for your project -
sbt-mima-plugin
A tool for catching binary incompatibility in Scala -
sbt-ensime
Generates .ensime config files for SBT projects http://ensime.org/build_tools/sbt -
sbt-sonatype
A sbt plugin for publishing Scala/Java projects to the Maven central. -
sbt-ci-release
sbt plugin to automate Sonatype releases from GitHub Actions -
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-header
sbt-header is an sbt plugin for creating file headers, e.g. copyright headers -
sbt-play-scalajs
SBT plugin to use Scala.js along with any sbt-web server. -
sbt-api-mappings
An Sbt plugin that fills apiMappings for common Scala libraries. -
sbt-unidoc
sbt plugin to create a unified Scaladoc or Javadoc API document across multiple subprojects. -
sbt-sublime
An sbt plugin for generating Sublime Text projects with library dependencies sources -
sbt pom reader plugin
Translates xml -> awesome. Maven-ish support for sbt. -
sbt-scala-js-map
A Sbt plugin that configures source mapping for Scala.js projects hosted on Github -
sbt-versions
Plugin that checks for updated versions of your project's dependencies. -
sbt-pantarhei
sbt plugin building and publishing release notes from github pull requests -
sbt-classfinder
SBT plugin for retrieving runtime information about the classes and traits in a project
Access the most powerful time series database as a service
Do you think we are missing an alternative of pttrt or a related project?
README
Pttrt
Pttrt (/ˈpɪtrɪt/, or Pass Them To Run-time) is a sbt plugin, designed to pass data from compile-time to run-time.
Motive
Many times, my programs need some information, which is generated at compile-time and used at run-time. For example, Subversion's revision, JARs's dependencies, configuration files, and poor man's macro ;-), etc.
It is really heavyweight to deal with these situation in sbt.
You need to create a plugin for each type of files you generated,
to define many SettingKey
s in each plugin's .scala
files,
and to set values for each of these SettingKey
s in your .sbt
files.
There are some plugins, like xsbt-reflect,
also able to generate some infomation for run-time. But they cannot fit every variant cases I met.
Another plugin, sbt-buildinfo has similar feature as Pttrt
,
but sbt-buildinfo
cannot generate multiply files, preventing itself to be used for code generation from multiply
separate plugins.
I just want a lightweight and general-purpose way like Makefile
:
generated.properties:
echo my.base.dir=$(PWD) > [email protected]
That's why I created Pttrt
.
Usage
Step 1: Install Pttrt
into your project
Add the following line to your project/plugins.sbt
:
addSbtPlugin("com.dongxiguo" % "pttrt" % "0.1.2")
And add pttrtSettings
to your build.sbt
:
pttrtSettings
Step 2: Export the data that will be passed to run-time
For example, if you want to know the building version on run-time,
you need to add following lines at build.sbt
:
pttrtSettings
version := "1.2.3-SNAPSHOT"
PttrtKeys.pttrtData <+= version map { v =>
"org.yourHost.yourProject.YourSingleton" -> Map("Version" -> TypedExpression(v))
}
Step 3: Access the data on run-time
Create PttrtExample.scala
:
object PttrtExample {
def main(args: Array[String]) {
println("Building version is " + org.yourHost.yourProject.YourSingleton.Version)
}
}
Step 4: Run it!
$ sbt
> run-main PttrtExample
You will see:
Building version is 1.2.3-SNAPSHOT
See https://github.com/Atry/pttrt/tree/master/pttrt-test for more example.
Addition requirement
Pttrt
is for sbt 0.12- Any value being passed to run-time must be a primary type (
Int
,Double
,Boolean
, etc) orjava.io.Serializable
- The value's type must be found in the classpath for both compile-time and run-time.