Arguments constructor
Arguments(
- Variables variables, {
- String? buildMode = 'release',
- required String binaryType,
- String? target,
- String? flavor,
- String? dartDefines,
- String? dartDefinesFile,
- List<
String> ? customArgs, - String? buildName,
- String? buildNumber,
- bool pub = true,
- String? output,
- bool splitPerAbi = false,
- bool generateDebugSymbols = true,
- bool? configOnly,
- bool? trackWidgetCreation,
- bool? androidSkipBuildDependencyValidation,
- bool? analyzeSize,
- bool? ignoreDeprecation,
- bool? obfuscate,
- String? targetPlatform,
- String? androidProjectArg,
- String? codeSizeDirectory,
- String? splitDebugInfo,
Creates a new Android build arguments instance.
Parameters:
variables- Variable processor for argument substitutionbuildMode- Build mode (debug, profile, release)binaryType- Output type (apk or aab)target- Entry point file pathflavor- Build flavor for multi-flavor buildsdartDefines- Compile-time constantsdartDefinesFile- File containing compile-time constantscustomArgs- Additional custom argumentsbuildName- Version name for the buildbuildNumber- Version code for the buildpub- Whether to run pub get before buildingoutput- Output directory pathsplitPerAbi- Enable ABI-specific APK splittinggenerateDebugSymbols- Generate debug symbolsconfigOnly- Only generate configurationtrackWidgetCreation- Enable widget creation trackingandroidSkipBuildDependencyValidation- Skip dependency validationanalyzeSize- Enable size analysisignoreDeprecation- Ignore deprecation warningsobfuscate- Enable code obfuscationtargetPlatform- Target platform architectureandroidProjectArg- Additional Android project argumentscodeSizeDirectory- Directory for size analysis outputsplitDebugInfo- Path for debug info storage
Throws ArgumentError if splitPerAbi is true and binaryType is not "apk".
Implementation
Arguments(
super.variables, {
super.buildMode,
required super.binaryType,
super.target,
super.flavor,
super.dartDefines,
super.dartDefinesFile,
super.customArgs,
super.buildName,
super.buildNumber,
super.pub,
super.output,
this.splitPerAbi = false,
this.generateDebugSymbols = true,
this.configOnly,
this.trackWidgetCreation,
this.androidSkipBuildDependencyValidation,
this.analyzeSize,
this.ignoreDeprecation,
this.obfuscate,
this.targetPlatform,
this.androidProjectArg,
this.codeSizeDirectory,
this.splitDebugInfo,
}) : super(
buildSourceDir: binaryType == "apk"
? Files.androidOutputApks.path
: Files.androidOutputAppbundles.path,
) {
// Validate that splitPerAbi is only used with APK binary type
if (binaryType != 'apk' && splitPerAbi) {
throw ArgumentError('binaryType must be "apk" to use splitPerAbi');
}
}