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
cc95c972
Unverified
Commit
cc95c972
authored
Feb 11, 2021
by
mx1up
Committed by
GitHub
Feb 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly pass on gradle exit code (#71484) (#71582)
parent
236ee295
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+2
-2
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+46
-0
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
cc95c972
...
...
@@ -645,8 +645,8 @@ Future<void> buildGradleAar({
globals
.
printStatus
(
result
.
stdout
,
wrap:
false
);
globals
.
printError
(
result
.
stderr
,
wrap:
false
);
throwToolExit
(
'Gradle task
$aarTask
failed with exit code
$
exitCode
.'
,
exitCode:
exitCode
,
'Gradle task
$aarTask
failed with exit code
$
{result.exitCode}
.'
,
exitCode:
result
.
exitCode
,
);
}
final
Directory
repoDirectory
=
getRepoDirectory
(
outputDirectory
);
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
cc95c972
...
...
@@ -1704,6 +1704,52 @@ plugin1=${plugin1.path}
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'gradle exit code is properly passed on'
,
()
async
{
final
File
manifestFile
=
fileSystem
.
file
(
'pubspec.yaml'
);
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
writeAsStringSync
(
'''
flutter:
module:
androidPackage: com.example.test
'''
);
fileSystem
.
file
(
'.android/gradlew'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'.android/gradle.properties'
)
.
writeAsStringSync
(
'irrelevant'
);
fileSystem
.
file
(
'.android/build.gradle'
)
.
createSync
(
recursive:
true
);
// Let any process start. Assert after.
when
(
mockProcessManager
.
run
(
any
,
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
1
,
108
,
''
,
''
));
fileSystem
.
directory
(
'build/outputs/repo'
).
createSync
(
recursive:
true
);
await
expectLater
(()
async
=>
await
buildGradleAar
(
androidBuildInfo:
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
null
,
treeShakeIcons:
false
)),
project:
FlutterProject
.
current
(),
outputDirectory:
fileSystem
.
directory
(
'build/'
),
target:
''
,
buildNumber:
'1.0'
,
)
,
throwsToolExit
(
exitCode:
108
,
message:
'Gradle task assembleAarRelease failed with exit code 108.'
));
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
mockAndroidSdk
,
AndroidStudio:
()
=>
mockAndroidStudio
,
Cache:
()
=>
cache
,
Platform:
()
=>
android
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'build apk uses selected local engine,the engine abi is arm'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
...
...
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