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
54dba4cd
Unverified
Commit
54dba4cd
authored
Apr 12, 2020
by
Emmanuel Garcia
Committed by
GitHub
Apr 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't import plugins that don't support android in settings.gradle (#54407)
parent
1118d247
Changes
49
Hide whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
595 additions
and
392 deletions
+595
-392
settings.gradle
dev/benchmarks/macrobenchmarks/android/settings.gradle
+7
-11
settings.gradle
dev/benchmarks/test_apps/stocks/android/settings.gradle
+7
-11
test.dart
dev/bots/test.dart
+1
-0
gradle_deprecated_settings_test.dart
dev/devicelab/bin/tasks/gradle_deprecated_settings_test.dart
+57
-0
gradle_migrate_settings_test.dart
dev/devicelab/bin/tasks/gradle_migrate_settings_test.dart
+3
-3
settings.gradle
..._tests/abstract_method_smoke_test/android/settings.gradle
+7
-11
settings.gradle
...s/android_embedding_v2_smoke_test/android/settings.gradle
+7
-11
settings.gradle
...n_tests/android_semantics_testing/android/settings.gradle
+7
-11
settings.gradle
...creens/splash_screen_kitchen_sink/android/settings.gradle
+7
-11
settings.gradle
...screens/splash_screen_load_rotate/android/settings.gradle
+7
-11
settings.gradle
...creens/splash_screen_trans_rotate/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/android_views/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/channels/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/codegen/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/external_ui/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/flavors/android/settings.gradle
+7
-11
settings.gradle
...ts/flutter_driver_screenshot_test/android/settings.gradle
+7
-11
settings.gradle
...integration_tests/flutter_gallery/android/settings.gradle
+7
-11
README.md
dev/integration_tests/gradle_deprecated_settings/README.md
+7
-0
build.gradle
...tests/gradle_deprecated_settings/android/app/build.gradle
+45
-0
AndroidManifest.xml
...recated_settings/android/app/src/main/AndroidManifest.xml
+25
-0
MainActivity.java
...p/src/main/java/com/yourcompany/flavors/MainActivity.java
+26
-0
build.gradle
...ion_tests/gradle_deprecated_settings/android/build.gradle
+33
-0
gradle.properties
...ests/gradle_deprecated_settings/android/gradle.properties
+4
-0
gradle-wrapper.properties
...settings/android/gradle/wrapper/gradle-wrapper.properties
+6
-0
settings.gradle
..._tests/gradle_deprecated_settings/android/settings.gradle
+24
-0
main.dart
...ntegration_tests/gradle_deprecated_settings/lib/main.dart
+9
-0
pubspec.yaml
...integration_tests/gradle_deprecated_settings/pubspec.yaml
+21
-0
settings.gradle
dev/integration_tests/image_loading/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/named_isolates/android/settings.gradle
+7
-11
settings.gradle
...ration_tests/platform_interaction/android/settings.gradle
+7
-11
settings.gradle
...egration_tests/release_smoke_test/android/settings.gradle
+7
-11
settings.gradle
dev/integration_tests/ui/android/settings.gradle
+7
-11
settings.gradle
dev/manual_tests/android/settings.gradle
+7
-11
settings.gradle
examples/catalog/android/settings.gradle
+7
-11
settings.gradle
examples/flutter_view/android/settings.gradle
+7
-11
settings.gradle
examples/hello_world/android/settings.gradle
+7
-11
settings.gradle
examples/image_list/android/settings.gradle
+7
-11
settings.gradle
examples/layers/android/settings.gradle
+7
-11
settings.gradle
examples/platform_channel/android/settings.gradle
+7
-11
settings.gradle
examples/platform_view/android/settings.gradle
+7
-11
app_plugin_loader.gradle
packages/flutter_tools/gradle/app_plugin_loader.gradle
+30
-0
deprecated_settings.gradle
packages/flutter_tools/gradle/deprecated_settings.gradle
+16
-0
manual_migration_settings.gradle.md
.../flutter_tools/gradle/manual_migration_settings.gradle.md
+7
-12
module_plugin_loader.gradle
packages/flutter_tools/gradle/module_plugin_loader.gradle
+44
-0
settings.gradle
.../flutter_tools/templates/app/android.tmpl/settings.gradle
+11
-11
include_flutter.groovy.copy.tmpl
...s/module/android/library/include_flutter.groovy.copy.tmpl
+13
-28
include_flutter.groovy.copy.tmpl
...id/library_new_embedding/include_flutter.groovy.copy.tmpl
+13
-28
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+4
-2
No files found.
dev/benchmarks/macrobenchmarks/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/benchmarks/test_apps/stocks/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/bots/test.dart
View file @
54dba4cd
...
@@ -917,6 +917,7 @@ Future<void> _runHostOnlyDeviceLabTests() async {
...
@@ -917,6 +917,7 @@ Future<void> _runHostOnlyDeviceLabTests() async {
// TODO(ianh): Fails on macOS looking for "dexdump", https://github.com/flutter/flutter/issues/42494
// TODO(ianh): Fails on macOS looking for "dexdump", https://github.com/flutter/flutter/issues/42494
if
(!
Platform
.
isMacOS
)
()
=>
_runDevicelabTest
(
'gradle_jetifier_test'
,
environment:
gradleEnvironment
),
if
(!
Platform
.
isMacOS
)
()
=>
_runDevicelabTest
(
'gradle_jetifier_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_non_android_plugin_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_non_android_plugin_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_deprecated_settings_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_plugin_bundle_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_plugin_bundle_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_plugin_fat_apk_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_plugin_fat_apk_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_plugin_light_apk_test'
,
environment:
gradleEnvironment
),
()
=>
_runDevicelabTest
(
'gradle_plugin_light_apk_test'
,
environment:
gradleEnvironment
),
...
...
dev/devicelab/bin/tasks/gradle_deprecated_settings_test.dart
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
/// Tests that apps can be built using the deprecated `android/settings.gradle` file.
/// This test should be removed once apps have been migrated to this new file.
// TODO(egarciad): Migrate existing files, https://github.com/flutter/flutter/issues/54566
Future
<
void
>
main
()
async
{
await
task
(()
async
{
section
(
'Find Java'
);
final
String
javaHome
=
await
findJavaHome
();
if
(
javaHome
==
null
)
return
TaskResult
.
failure
(
'Could not find Java'
);
print
(
'
\n
Using JAVA_HOME=
$javaHome
'
);
final
Directory
projectDirectory
=
dir
(
'
${flutterDirectory.path}
/dev/integration_tests/gradle_deprecated_settings'
);
try
{
section
(
'Build debug APK using deprecated settings.gradle'
);
await
inDirectory
(
projectDirectory
,
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--debug'
,
'--target-platform'
,
'android-arm'
,
'--no-shrink'
,
'--verbose'
,
],
);
});
final
File
debugApk
=
File
(
path
.
join
(
projectDirectory
.
path
,
'build'
,
'app'
,
'outputs'
,
'flutter-apk'
,
'app-debug.apk'
,
));
if
(!
exists
(
debugApk
))
{
return
TaskResult
.
failure
(
'Failed to build debug APK.'
);
}
return
TaskResult
.
success
(
null
);
}
catch
(
e
)
{
return
TaskResult
.
failure
(
e
.
toString
());
}
});
}
dev/devicelab/bin/tasks/gradle_migrate_settings_test.dart
View file @
54dba4cd
...
@@ -117,7 +117,7 @@ plugins.each { name, path ->
...
@@ -117,7 +117,7 @@ plugins.each { name, path ->
section
(
'Override settings.gradle with custom logic'
);
section
(
'Override settings.gradle with custom logic'
);
const
String
customDeprecatedFileContent
=
'''
const
String
customDeprecatedFileContent
=
r
''
'
include '
:
app
'
include '
:
app
'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
...
@@ -130,8 +130,8 @@ if (pluginsFile.exists()) {
...
@@ -130,8 +130,8 @@ if (pluginsFile.exists()) {
plugins.each { name, path ->
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('
android
').toFile()
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('
android
').toFile()
include ":
\
$name
"
include ":
$name
"
project(":
\
$name
").projectDir = pluginDirectory
project(":
$name
").projectDir = pluginDirectory
}
}
// some custom logic
// some custom logic
'''
;
'''
;
...
...
dev/integration_tests/abstract_method_smoke_test/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/android_embedding_v2_smoke_test/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/android_semantics_testing/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/android_splash_screens/splash_screen_kitchen_sink/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/android_splash_screens/splash_screen_load_rotate/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/android_splash_screens/splash_screen_trans_rotate/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/android_views/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/channels/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/codegen/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/external_ui/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/flavors/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/flutter_driver_screenshot_test/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/flutter_gallery/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/gradle_deprecated_settings/README.md
0 → 100644
View file @
54dba4cd
# Deprecated settings.gradle
This project is meant to test that apps using the current
`android/settings.gradle`
can still be built. This project can be removed once apps have been migrated to
this new file.
Issue: https://github.com/flutter/flutter/issues/54566
\ No newline at end of file
dev/integration_tests/gradle_deprecated_settings/android/app/build.gradle
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
def
localProperties
=
new
Properties
()
def
localPropertiesFile
=
rootProject
.
file
(
'local.properties'
)
if
(
localPropertiesFile
.
exists
())
{
localPropertiesFile
.
withInputStream
{
stream
->
localProperties
.
load
(
stream
)
}
}
def
flutterRoot
=
localProperties
.
getProperty
(
'flutter.sdk'
)
if
(
flutterRoot
==
null
)
{
throw
new
GradleException
(
"Flutter SDK not found. Define location with flutter.sdk in the local.properties file."
)
}
apply
plugin:
'com.android.application'
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android
{
compileSdkVersion
28
lintOptions
{
disable
'InvalidPackage'
}
defaultConfig
{
applicationId
"com.yourcompany.flavors"
minSdkVersion
21
targetSdkVersion
28
versionCode
1
versionName
"1.0"
}
buildTypes
{
release
{
signingConfig
signingConfigs
.
debug
}
}
}
flutter
{
source
'../..'
}
dev/integration_tests/gradle_deprecated_settings/android/app/src/main/AndroidManifest.xml
0 → 100644
View file @
54dba4cd
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.yourcompany.flavors"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<application
android:name=
"io.flutter.app.FlutterApplication"
android:label=
"flavors"
>
<activity
android:name=
".MainActivity"
android:launchMode=
"singleTop"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated=
"true"
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
</manifest>
dev/integration_tests/gradle_deprecated_settings/android/app/src/main/java/com/yourcompany/flavors/MainActivity.java
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
com
.
yourcompany
.
flavors
;
import
android.os.Bundle
;
import
io.flutter.app.FlutterActivity
;
import
io.flutter.plugin.common.MethodCall
;
import
io.flutter.plugin.common.MethodChannel
;
import
io.flutter.plugins.GeneratedPluginRegistrant
;
public
class
MainActivity
extends
FlutterActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
GeneratedPluginRegistrant
.
registerWith
(
this
);
new
MethodChannel
(
getFlutterView
(),
"flavor"
).
setMethodCallHandler
(
new
MethodChannel
.
MethodCallHandler
()
{
@Override
public
void
onMethodCall
(
MethodCall
methodCall
,
MethodChannel
.
Result
result
)
{
result
.
success
(
BuildConfig
.
FLAVOR
);
}
});
}
}
dev/integration_tests/gradle_deprecated_settings/android/build.gradle
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
buildscript
{
repositories
{
google
()
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.5.0'
}
}
allprojects
{
repositories
{
google
()
jcenter
()
}
}
rootProject
.
buildDir
=
'../build'
subprojects
{
project
.
buildDir
=
"${rootProject.buildDir}/${project.name}"
}
subprojects
{
project
.
evaluationDependsOn
(
':app'
)
}
task
clean
(
type:
Delete
)
{
delete
rootProject
.
buildDir
}
dev/integration_tests/gradle_deprecated_settings/android/gradle.properties
0 → 100644
View file @
54dba4cd
org.gradle.jvmargs
=
-Xmx1536M
android.useAndroidX
=
true
android.enableJetifier
=
true
android.enableR8
=
true
dev/integration_tests/gradle_deprecated_settings/android/gradle/wrapper/gradle-wrapper.properties
0 → 100644
View file @
54dba4cd
#Fri Jun 23 08:50:38 CEST 2017
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-5.6.2-all.zip
dev/integration_tests/gradle_deprecated_settings/android/settings.gradle
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is the `settings.gradle` file that apps currently use.
// This file has changed, so it must be migrated in existing projects.
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
include
":$name"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/gradle_deprecated_settings/lib/main.dart
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
void
main
(
)
{
runApp
(
const
Text
(
'Nothing to show'
));
}
dev/integration_tests/gradle_deprecated_settings/pubspec.yaml
0 → 100644
View file @
54dba4cd
name
:
gradle_deprecated_settings
description
:
Integration test for the current settings.gradle.
environment
:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
dependencies
:
flutter
:
sdk
:
flutter
camera
:
0.5.7+4
collection
:
1.14.12
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
meta
:
1.1.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
typed_data
:
1.1.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
vector_math
:
2.0.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM: 185d
dev/integration_tests/image_loading/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/named_isolates/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/platform_interaction/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/release_smoke_test/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/integration_tests/ui/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
dev/manual_tests/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/catalog/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/flutter_view/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/hello_world/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/image_list/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/layers/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/platform_channel/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
examples/platform_view/android/settings.gradle
View file @
54dba4cd
...
@@ -4,16 +4,12 @@
...
@@ -4,16 +4,12 @@
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withInputStream
{
stream
->
plugins
.
load
(
stream
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
packages/flutter_tools/gradle/app_plugin_loader.gradle
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is included from `<app>/android/settings.gradle`,
// so it can be versioned with the Flutter SDK.
import
groovy.json.JsonSlurper
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
// Note: if this logic is changed, also change the logic in module_plugin_loader.gradle.
def
pluginsFile
=
new
File
(
flutterProjectRoot
,
'.flutter-plugins-dependencies'
)
if
(!
pluginsFile
.
exists
())
{
return
}
def
object
=
new
JsonSlurper
().
parseText
(
pluginsFile
.
text
)
assert
object
instanceof
Map
assert
object
.
plugins
instanceof
Map
assert
object
.
plugins
.
android
instanceof
List
// Includes the Flutter plugins that support the Android platform.
object
.
plugins
.
android
.
each
{
androidPlugin
->
assert
androidPlugin
.
name
instanceof
String
assert
androidPlugin
.
path
instanceof
String
def
pluginDirectory
=
new
File
(
androidPlugin
.
path
,
'android'
)
assert
pluginDirectory
.
exists
()
include
":${androidPlugin.name}"
project
(
":${androidPlugin.name}"
).
projectDir
=
pluginDirectory
}
packages/flutter_tools/gradle/deprecated_settings.gradle
View file @
54dba4cd
...
@@ -29,3 +29,19 @@ plugins.each { name, path ->
...
@@ -29,3 +29,19 @@ plugins.each { name, path ->
include
":$name"
include
":$name"
project
(
":$name"
).
projectDir
=
pluginDirectory
project
(
":$name"
).
projectDir
=
pluginDirectory
}
}
;
EOF
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
include
':app'
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
packages/flutter_tools/gradle/manual_migration_settings.gradle.md
View file @
54dba4cd
...
@@ -3,17 +3,12 @@ To manually update `settings.gradle`, follow these steps:
...
@@ -3,17 +3,12 @@ To manually update `settings.gradle`, follow these steps:
1. Copy `settings.gradle` as `settings_aar.gradle`
1. Copy `settings.gradle` as `settings_aar.gradle`
2. Remove the following code from `settings_aar.gradle`:
2. Remove the following code from `settings_aar.gradle`:
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
def plugins = new Properties()
assert localPropertiesFile.exists()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
packages/flutter_tools/gradle/module_plugin_loader.gradle
0 → 100644
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is included from `<module>/.android/include_flutter.groovy`,
// so it can be versioned with the Flutter SDK.
import
groovy.json.JsonSlurper
def
moduleProjectRoot
=
project
(
':flutter'
).
projectDir
.
parentFile
.
parentFile
// Note: if this logic is changed, also change the logic in app_plugin_loader.gradle.
def
pluginsFile
=
new
File
(
moduleProjectRoot
,
'.flutter-plugins-dependencies'
)
if
(
pluginsFile
.
exists
())
{
def
object
=
new
JsonSlurper
().
parseText
(
pluginsFile
.
text
)
assert
object
instanceof
Map
assert
object
.
plugins
instanceof
Map
assert
object
.
plugins
.
android
instanceof
List
// Includes the Flutter plugins that support the Android platform.
object
.
plugins
.
android
.
each
{
androidPlugin
->
assert
androidPlugin
.
name
instanceof
String
assert
androidPlugin
.
path
instanceof
String
def
pluginDirectory
=
new
File
(
androidPlugin
.
path
,
'android'
)
assert
pluginDirectory
.
exists
()
include
":${androidPlugin.name}"
project
(
":${androidPlugin.name}"
).
projectDir
=
pluginDirectory
}
}
gradle
.
getGradle
().
projectsLoaded
{
g
->
g
.
rootProject
.
beforeEvaluate
{
p
->
def
_mainModuleName
=
binding
.
variables
[
'mainModuleName'
]
if
(
_mainModuleName
!=
null
&&
!
_mainModuleName
.
empty
)
{
p
.
ext
.
mainModuleName
=
_mainModuleName
}
}
g
.
rootProject
.
afterEvaluate
{
p
->
p
.
subprojects
{
sp
->
if
(
sp
.
name
!=
'flutter'
)
{
sp
.
evaluationDependsOn
(
':flutter'
)
}
}
}
}
packages/flutter_tools/templates/app/android.tmpl/settings.gradle
View file @
54dba4cd
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
include
':app'
include
':app'
def
flutterProjectRoot
=
rootProject
.
projectDir
.
parentFile
.
toPath
()
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
def
plugins
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
def
pluginsFile
=
new
File
(
flutterProjectRoot
.
toFile
(),
'.flutter-plugins'
)
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
if
(
pluginsFile
.
exists
())
{
pluginsFile
.
withReader
(
'UTF-8'
)
{
reader
->
plugins
.
load
(
reader
)
}
}
plugins
.
each
{
name
,
path
->
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
def
pluginDirectory
=
flutterProjectRoot
.
resolve
(
path
).
resolve
(
'android'
).
toFile
()
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
include
":$name"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
project
(
":$name"
).
projectDir
=
pluginDirectory
}
packages/flutter_tools/templates/module/android/library/include_flutter.groovy.copy.tmpl
View file @
54dba4cd
// Generated file. Do not edit.
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
gradle.include
':flutter'
gradle.include
":flutter"
gradle.project(
':flutter').projectDir = new File(flutterProjectRoot, '.android/Flutter'
)
gradle.project(
":flutter").projectDir = new File(flutterProjectRoot, ".android/Flutter"
)
def plugins = new Properties()
def localPropertiesFile = new File(flutterProjectRoot, ".android/local.properties")
def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins')
def properties = new Properties()
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
assert localPropertiesFile.exists(), "❗️The Flutter module doesn't have a `$localPropertiesFile` file." +
def pluginDirectory = flutterProjectRoot.toPath().resolve(path).resolve('android').toFile()
"\nYou must run `flutter pub get` in `$flutterProjectRoot`."
gradle.include ":$name"
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
gradle.project(":$name").projectDir = pluginDirectory
}
gradle.getGradle().projectsLoaded { g ->
def flutterSdkPath = properties.getProperty("flutter.sdk")
g.rootProject.beforeEvaluate { p ->
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
_mainModuleName = binding.variables['mainModuleName']
gradle.apply from: "$flutterSdkPath/packages/flutter_tools/gradle/module_plugin_loader.gradle"
if (_mainModuleName != null && !_mainModuleName.empty) {
p.ext.mainModuleName = _mainModuleName
}
}
g.rootProject.afterEvaluate { p ->
p.subprojects { sp ->
if (sp.name != 'flutter') {
sp.evaluationDependsOn(':flutter')
}
}
}
}
packages/flutter_tools/templates/module/android/library_new_embedding/include_flutter.groovy.copy.tmpl
View file @
54dba4cd
// Generated file. Do not edit.
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
gradle.include
':flutter'
gradle.include
":flutter"
gradle.project(
':flutter').projectDir = new File(flutterProjectRoot, '.android/Flutter'
)
gradle.project(
":flutter").projectDir = new File(flutterProjectRoot, ".android/Flutter"
)
def plugins = new Properties()
def localPropertiesFile = new File(flutterProjectRoot, ".android/local.properties")
def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins')
def properties = new Properties()
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
assert localPropertiesFile.exists(), "❗️The Flutter module doesn't have a `$localPropertiesFile` file." +
def pluginDirectory = flutterProjectRoot.toPath().resolve(path).resolve('android').toFile()
"\nYou must run `flutter pub get` in `$flutterProjectRoot`."
gradle.include ":$name"
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
gradle.project(":$name").projectDir = pluginDirectory
}
gradle.getGradle().projectsLoaded { g ->
def flutterSdkPath = properties.getProperty("flutter.sdk")
g.rootProject.beforeEvaluate { p ->
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
_mainModuleName = binding.variables['mainModuleName']
gradle.apply from: "$flutterSdkPath/packages/flutter_tools/gradle/module_plugin_loader.gradle"
if (_mainModuleName != null && !_mainModuleName.empty) {
p.ext.mainModuleName = _mainModuleName
}
}
g.rootProject.afterEvaluate { p ->
p.subprojects { sp ->
if (sp.name != 'flutter') {
sp.evaluationDependsOn(':flutter')
}
}
}
}
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
54dba4cd
...
@@ -470,8 +470,10 @@ if (pluginsFile.exists()) {
...
@@ -470,8 +470,10 @@ if (pluginsFile.exists()) {
plugins.each { name, path ->
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('
android
').toFile()
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('
android
').toFile()
include ":
$name
"
if (pluginDirectory.exists()) {
project(":
$name
").projectDir = pluginDirectory
include ":
$name
"
project(":
$name
").projectDir = pluginDirectory
}
}
}
'''
;
'''
;
...
...
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