Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7ce6d414
Unverified
Commit
7ce6d414
authored
Nov 12, 2021
by
pan
Committed by
GitHub
Nov 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --extra-gen-snapshot-options support for build_aar command. (#91590)
parent
e9519d8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
build_aar.dart
packages/flutter_tools/lib/src/commands/build_aar.dart
+1
-0
build_aar_test.dart
...r_tools/test/commands.shard/permeable/build_aar_test.dart
+61
-0
No files found.
packages/flutter_tools/lib/src/commands/build_aar.dart
View file @
7ce6d414
...
...
@@ -44,6 +44,7 @@ class BuildAarCommand extends BuildSubCommand {
addSplitDebugInfoOption
();
addDartObfuscationOption
();
usesDartDefineOption
();
usesExtraDartFlagOptions
(
verboseHelp:
verboseHelp
);
usesTrackWidgetCreation
(
verboseHelp:
false
);
addNullSafetyModeOptions
(
hide:
!
verboseHelp
);
addEnableExperimentation
(
hide:
!
verboseHelp
);
...
...
packages/flutter_tools/test/commands.shard/permeable/build_aar_test.dart
View file @
7ce6d414
...
...
@@ -7,10 +7,12 @@
import
'package:args/command_runner.dart'
;
import
'package:flutter_tools/src/android/android_builder.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_studio.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build_aar.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
...
...
@@ -20,6 +22,8 @@ import 'package:test/fake.dart';
import
'../../src/android_common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/fake_process_manager.dart'
;
import
'../../src/fakes.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
void
main
(
)
{
...
...
@@ -190,9 +194,18 @@ void main() {
group
(
'Gradle'
,
()
{
Directory
tempDir
;
AndroidSdk
mockAndroidSdk
;
String
gradlew
;
FakeProcessManager
processManager
;
String
flutterRoot
;
setUp
(()
{
tempDir
=
globals
.
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_tools_packages_test.'
);
mockAndroidSdk
=
FakeAndroidSdk
();
gradlew
=
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'flutter_project'
,
'.android'
,
globals
.
platform
.
isWindows
?
'gradlew.bat'
:
'gradlew'
);
processManager
=
FakeProcessManager
.
empty
();
flutterRoot
=
getFlutterRoot
();
});
tearDown
(()
{
...
...
@@ -219,6 +232,46 @@ void main() {
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
testUsingContext
(
'support ExtraDartFlagOptions'
,
()
async
{
final
String
projectPath
=
await
createProject
(
tempDir
,
arguments:
<
String
>[
'--no-pub'
,
'--template=module'
]);
processManager
.
addCommand
(
FakeCommand
(
command:
<
String
>[
gradlew
,
'-I=
${globals.fs.path.join(flutterRoot, 'packages', 'flutter_tools', 'gradle','aar_init_script.gradle')}
'
,
'-Pflutter-root=
$flutterRoot
'
,
'-Poutput-dir=
${globals.fs.path.join(tempDir.path, 'flutter_project', 'build', 'host')}
'
,
'-Pis-plugin=false'
,
'-PbuildNumber=1.0'
,
'-q'
,
'-Ptarget=
${globals.fs.path.join('lib', 'main.dart')}
'
,
'-Pdart-obfuscation=false'
,
'-Pextra-front-end-options=foo,bar'
,
'-Ptrack-widget-creation=true'
,
'-Ptree-shake-icons=true'
,
'-Ptarget-platform=android-arm,android-arm64,android-x64'
,
'assembleAarRelease'
,
],
exitCode:
1
,
));
await
expectLater
(()
=>
runBuildAarCommand
(
projectPath
,
arguments:
<
String
>[
'--no-debug'
,
'--no-profile'
,
'--extra-front-end-options=foo'
,
'--extra-front-end-options=bar'
,
]),
throwsToolExit
(
message:
'Gradle task assembleAarRelease failed with exit code 1'
));
expect
(
processManager
,
hasNoRemainingExpectations
);
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
mockAndroidSdk
,
FlutterProjectFactory:
()
=>
FakeFlutterProjectFactory
(
tempDir
),
ProcessManager:
()
=>
processManager
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isIOSEnabled:
false
),
AndroidStudio:
()
=>
FakeAndroidStudio
(),
});
});
}
...
...
@@ -259,3 +312,11 @@ class FakeAndroidBuilder extends Fake implements AndroidBuilder {
this
.
buildNumber
=
buildNumber
;
}
}
class
FakeAndroidSdk
extends
Fake
implements
AndroidSdk
{
}
class
FakeAndroidStudio
extends
Fake
implements
AndroidStudio
{
@override
String
get
javaPath
=>
'java'
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment