object Jvm extends CoursierSupport
- Source
- Jvm.scala
- Alphabetic
- By Inheritance
- Jvm
- CoursierSupport
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Deprecated Type Members
- type JarManifest = api.JarManifest
- Annotations
- @deprecated
- Deprecated
(Since version Mill after 0.11.0-M4) Use mill.api.JarManifest instead
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def callSubprocess(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String], envArgs: Map[String, String], mainArgs: Seq[String], workingDir: Path, streamOut: Boolean)(implicit ctx: Ctx): CommandResult
Runs a JVM subprocess with the given configuration and returns a os.CommandResult with it's aggregated output and error streams
- def callSubprocess(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String], envArgs: Map[String, String], mainArgs: Seq[String], workingDir: Path, streamOut: Boolean, check: Boolean)(implicit ctx: Ctx): CommandResult
Runs a JVM subprocess with the given configuration and returns a os.CommandResult with it's aggregated output and error streams
- def callSubprocess(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String] = Seq.empty, envArgs: Map[String, String] = Map.empty, mainArgs: Seq[String] = Seq.empty, workingDir: Path = null, streamOut: Boolean = true, check: Boolean = true, javaHome: Option[Path] = None)(implicit ctx: Ctx): CommandResult
Runs a JVM subprocess with the given configuration and returns a os.CommandResult with it's aggregated output and error streams
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def createClasspathPassingJar(jar: Path, classpath: api.Loose.Agg[Path]): Unit
- def createJar(jar: Path, inputPaths: api.Loose.Agg[Path], manifest: api.JarManifest, fileFilter: (Path, RelPath) => Boolean): Unit
- def createJar(inputPaths: api.Loose.Agg[Path], manifest: api.JarManifest = mill.api.JarManifest.MillDefault, fileFilter: (Path, RelPath) => Boolean = (_, _) => true)(implicit ctx: Dest): api.PathRef
Create a jar file containing all files from the specified input Paths, called out.jar in the implicit ctx.dest folder.
Create a jar file containing all files from the specified input Paths, called out.jar in the implicit ctx.dest folder. An optional main class may be provided for the jar. An optional filter function may also be provided to selectively include/exclude specific files.
- inputPaths
-
Agg
ofos.Path
s containing files to be included in the jar- fileFilter
- optional file filter to select files to be included. Given an
os.Path
(from inputPaths) and anos.RelPath
for the individual file, return true if the file is to be included in the jar.- ctx
- implicit
Ctx.Dest
used to determine the output directory for the jar.- returns
- a
PathRef
for the created jar.
- def createLauncher(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String])(implicit ctx: Dest): api.PathRef
- def createManifest(mainClass: Option[String]): api.JarManifest
- def defaultBackgroundOutputs(outputDir: Path): Option[(ProcessOutput, ProcessOutput)]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def inprocess[T](classPath: api.Loose.Agg[Path], classLoaderOverrideSbtTesting: Boolean, isolated: Boolean, closeContextClassLoaderWhenDone: Boolean, body: (ClassLoader) => T)(implicit ctx: Home): T
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def javaExe: String
- def javaExe(javaHome: Option[Path]): String
- def jdkTool(toolName: String): String
- def jdkTool(toolName: String, javaHome: Option[Path]): String
Resolves a tool to a path under the currently used JDK (if known).
- def jvmIndex(ctx: Option[Log] = None, coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]] = None): JvmIndex
- Definition Classes
- CoursierSupport
- def jvmIndex0(ctx: Option[Log] = None, coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]] = None, jvmIndexVersion: String = "latest.release"): coursier.util.Task[JvmIndex]
- Definition Classes
- CoursierSupport
- def launcherUniversalScript(mainClass: String, shellClassPath: api.Loose.Agg[String], cmdClassPath: api.Loose.Agg[String], jvmArgs: Seq[String], shebang: Boolean = false): String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def resolveDependencies(repositories: Seq[Repository], deps: IterableOnce[Dependency], force: IterableOnce[Dependency], sources: Boolean, mapDependencies: Option[(Dependency) => Dependency], customizer: Option[(Resolution) => Resolution], ctx: Option[Log], coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]], resolveFilter: (Path) => Boolean, artifactTypes: Option[Set[Type]]): Result[api.Loose.Agg[api.PathRef]]
- Definition Classes
- CoursierSupport
- def resolveDependencies(repositories: Seq[Repository], deps: IterableOnce[Dependency], force: IterableOnce[Dependency], sources: Boolean = false, mapDependencies: Option[(Dependency) => Dependency] = None, customizer: Option[(Resolution) => Resolution] = None, ctx: Option[Log] = None, coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]] = None, resolveFilter: (Path) => Boolean = _ => true, artifactTypes: Option[Set[Type]] = None, resolutionParams: ResolutionParams = ResolutionParams()): Result[api.Loose.Agg[api.PathRef]]
Resolve dependencies using Coursier.
Resolve dependencies using Coursier.
We do not bother breaking this out into the separate ZincWorkerApi classpath, because Coursier is already bundled with mill/Ammonite to support the
import $ivy
syntax.- Definition Classes
- CoursierSupport
- def resolveDependenciesMetadataSafe(repositories: Seq[Repository], deps: IterableOnce[Dependency], force: IterableOnce[Dependency], mapDependencies: Option[(Dependency) => Dependency], customizer: Option[(Resolution) => Resolution], ctx: Option[Log], coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]]): Result[Resolution]
- Definition Classes
- CoursierSupport
- def resolveDependenciesMetadataSafe(repositories: Seq[Repository], deps: IterableOnce[Dependency], force: IterableOnce[Dependency], mapDependencies: Option[(Dependency) => Dependency] = None, customizer: Option[(Resolution) => Resolution] = None, ctx: Option[Log] = None, coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]] = None, resolutionParams: ResolutionParams = ResolutionParams()): Result[Resolution]
- Definition Classes
- CoursierSupport
- def resolveJavaHome(id: String, ctx: Option[Log] = None, coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]] = None, jvmIndexVersion: String = "latest.release"): Result[Path]
Resolve java home using Coursier.
Resolve java home using Coursier.
The id string has format "$DISTRIBUTION:$VERSION". e.g. graalvm-community:23.0.0
- Definition Classes
- CoursierSupport
- def runClassloader[T](classPath: api.Loose.Agg[Path])(body: (ClassLoader) => T)(implicit ctx: Home): T
- def runLocal(mainClass: String, classPath: api.Loose.Agg[Path], mainArgs: Seq[String] = Seq.empty)(implicit ctx: Ctx): Unit
- def runSubprocess(commandArgs: Seq[String], envArgs: Map[String, String], workingDir: Path): Unit
Runs a generic subprocess and waits for it to terminate.
Runs a generic subprocess and waits for it to terminate. If process exited with non-zero code, exception will be thrown. If you want to manually handle exit code, check runSubprocessWithResult
- def runSubprocess(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String], envArgs: Map[String, String], mainArgs: Seq[String], workingDir: Path, background: Boolean, useCpPassingJar: Boolean)(implicit ctx: Ctx): Unit
- def runSubprocess(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String], envArgs: Map[String, String], mainArgs: Seq[String], workingDir: Path, background: Boolean, useCpPassingJar: Boolean, runBackgroundLogToConsole: Boolean)(implicit ctx: Ctx): Unit
- def runSubprocess(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String] = Seq.empty, envArgs: Map[String, String] = Map.empty, mainArgs: Seq[String] = Seq.empty, workingDir: Path = null, background: Boolean = false, useCpPassingJar: Boolean = false, runBackgroundLogToConsole: Boolean = false, javaHome: Option[Path] = None)(implicit ctx: Ctx): Unit
Runs a JVM subprocess with the given configuration and streams it's stdout and stderr to the console.
Runs a JVM subprocess with the given configuration and streams it's stdout and stderr to the console.
- mainClass
The main class to run
- classPath
The classpath
- jvmArgs
Arguments given to the forked JVM
- envArgs
Environment variables used when starting the forked JVM
- workingDir
The working directory to be used by the forked JVM
- background
true
if the forked JVM should be spawned in background- useCpPassingJar
When
false
, the-cp
parameter is used to pass the classpath to the forked JVM. Whentrue
, a temporary empty JAR is created which contains aClass-Path
manifest entry containing the actual classpath. This might help with long classpaths on OS'es (like Windows) which only supports limited command-line length
- def runSubprocessWithBackgroundOutputs(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String], envArgs: Map[String, String], mainArgs: Seq[String], workingDir: Path, backgroundOutputs: Option[(ProcessOutput, ProcessOutput)], useCpPassingJar: Boolean)(implicit ctx: Ctx): Unit
- def runSubprocessWithBackgroundOutputs(mainClass: String, classPath: api.Loose.Agg[Path], jvmArgs: Seq[String] = Seq.empty, envArgs: Map[String, String] = Map.empty, mainArgs: Seq[String] = Seq.empty, workingDir: Path = null, backgroundOutputs: Option[(ProcessOutput, ProcessOutput)] = None, useCpPassingJar: Boolean = false, javaHome: Option[Path] = None)(implicit ctx: Ctx): Unit
Runs a JVM subprocess with the given configuration and streams it's stdout and stderr to the console.
Runs a JVM subprocess with the given configuration and streams it's stdout and stderr to the console.
- mainClass
The main class to run
- classPath
The classpath
- jvmArgs
Arguments given to the forked JVM
- envArgs
Environment variables used when starting the forked JVM
- workingDir
The working directory to be used by the forked JVM
- backgroundOutputs
If the subprocess should run in the background, a Tuple of ProcessOutputs containing out and err respectively. Specify None for nonbackground processes.
- useCpPassingJar
When
false
, the-cp
parameter is used to pass the classpath to the forked JVM. Whentrue
, a temporary empty JAR is created which contains aClass-Path
manifest entry containing the actual classpath. This might help with long classpaths on OS'es (like Windows) which only supports limited command-line length
- def runSubprocessWithResult(commandArgs: Seq[String], envArgs: Map[String, String], workingDir: Path): Result[Int]
Runs a generic subprocess and waits for it to terminate.
Runs a generic subprocess and waits for it to terminate.
- returns
Result with exit code.
- def spawnClassloader(classPath: Iterable[Path], sharedPrefixes: Seq[String] = Nil, parent: ClassLoader = null): URLClassLoader
- def spawnSubprocess(commandArgs: Seq[String], envArgs: Map[String, String], workingDir: Path, background: Boolean = false): SubProcess
Spawns a generic subprocess, streaming the stdout and stderr to the console.
Spawns a generic subprocess, streaming the stdout and stderr to the console. If the System.out/System.err have been substituted, makes sure that the subprocess's stdout and stderr streams go to the substituted streams.
- def spawnSubprocessWithBackgroundOutputs(commandArgs: Seq[String], envArgs: Map[String, String], workingDir: Path, backgroundOutputs: Option[(ProcessOutput, ProcessOutput)] = None): SubProcess
Spawns a generic subprocess, streaming the stdout and stderr to the console.
Spawns a generic subprocess, streaming the stdout and stderr to the console. If the System.out/System.err have been substituted, makes sure that the subprocess's stdout and stderr streams go to the substituted streams.
If the process should be spawned in the background, destination streams for out and err respectively must be defined in the backgroundOutputs tuple. Non-background process should set backgroundOutputs to None.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def universalScript(shellCommands: String, cmdCommands: String, shebang: Boolean = false): String
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- val JarManifest: api.JarManifest.type
- Annotations
- @deprecated
- Deprecated
(Since version Mill after 0.11.0-M4) Use mill.api.JarManifest instead
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def resolveDependencies(repositories: Seq[Repository], deps: IterableOnce[Dependency], force: IterableOnce[Dependency], sources: Boolean, mapDependencies: Option[(Dependency) => Dependency], customizer: Option[(Resolution) => Resolution], ctx: Option[Log], coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]], resolveFilter: (Path) => Boolean): Result[api.Loose.Agg[api.PathRef]]
- Definition Classes
- CoursierSupport
- Annotations
- @deprecated
- Deprecated
(Since version Mill after 0.12.0-RC3) Use the override accepting artifactTypes
- def resolveDependenciesMetadata(repositories: Seq[Repository], deps: IterableOnce[Dependency], force: IterableOnce[Dependency], mapDependencies: Option[(Dependency) => Dependency] = None, customizer: Option[(Resolution) => Resolution] = None, ctx: Option[Log] = None, coursierCacheCustomizer: Option[(FileCache[coursier.util.Task]) => FileCache[coursier.util.Task]] = None): (Seq[Dependency], Resolution)
- Definition Classes
- CoursierSupport
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Prefer resolveDependenciesMetadataSafe instead, which returns a Result instead of throwing exceptions