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
864c406b
Unverified
Commit
864c406b
authored
Oct 10, 2022
by
Gary Qian
Committed by
GitHub
Oct 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scramble order of operations of flutter.gradle (#111747)
parent
1966aaf8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
flutter.gradle
packages/flutter_tools/gradle/flutter.gradle
+30
-30
No files found.
packages/flutter_tools/gradle/flutter.gradle
View file @
864c406b
...
...
@@ -236,36 +236,6 @@ class FlutterPlugin implements Plugin<Project> {
String
flutterExecutableName
=
Os
.
isFamily
(
Os
.
FAMILY_WINDOWS
)
?
"flutter.bat"
:
"flutter"
flutterExecutable
=
Paths
.
get
(
flutterRoot
.
absolutePath
,
"bin"
,
flutterExecutableName
).
toFile
();
String
flutterProguardRules
=
Paths
.
get
(
flutterRoot
.
absolutePath
,
"packages"
,
"flutter_tools"
,
"gradle"
,
"flutter_proguard_rules.pro"
)
project
.
android
.
buildTypes
{
// Add profile build type.
profile
{
initWith
debug
if
(
it
.
hasProperty
(
"matchingFallbacks"
))
{
matchingFallbacks
=
[
"debug"
,
"release"
]
}
}
// TODO(garyq): Shrinking is only false for multi apk split aot builds, where shrinking is not allowed yet.
// This limitation has been removed experimentally in gradle plugin version 4.2, so we can remove
// this check when we upgrade to 4.2+ gradle. Currently, deferred components apps may see
// increased app size due to this.
if
(
shouldShrinkResources
(
project
))
{
release
{
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled
true
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
// NOTE: The resource shrinker can't be used for libraries.
shrinkResources
isBuiltAsApp
(
project
)
// Fallback to `android/app/proguard-rules.pro`.
// This way, custom Proguard rules can be configured as needed.
proguardFiles
project
.
android
.
getDefaultProguardFile
(
"proguard-android.txt"
),
flutterProguardRules
,
"proguard-rules.pro"
}
}
}
if
(
project
.
hasProperty
(
"multidex-enabled"
)
&&
project
.
property
(
"multidex-enabled"
).
toBoolean
()
&&
project
.
android
.
defaultConfig
.
minSdkVersion
<=
20
)
{
...
...
@@ -298,6 +268,36 @@ class FlutterPlugin implements Plugin<Project> {
}
}
String
flutterProguardRules
=
Paths
.
get
(
flutterRoot
.
absolutePath
,
"packages"
,
"flutter_tools"
,
"gradle"
,
"flutter_proguard_rules.pro"
)
project
.
android
.
buildTypes
{
// Add profile build type.
profile
{
initWith
debug
if
(
it
.
hasProperty
(
"matchingFallbacks"
))
{
matchingFallbacks
=
[
"debug"
,
"release"
]
}
}
// TODO(garyq): Shrinking is only false for multi apk split aot builds, where shrinking is not allowed yet.
// This limitation has been removed experimentally in gradle plugin version 4.2, so we can remove
// this check when we upgrade to 4.2+ gradle. Currently, deferred components apps may see
// increased app size due to this.
if
(
shouldShrinkResources
(
project
))
{
release
{
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled
true
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
// NOTE: The resource shrinker can't be used for libraries.
shrinkResources
isBuiltAsApp
(
project
)
// Fallback to `android/app/proguard-rules.pro`.
// This way, custom Proguard rules can be configured as needed.
proguardFiles
project
.
android
.
getDefaultProguardFile
(
"proguard-android.txt"
),
flutterProguardRules
,
"proguard-rules.pro"
}
}
}
if
(
useLocalEngine
())
{
// This is required to pass the local engine to flutter build aot.
String
engineOutPath
=
project
.
property
(
'local-engine-out'
)
...
...
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