NativeImageModule
Provides a task to build a native executable using Graal VM.
It is recommended to specify a custom JDK that includes the native-image Tool.
trait AppModule extends NativeImageModule {
def jvmWorker = ModuleRef(JvmWorkerGraalvm)
def jvmId = "graalvm-community:23.0.1"
}
Attributes
- Source
- NativeImageModule.scala
- Graph
-
- Supertypes
-
trait OfflineSupportModuletrait WithJvmWorkerModuletrait JavaHomeModuletrait CoursierModuletrait Moduletrait ModuleApitrait Wrapperclass BaseClasstrait Cachertrait Cacherclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait Baseclass JavaModuleclass Junit4class Junit5class TestNgtrait Baseclass KotlinModuleclass Junit4class Junit5class TestNgtrait Baseclass Rawclass ScalaModuleclass Junit4class Junit5class Munitclass ScalaCheckclass ScalaTestclass Specs2class TestNgclass Utestclass Weaverclass ZioTestShow all
Members list
Type members
Inherited classlikes
Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill
Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill
Attributes
- Inherited from:
- Module
- Source
- Module.scala
- Supertypes
Value members
Abstract methods
Attributes
- Source
- NativeImageModule.scala
Attributes
- Source
- NativeImageModule.scala
Concrete methods
Downloads the version nativeGraalVMReachabilityMetadataVersion graalvm-reachability-metadata from https://github.com/oracle/graalvm-reachability-metadata
Downloads the version nativeGraalVMReachabilityMetadataVersion graalvm-reachability-metadata from https://github.com/oracle/graalvm-reachability-metadata
Attributes
- Source
- NativeImageModule.scala
Classloader with nativeGraalVMReachabilityMetadataClasspath
Classloader with nativeGraalVMReachabilityMetadataClasspath
Attributes
- Source
- NativeImageModule.scala
Resolved classpath of mill-libs-javalib-graalvm-reachability-worker
Resolved classpath of mill-libs-javalib-graalvm-reachability-worker
Attributes
- Source
- NativeImageModule.scala
The version of the reachability metadata as found in https://github.com/oracle/graalvm-reachability-metadata
The version of the reachability metadata as found in https://github.com/oracle/graalvm-reachability-metadata
Default value is retrieved from the nativeGraalVMReachabilityMetadataWorker
Attributes
- Source
- NativeImageModule.scala
Worker that fetches the graalvm-reachability-metadata and collects any relevant metadata
Worker that fetches the graalvm-reachability-metadata and collects any relevant metadata
Attributes
- Source
- NativeImageModule.scala
Defines the query to run for finding reachability metadata via mill.javalib.graalvm.GraalVMMetadataWorker.
Defines the query to run for finding reachability metadata via mill.javalib.graalvm.GraalVMMetadataWorker.
For more information and implementation details go to https://github.com/graalvm/native-build-tools/blob/master/common/graalvm-reachability-metadata/src/main/java/org/graalvm/reachability/internal/FileSystemRepository.java
Attributes
- Source
- NativeImageModule.scala
The GAV coordinates of the dependencies to search for reachability metadata in nativeGraalVMReachabilityMetadata.
The GAV coordinates of the dependencies to search for reachability metadata in nativeGraalVMReachabilityMetadata.
This task must be compatible with https://github.com/graalvm/native-build-tools/blob/54db68cfcc20ab6a43ccbf4e04130325210f5b3a/common/graalvm-reachability-metadata/src/main/java/org/graalvm/reachability/internal/DefaultArtifactQuery.java#L57
Attributes
- Source
- NativeImageModule.scala
Builds a native executable for this module with finalMainClass as the application entry point.
Builds a native executable for this module with finalMainClass as the application entry point.
Attributes
- Source
- NativeImageModule.scala
The classpath to use to generate the native image. Defaults to runClasspath.
The classpath to use to generate the native image. Defaults to runClasspath.
Attributes
- Source
- NativeImageModule.scala
Additional options for the native-image Tool.
Path to the `native-image` Tool. Defaults to a path relative to
Path to the `native-image` Tool. Defaults to a path relative to
- JvmWorkerModule.javaHome, if defined
- environment variable
GRAALVM_HOME, if defined
Attributes
- Note
-
The task fails if the
native-imageTool is not found. - Source
- NativeImageModule.scala
Collects the metadata from nativeGraalVMReachabilityMetadata for the dependencies defined in nativeGraalVmMetadataQuery.
Collects the metadata from nativeGraalVMReachabilityMetadata for the dependencies defined in nativeGraalVmMetadataQuery.
The resulting path is compatible with the runClasspath expactations of the native image pointing to resources directory which contains a META-INF/native-image/<group-id>/<artifact-id> structure.
For more information see also https://www.graalvm.org/latest/reference-manual/native-image/metadata/
Attributes
- Source
- NativeImageModule.scala
Runs the Native Image from nativeImage
Runs the Native Image from nativeImage in the background
Whether to use the latest graalvm reachability metadata config if the dependency version is not listed in the tested versions.
Whether to use the latest graalvm reachability metadata config if the dependency version is not listed in the tested versions.
Defaults to true
Attributes
- Source
- NativeImageModule.scala
Prepare the module for working offline. This should typically fetch (missing) resources like Maven dependencies.
Prepare the module for working offline. This should typically fetch (missing) resources like Maven dependencies.
Value parameters
- all
-
If
true, it also fetches resources not always needed.
Attributes
- Definition Classes
- Source
- NativeImageModule.scala
Inherited methods
The repositories used to resolve dependencies
The repositories used to resolve dependencies
Unlike repositoriesTask, this includes the Mill internal repositories, which allow to resolve Mill internal modules (usually brought in via JavaModule#coursierDependencyTask).
Beware that this needs to evaluate JavaModule#coursierProject of all module dependencies of the current module, which itself evaluates JavaModule#mvnDeps and related tasks. You shouldn't depend on this task from implementations of mvnDeps, which would introduce cycles between Mill tasks.
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Bind a dependency (Dep) to the actual module context (e.g. the scala version and the platform suffix)
Bind a dependency (Dep) to the actual module context (e.g. the scala version and the platform suffix)
Attributes
- Returns
-
The BoundDep
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Whether to enable Gradle Module support when fetching dependencies
Whether to enable Gradle Module support when fetching dependencies
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Customize the coursier file cache.
Customize the coursier file cache.
This is rarely needed to be changed, but sometimes e.g. you want to load a coursier plugin. Doing so requires adding to coursier's classpath. To do this you could use the following:
override def coursierCacheCustomizer = Task.Anon {
Some( (fc: coursier.cache.FileCache[Task]) =>
fc.withClassLoaders(Seq(classOf[coursier.cache.protocol.S3Handler].getClassLoader))
)
}
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
A CoursierModule.Resolver to resolve dependencies.
A CoursierModule.Resolver to resolve dependencies.
Can be used to resolve external dependencies, if you need to download an external tool from Maven or Ivy repositories, by calling CoursierModule.Resolver#classpath.
Attributes
- Returns
-
CoursierModule.Resolverinstance - Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Optional custom Java Home for the JvmWorker to use
Optional custom Java Home for the JvmWorker to use
If this value is None, then the JvmWorker uses the same Java used to run the current mill instance.
Attributes
- Inherited from:
- JavaHomeModule
- Source
- JavaHomeModule.scala
Attributes
- Inherited from:
- JavaHomeModule
- Source
- JavaHomeModule.scala
Attributes
- Inherited from:
- JavaHomeModule
- Source
- JavaHomeModule.scala
Attributes
- Inherited from:
- WithJvmWorkerModule
- Source
- WithJvmWorkerModule.scala
Map dependencies before resolving them. Override this to customize the set of dependencies.
Map dependencies before resolving them. Override this to customize the set of dependencies.
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
A CoursierModule.Resolver to resolve dependencies.
A CoursierModule.Resolver to resolve dependencies.
Unlike defaultResolver, this resolver can resolve Mill modules too (obtained via JavaModule.coursierDependencyTask).
Attributes
- Returns
-
CoursierModule.Resolverinstance - Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Attributes
- Inherited from:
- BaseClass
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
The repositories used to resolve dependencies with classpath(). This takes Coursier repository strings as input which are defined here:
The repositories used to resolve dependencies with classpath(). This takes Coursier repository strings as input which are defined here:
For example:
-
https://repo1.maven.org/maven2 Maven Central which is the most commonly used Maven repository
-
file:///Users/alex/test-repo A local repository cache on disk
-
file://${ivy.home-${user.home}/.ivy2}/local/[defaultPattern] The local Ivy2 repository where Mill, Scala CLI, or sbt publish to when asked to publish locally
-
file://${user.home}/.m2/repository the local Maven repository. Use of this is not recommended for reasons explained in the link above
-
https://maven.google.com Google-managed repository that distributes some Android artifacts in particular
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
A more flexible version of repositories, that allows custom repositories that are not definable by Coursier repository strings. This is a relatively advanced feature, and for most situations overriding repositories should be sufficient
A more flexible version of repositories, that allows custom repositories that are not definable by Coursier repository strings. This is a relatively advanced feature, and for most situations overriding repositories should be sufficient
See allRepositories if you need to resolve Mill internal modules.
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Customize the coursier resolution process. This is rarely needed to changed, as the default try to provide a highly reproducible resolution process. But sometime, you need more control, e.g. you want to add some OS or JDK specific resolution properties which are sometimes used by Maven and therefore found in dependency artifact metadata. For example, the JavaFX artifacts are known to use OS specific properties. To fix resolution for JavaFX, you could override this task like the following:
Customize the coursier resolution process. This is rarely needed to changed, as the default try to provide a highly reproducible resolution process. But sometime, you need more control, e.g. you want to add some OS or JDK specific resolution properties which are sometimes used by Maven and therefore found in dependency artifact metadata. For example, the JavaFX artifacts are known to use OS specific properties. To fix resolution for JavaFX, you could override this task like the following:
override def resolutionCustomizer = Task.Anon {
Some( (r: coursier.core.Resolution) =>
r.withOsInfo(coursier.core.Activation.Os.fromProperties(sys.props.toMap))
)
}
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Resolution parameters, allowing to customize resolution internals
Resolution parameters, allowing to customize resolution internals
This rarely needs to be changed. This allows to disable the new way coursier handles BOMs since coursier 2.1.17 (used in Mill since 0.12.3) for example, with:
def resolutionParams = super.resolutionParams()
.withEnableDependencyOverrides(Some(false))
Note that versions forced with Dep#forceVersion() take over forced versions manually set in resolutionParams. The former should be favored to force versions in dependency resolution.
The Scala version set via ScalaModule#scalaVersion also takes over any Scala version provided via ResolutionParams#scalaVersionOpt.
The default configuration set in ResolutionParams#defaultConfiguration is ignored when Mill fetches dependencies to be passed to the compiler (equivalent to Maven "compile scope"). In that case, it forces the default configuration to be "compile". On the other hand, when fetching dependencies for runtime (equivalent to Maven "runtime scope"), the value in ResolutionParams#defaultConfiguration is used.
Attributes
- Inherited from:
- CoursierModule
- Source
- CoursierModule.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Module -> Any
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- JavaHomeModule
- Source
- JavaHomeModule.scala