Zinc is a standalone version of sbt's incremental compiler meant to be run in nailgun.
—
Primary command-line interface and programmatic entry points for Zinc compilation orchestration.
Standard main method for command-line execution of Zinc compilation.
/**
* Standard main method for command-line execution
* @param args Command-line arguments for compilation
*/
def main(args: Array[String]): UnitUsage Example:
import org.pantsbuild.zinc.Main
// Command-line execution
Main.main(Array(
"-scala-home", "/usr/local/scala",
"-classpath", "/path/to/dependencies:/additional/deps",
"-d", "/path/to/output/classes",
"src/main/scala/MyClass.scala",
"src/main/scala/AnotherClass.scala"
))Programmatic compilation entry point with optional working directory specification.
/**
* Programmatic compilation entry point with optional working directory
* @param args Command-line arguments for compilation
* @param cwd Optional working directory for relative path resolution
*/
def run(args: Array[String], cwd: Option[File]): UnitUsage Example:
import org.pantsbuild.zinc.Main
import java.io.File
// Programmatic execution with working directory
val projectDir = new File("/path/to/project")
val args = Array(
"-scala-home", "/usr/local/scala",
"-classpath", "./lib/dependency.jar:./lib/other.jar", // relative paths
"-d", "./target/classes",
"./src/main/scala/Example.scala"
)
Main.run(args, Some(projectDir))The Main object serves as the primary entry point for Zinc compilation and handles:
Settings systemCompiler systemBoth methods will parse arguments, set up the compilation environment, and execute the compilation process with appropriate error handling and logging.
Install with Tessl CLI
npx tessl i tessl/maven-org-pantsbuild--zinc