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
5353d5e8
Unverified
Commit
5353d5e8
authored
Aug 28, 2019
by
Emmanuel Garcia
Committed by
GitHub
Aug 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fid app bundle in Gradle 3.5 (#39126)
parent
91ae1409
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
112 deletions
+103
-112
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+30
-28
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+73
-84
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
5353d5e8
...
...
@@ -819,28 +819,36 @@ Iterable<File> findApkFiles(GradleProject project, AndroidBuildInfo androidBuild
@visibleForTesting
File
findBundleFile
(
GradleProject
project
,
BuildInfo
buildInfo
)
{
final
String
bundleFileName
=
project
.
bundleFileFor
(
buildInfo
);
if
(
bundleFileName
==
null
)
{
return
null
;
}
File
bundleFile
=
project
.
bundleDirectory
.
childDirectory
(
camelCase
(
buildInfo
.
modeName
))
.
childFile
(
bundleFileName
);
if
(
bundleFile
.
existsSync
())
{
return
bundleFile
;
}
if
(
buildInfo
.
flavor
==
null
)
{
return
null
;
}
// Android Studio Gradle plugin v3 adds the flavor to the path. For the bundle the
// folder name is the flavor plus the mode name. On Windows, filenames aren't case sensitive.
// For example: foo_barRelease where `foo_bar` is the flavor and `Release` the mode name.
final
String
childDirName
=
'
${buildInfo.flavor}${camelCase('_' + buildInfo.modeName)}
'
;
bundleFile
=
project
.
bundleDirectory
.
childDirectory
(
childDirName
)
.
childFile
(
bundleFileName
);
if
(
bundleFile
.
existsSync
())
{
return
bundleFile
;
final
List
<
File
>
fileCandidates
=
<
File
>[
project
.
bundleDirectory
.
childDirectory
(
camelCase
(
buildInfo
.
modeName
))
.
childFile
(
'app.aab'
),
project
.
bundleDirectory
.
childDirectory
(
camelCase
(
buildInfo
.
modeName
))
.
childFile
(
'app-
${buildInfo.modeName}
.aab'
),
];
if
(
buildInfo
.
flavor
!=
null
)
{
// The Android Gradle plugin 3.0.0 adds the flavor name to the path.
// For example: In release mode, if the flavor name is `foo_bar`, then
// the directory name is `foo_barRelease`.
fileCandidates
.
add
(
project
.
bundleDirectory
.
childDirectory
(
'
${buildInfo.flavor}${camelCase('_' + buildInfo.modeName)}
'
)
.
childFile
(
'app.aab'
));
// The Android Gradle plugin 3.5.0 adds the flavor name to file name.
// For example: In release mode, if the flavor name is `foo_bar`, then
// the file name name is `app-foo_bar-release.aab`.
fileCandidates
.
add
(
project
.
bundleDirectory
.
childDirectory
(
'
${buildInfo.flavor}${camelCase('_' + buildInfo.modeName)}
'
)
.
childFile
(
'app-
${buildInfo.flavor}
-
${buildInfo.modeName}
.aab'
));
}
for
(
final
File
bundleFile
in
fileCandidates
)
{
if
(
bundleFile
.
existsSync
())
{
return
bundleFile
;
}
}
return
null
;
}
...
...
@@ -984,10 +992,4 @@ class GradleProject {
return
null
;
return
'assembleAar
${toTitleCase(productFlavor)}${toTitleCase(buildType)}
'
;
}
String
bundleFileFor
(
BuildInfo
buildInfo
)
{
// For app bundle all bundle names are called as app.aab. Product flavors
// & build types are differentiated as folders, where the aab will be added.
return
'app.aab'
;
}
}
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
5353d5e8
This diff is collapsed.
Click to expand it.
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