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
f7173dcc
Unverified
Commit
f7173dcc
authored
Sep 20, 2019
by
Emmanuel Garcia
Committed by
GitHub
Sep 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use AndroidX in new projects by default (#40925)
parent
96482eeb
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
14 deletions
+20
-14
build.gradle
dev/integration_tests/android_host_app/app/build.gradle
+2
-2
MainActivity.java
...pp/app/src/main/java/io/flutter/add2app/MainActivity.java
+1
-1
gradle.properties
dev/integration_tests/android_host_app/gradle.properties
+3
-0
build.gradle
...tion_tests/module_host_with_custom_build/app/build.gradle
+1
-1
MainActivity.java
...d/app/src/main/java/io/flutter/addtoapp/MainActivity.java
+1
-1
gradle.properties
...ion_tests/module_host_with_custom_build/gradle.properties
+3
-0
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+2
-2
create_test.dart
...lutter_tools/test/general.shard/commands/create_test.dart
+7
-7
No files found.
dev/integration_tests/android_host_app/app/build.gradle
View file @
f7173dcc
...
...
@@ -14,11 +14,11 @@ android {
targetSdkVersion
28
versionCode
1
versionName
"1.0"
testInstrumentationRunner
"android
.support
.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"android
x
.test.runner.AndroidJUnitRunner"
}
}
dependencies
{
implementation
project
(
':flutter'
)
implementation
'
com.android.support:appcompat-v7:27.1.1
'
implementation
'
androidx.appcompat:appcompat:1.1.0
'
}
dev/integration_tests/android_host_app/app/src/main/java/io/flutter/add2app/MainActivity.java
View file @
f7173dcc
package
io
.
flutter
.
add2app
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
androidx.appcompat.app.AppCompatActivity
;
import
io.flutter.facade.Flutter
;
public
class
MainActivity
extends
AppCompatActivity
{
...
...
dev/integration_tests/android_host_app/gradle.properties
View file @
f7173dcc
org.gradle.jvmargs
=
-Xmx1536m
android.useAndroidX
=
true
android.enableJetifier
=
true
dev/integration_tests/module_host_with_custom_build/app/build.gradle
View file @
f7173dcc
...
...
@@ -39,5 +39,5 @@ android {
dependencies
{
implementation
project
(
':flutter'
)
implementation
'
com.android.support:appcompat-v7:27.1.1
'
implementation
'
androidx.appcompat:appcompat:1.1.0
'
}
dev/integration_tests/module_host_with_custom_build/app/src/main/java/io/flutter/addtoapp/MainActivity.java
View file @
f7173dcc
package
io
.
flutter
.
addtoapp
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
androidx.appcompat.app.AppCompatActivity
;
import
io.flutter.facade.Flutter
;
public
class
MainActivity
extends
AppCompatActivity
{
...
...
dev/integration_tests/module_host_with_custom_build/gradle.properties
View file @
f7173dcc
org.gradle.jvmargs
=
-Xmx1536m
android.useAndroidX
=
true
android.enableJetifier
=
true
packages/flutter_tools/lib/src/commands/create.dart
View file @
f7173dcc
...
...
@@ -141,7 +141,7 @@ class CreateCommand extends FlutterCommand {
argParser
.
addFlag
(
'androidx'
,
negatable:
true
,
defaultsTo:
fals
e
,
defaultsTo:
tru
e
,
help:
'Generate a project using the AndroidX support libraries'
,
);
// Deprecated
...
...
@@ -398,7 +398,7 @@ class CreateCommand extends FlutterCommand {
final
String
relativeDirPath
=
fs
.
path
.
relative
(
projectDirPath
);
if
(!
projectDir
.
existsSync
()
||
projectDir
.
listSync
().
isEmpty
)
{
printStatus
(
'Creating project
$relativeDirPath
...'
);
printStatus
(
'Creating project
$relativeDirPath
...
androidx:
${argResults['androidx']}
'
);
}
else
{
if
(
sampleCode
!=
null
&&
!
argResults
[
'overwrite'
])
{
throwToolExit
(
'Will not overwrite existing project in
$relativeDirPath
: '
...
...
packages/flutter_tools/test/general.shard/commands/create_test.dart
View file @
f7173dcc
...
...
@@ -410,7 +410,7 @@ void main() {
},
timeout:
allowForRemotePubInvocation
);
testUsingContext
(
'androidx app project'
,
()
async
{
testUsingContext
(
'androidx
is used by default in an
app project'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
when
(
mockFlutterVersion
.
frameworkRevision
).
thenReturn
(
frameworkRevision
);
when
(
mockFlutterVersion
.
channel
).
thenReturn
(
frameworkChannel
);
...
...
@@ -418,7 +418,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--androidx'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
void
expectExists
(
String
relPath
)
{
expect
(
fs
.
isFileSync
(
'
${projectDir.path}
/
$relPath
'
),
true
);
...
...
@@ -452,7 +452,7 @@ void main() {
expect
(
actualContents
.
contains
(
'useAndroidX'
),
false
);
},
timeout:
allowForCreateFlutterProject
);
testUsingContext
(
'androidx
app module
'
,
()
async
{
testUsingContext
(
'androidx
is used by default in a module project
'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
when
(
mockFlutterVersion
.
frameworkRevision
).
thenReturn
(
frameworkRevision
);
when
(
mockFlutterVersion
.
channel
).
thenReturn
(
frameworkChannel
);
...
...
@@ -460,7 +460,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--template=module'
,
'--no-pub'
,
'--androidx'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--template=module'
,
'--no-pub'
,
projectDir
.
path
]);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
...
...
@@ -469,7 +469,7 @@ void main() {
);
},
timeout:
allowForCreateFlutterProject
);
testUsingContext
(
'non androidx
app
module'
,
()
async
{
testUsingContext
(
'non androidx module'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
when
(
mockFlutterVersion
.
frameworkRevision
).
thenReturn
(
frameworkRevision
);
when
(
mockFlutterVersion
.
channel
).
thenReturn
(
frameworkChannel
);
...
...
@@ -486,7 +486,7 @@ void main() {
);
},
timeout:
allowForCreateFlutterProject
);
testUsingContext
(
'androidx plugin project'
,
()
async
{
testUsingContext
(
'androidx
is used by default in a
plugin project'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
when
(
mockFlutterVersion
.
frameworkRevision
).
thenReturn
(
frameworkRevision
);
when
(
mockFlutterVersion
.
channel
).
thenReturn
(
frameworkChannel
);
...
...
@@ -494,7 +494,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--androidx'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
void
expectExists
(
String
relPath
)
{
expect
(
fs
.
isFileSync
(
'
${projectDir.path}
/
$relPath
'
),
true
);
...
...
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