Arguments constructor

Arguments(
  1. Variables variables, {
  2. String? buildMode = 'release',
  3. required String binaryType,
  4. String? target,
  5. String? flavor,
  6. String? dartDefines,
  7. String? dartDefinesFile,
  8. List<String>? customArgs,
  9. String? buildName,
  10. String? buildNumber,
  11. bool pub = true,
  12. String? output,
  13. bool splitPerAbi = false,
  14. bool generateDebugSymbols = true,
  15. bool? configOnly,
  16. bool? trackWidgetCreation,
  17. bool? androidSkipBuildDependencyValidation,
  18. bool? analyzeSize,
  19. bool? ignoreDeprecation,
  20. bool? obfuscate,
  21. String? targetPlatform,
  22. String? androidProjectArg,
  23. String? codeSizeDirectory,
  24. String? splitDebugInfo,
})

Creates a new Android build arguments instance.

Parameters:

  • variables - Variable processor for argument substitution
  • buildMode - Build mode (debug, profile, release)
  • binaryType - Output type (apk or aab)
  • target - Entry point file path
  • flavor - Build flavor for multi-flavor builds
  • dartDefines - Compile-time constants
  • dartDefinesFile - File containing compile-time constants
  • customArgs - Additional custom arguments
  • buildName - Version name for the build
  • buildNumber - Version code for the build
  • pub - Whether to run pub get before building
  • output - Output directory path
  • splitPerAbi - Enable ABI-specific APK splitting
  • generateDebugSymbols - Generate debug symbols
  • configOnly - Only generate configuration
  • trackWidgetCreation - Enable widget creation tracking
  • androidSkipBuildDependencyValidation - Skip dependency validation
  • analyzeSize - Enable size analysis
  • ignoreDeprecation - Ignore deprecation warnings
  • obfuscate - Enable code obfuscation
  • targetPlatform - Target platform architecture
  • androidProjectArg - Additional Android project arguments
  • codeSizeDirectory - Directory for size analysis output
  • splitDebugInfo - 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');
  }
}