saker.android Documentation TaskDoc JavaDoc Packages
Performs dexing operations on Java bytecode using the Android d8 tool. The task converts the input Java bytecode to dex format that can run on Android devices. The result of this operation can be passed to the saker.apk.create() task to generate the APK that contains the classes.
Summary
Parameters
IdentifierSpecifies an identifier for the dexing operation.
Input
Required parameter.
Specifies the inputs for the dexing operation.
MainDexClassesSpecifies the binary names of Java classes that should be part of the main dex file.
MinAPISpecifies the minimum API level you want the output DEX files to support.
NoDesugaringDisables Java 8 language features.
OptimizeMultidexForLinearAllocIf set to true, legacy multidex partitioning will be optimized to reduce LinearAlloc usage during Dalvik DexOpt.
ReleaseCompiles DEX bytecode without debug information.
SDKsSpecifies the SDKs (Software Development Kits) used by the task.
Parameters
Specifies an identifier for the dexing operation. The identifier will be used to uniquely identify this operation, and to generate the output directory name.
Aliases:
Required parameter.
Specifies the inputs for the dexing operation. The inputs may be paths or wildcards to Java archives and directories containing .class files. Outputs of the saker.java.compile() task can also be passed directly as input. Classpath objects are also accepted. The parameter accepts results of Maven artifact resolutions. Note that aar bundles are not accepted as a direct input to this parameter. You may need to perform the class extractions from aar bundles if necessary.
Specifies the binary names of Java classes that should be part of the main dex file. This parameter must be used to enable multidexing. The specified classes will be placed in the main dex file.
Aliases:
MinSDKVersion
Specifies the minimum API level you want the output DEX files to support. Corresponds to the --min-api argument of d8.
Disables Java 8 language features. Set this parameter to tru only if you don't intend to compile Java bytecode that uses Java 8 language features. Corresponds to the --no-desugaring flag of d8.
If set to true, legacy multidex partitioning will be optimized to reduce LinearAlloc usage during Dalvik DexOpt. This option may not be supported in older versions of d8.Corresponds to the --optimize-multidex-for-linearalloc flag of d8.
Compiles DEX bytecode without debug information. Set this parameter to true when compiling bytecode for a public release. Corresponds to the --release flag of d8.
Specifies the SDKs (Software Development Kits) used by the task. SDKs represent development kits that are available in the build environment and to the task. They are used to find the necessary tools to perform the necessary operations. You should specify the AndroidBuildTools and AndroidPlatform SDKs so the build tasks can find the relevant tools to perform their operations. If you don't specify these SDKs, then the build tasks will attempt to locate them automatically. If they fail to do so, an exception is thrown. You can use the saker.android.sdk.buildtools() and saker.android.sdk.platform() tasks to retrieve SDKs with specific versions. The SDK names are compared in a case-insensitive way.