Unverified Commit cd294666 authored by hy's avatar hy Committed by GitHub

Add --dart-define option support to build aar command (#71829)

parent cd452286
...@@ -40,6 +40,7 @@ class BuildAarCommand extends BuildSubCommand { ...@@ -40,6 +40,7 @@ class BuildAarCommand extends BuildSubCommand {
usesPubOption(); usesPubOption();
addSplitDebugInfoOption(); addSplitDebugInfoOption();
addDartObfuscationOption(); addDartObfuscationOption();
usesDartDefineOption();
usesTrackWidgetCreation(verboseHelp: false); usesTrackWidgetCreation(verboseHelp: false);
addNullSafetyModeOptions(hide: !verboseHelp); addNullSafetyModeOptions(hide: !verboseHelp);
addEnableExperimentation(hide: !verboseHelp); addEnableExperimentation(hide: !verboseHelp);
......
...@@ -176,6 +176,7 @@ void main() { ...@@ -176,6 +176,7 @@ void main() {
'--split-debug-info', '--split-debug-info',
'/project-name/v1.2.3/', '/project-name/v1.2.3/',
'--obfuscate', '--obfuscate',
'--dart-define=foo=bar'
], ],
); );
...@@ -196,6 +197,7 @@ void main() { ...@@ -196,6 +197,7 @@ void main() {
expect(buildInfo.flavor, 'free'); expect(buildInfo.flavor, 'free');
expect(buildInfo.splitDebugInfoPath, '/project-name/v1.2.3/'); expect(buildInfo.splitDebugInfoPath, '/project-name/v1.2.3/');
expect(buildInfo.dartObfuscation, isTrue); expect(buildInfo.dartObfuscation, isTrue);
expect(buildInfo.dartDefines.contains('foo=bar'), isTrue);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
AndroidBuilder: () => mockAndroidBuilder, AndroidBuilder: () => mockAndroidBuilder,
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment