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
e82ddc4c
Unverified
Commit
e82ddc4c
authored
Oct 21, 2019
by
Emmanuel Garcia
Committed by
GitHub
Oct 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure `android.enableR8` is appended to a new line (#43187)
parent
27105cba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+8
-2
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+21
-0
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
e82ddc4c
...
...
@@ -387,8 +387,14 @@ void migrateToR8(Directory directory) {
}
printTrace
(
'set `android.enableR8=true` in gradle.properties'
);
try
{
gradleProperties
.
writeAsStringSync
(
'android.enableR8=true
\n
'
,
mode:
FileMode
.
append
);
// Add `android.enableR8=true` to the next line in gradle.properties.
if
(
propertiesContent
.
isNotEmpty
&&
!
propertiesContent
.
endsWith
(
'
\n
'
))
{
gradleProperties
.
writeAsStringSync
(
'
\n
android.enableR8=true
\n
'
,
mode:
FileMode
.
append
);
}
else
{
gradleProperties
.
writeAsStringSync
(
'android.enableR8=true
\n
'
,
mode:
FileMode
.
append
);
}
}
on
FileSystemException
{
throwToolExit
(
'The tool failed to add `android.enableR8=true` to
${gradleProperties.path}
. '
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
e82ddc4c
...
...
@@ -1410,6 +1410,27 @@ Exception in thread "main" java.lang.NullPointerException
FileSystem:
()
=>
memoryFileSystem
,
ProcessManager:
()
=>
FakeProcessManager
(<
FakeCommand
>[]),
});
testUsingContext
(
'appends android.enableR8=true to the new line'
,
()
{
final
Directory
sampleAppAndroid
=
fs
.
directory
(
'/sample-app/android'
);
sampleAppAndroid
.
createSync
(
recursive:
true
);
sampleAppAndroid
.
childFile
(
'gradle.properties'
)
.
writeAsStringSync
(
'org.gradle.jvmargs=-Xmx1536M'
);
migrateToR8
(
sampleAppAndroid
);
expect
(
testLogger
.
traceText
,
contains
(
'set `android.enableR8=true` in gradle.properties'
));
expect
(
sampleAppAndroid
.
childFile
(
'gradle.properties'
).
readAsStringSync
(),
equals
(
'org.gradle.jvmargs=-Xmx1536M
\n
'
'android.enableR8=true
\n
'
),
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
memoryFileSystem
,
ProcessManager:
()
=>
FakeProcessManager
(<
FakeCommand
>[]),
});
});
group
(
'isAppUsingAndroidX'
,
()
{
...
...
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