title | sidebar_position |
---|---|
Directives |
2 |
Add benchmarking options
//> using jmh
value
//> using jmhVersion
value
//> using jmhVersion 1.37
Generate BuildInfo for project
//> using buildInfo
//> using buildInfo
Add Scala compiler options
//> using option
option
//> using options
option1 option2 …
//> using option -Xasync
//> using test.option -Xasync
//> using options -Xasync -Xfatal-warnings
Adds compiler plugins
using plugin
org:
name:
ver
//> using plugin org.typelevel:::kind-projector:0.13.2
Method used to compute the version for BuildInfo
//> using computeVersion
method
//> using computeVersion git
//> using computeVersion git:tag
//> using computeVersion git:dynver
Manually add JAR(s) to the class path
//> using jar
path
//> using jars
path1 path2 …
//> using jar /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.13/2.3.7/shapeless_2.13-2.3.7.jar
//> using test.jar /Users/alexandre/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.13/2.3.7/shapeless_2.13-2.3.7.jar
//> using sourceJar /path/to/custom-jar-sources.jar
//> using sourceJars /path/to/custom-jar-sources.jar /path/to/another-jar-sources.jar
//> using test.sourceJar /path/to/test-custom-jar-sources.jar
Manually add sources to the project. Does not support chaining, sources are added only once, not recursively.
//> using file
path
//> using files
path1 path2 …
//> using file utils.scala
Add dependencies
//> using dep
org:
name:
ver
//> using dep com.lihaoyi::os-lib:0.9.1
//> using test.dep org.scalatest::scalatest:3.2.10
//> using test.dep org.scalameta::munit:0.7.29
//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar
Exclude sources from the project
//> using exclude
pattern
//> using exclude
pattern1 pattern2 …
//> using exclude utils.scala
//> using exclude "examples/*" "*/resources/*"
//> using exclude "*.sc"
Use a specific JVM, such as 14
, adopt:11
, or graalvm:21
, or system
. scala-cli uses coursier to fetch JVMs, so you can use cs java --available
to list the available JVMs.
//> using jvm
value
//> using jvm 11
//> using jvm adopt:11
//> using jvm graalvm:21
Sets Java home used to run your application or tests
//> using javaHome
path
//> using javaHome /Users/Me/jdks/11
Add Java options which will be passed when running an application.
//> using javaOpt
options
//> using javaOpt -Xmx2g, -Dsomething=a
//> using test.javaOpt -Dsomething=a
Add Java properties
//> using javaProp
key=value
//> using javaProp
key
//> using javaProp foo1=bar, foo2
//> using test.javaProp foo3=bar foo4
Add Javac options which will be passed when compiling sources.
//> using javacOpt
options
//> using javacOpt -source 1.8 -target 1.8
//> using test.javacOpt -source 1.8 -target 1.8
Specify default main class
//> using mainClass
main-class
//> using mainClass HelloWorld
Set the default code wrapper for scripts to object wrapper
//> using objectWrapper
//> using objectWrapper
Set parameters for packaging
//> using packaging.packageType
package-type
//> using packaging.output
destination-path
//> using packaging.packageType assembly
//> using packaging.output foo
//> using packaging.provided org.apache.spark::spark-sql
//> using packaging.dockerFrom openjdk:11
//> using packaging.graalvmArgs --no-fallback
Set the default platform to Scala.js or Scala Native
//> using platform
(jvm
|scala-js
|js
|scala-native
|native
)+
//> using platform scala-js
//> using platform jvm scala-native
Set parameters for publishing
//> using publish.organization
value
//> using publish.name
value
//> using publish.version
value
//> using publish.organization io.github.myself
//> using publish.name my-library
//> using publish.version 0.1.1
Set CI parameters for publishing
//> using publish.ci.computeVersion
value
//> using publish.ci.repository
value
//> using publish.ci.secretKey
value
//> using publish.ci.computeVersion git:tag
//> using publish.ci.repository central-s01
//> using publish.ci.secretKey env:PUBLISH_SECRET_KEY
Set contextual parameters for publishing
//> using publish.computeVersion
value
//> using publish.repository
value
//> using publish.secretKey
value
//> using publish.doc
boolean
//> using publish.computeVersion git:tag
//> using publish.repository central-s01
//> using publish.secretKey env:PUBLISH_SECRET_KEY
//> using publish.doc false
Enable Python support
//> using python
//> using python
Add repositories for dependency resolution.
Accepts predefined repositories supported by Coursier (like sonatype:snapshots
or m2Local
) or a URL of the root of Maven repository
//> using repository
repository
//> using repository jitpack
//> using repository sonatype:snapshots
//> using repository m2Local
//> using repository https://maven-central.storage-download.googleapis.com/maven2
Manually add a resource directory to the class path
//> using resourceDir
path
//> using resourceDirs
path1 path2 …
//> using resourceDir ./resources
//> using test.resourceDir ./resources
Add Scala Native options
//> using nativeGc
value
//> using nativeMode
value
//> using nativeLto
value
//> using nativeVersion
value
//> using nativeCompile
value1 value2 …
//> using nativeLinking
value1 value2 …
//> using nativeClang
value
//> using nativeClangPP
value
//> using nativeEmbedResources
true|false
//> using nativeTarget
application|library-dynamic|library-static
//> using nativeVersion 0.4.0
Set the default Scala version
//> using scala
version+
//> using scala 3.0.2
//> using scala 2.13
//> using scala 2
//> using scala 2.13.6, 2.12.16
Add Scala.js options
//> using jsVersion
value
//> using jsMode
value
//> using jsNoOpt
true|false
//> using jsModuleKind
value
//> using jsSmallModuleForPackage
value1 value2 …
//> using jsCheckIr
true|false
//> using jsEmitSourceMaps
true|false
//> using jsDom
true|false
//> using jsHeader
value
//> using jsAllowBigIntsForLongs
true|false
//> using jsAvoidClasses
true|false
//> using jsAvoidLetsAndConsts
true|false
//> using jsModuleSplitStyleStr
value
//> using jsEsVersionStr
value
//> using jsEmitWasm
true|false
//> using jsEsModuleImportMap
value
//> using jsModuleKind common
Set the test framework
//> using testFramework
class-name
//> using testFramework utest.runner.Framework
Use a toolkit as dependency (not supported in Scala 2.12), 'default' version for Scala toolkit: 0.5.0, 'default' version for typelevel toolkit: 0.1.27
//> using toolkit
version
//> using toolkit 0.1.0
//> using toolkit default
//> using test.toolkit default
Require a Scala platform for the current file
//> using target.platform
platform
//> using target.platform scala-js
//> using target.platform scala-js, scala-native
//> using target.platform jvm
Require a Scala version for the current file
//> using target.scala
version
//> using target.scala 3
Require a Scala version for the current file
//> using target.scala.>=
version
//> using target.scala.>= 2.13
//> using target.scala.< 3.0.2
Require a scope for the current file
//> using target.scope
scope
//> using target.scope test