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
f6b47a5f
Unverified
Commit
f6b47a5f
authored
May 07, 2020
by
xster
Committed by
GitHub
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let the embedding maven engine dependency reference the storage proxy (#56164)
parent
8fbfe1cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
10 deletions
+93
-10
android_engine_dependency_proxy_test.dart
...celab/bin/tasks/android_engine_dependency_proxy_test.dart
+75
-0
aar_init_script.gradle
packages/flutter_tools/gradle/aar_init_script.gradle
+2
-1
flutter.gradle
packages/flutter_tools/gradle/flutter.gradle
+3
-3
resolve_dependencies.gradle
packages/flutter_tools/gradle/resolve_dependencies.gradle
+3
-1
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+2
-1
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+8
-4
No files found.
dev/devicelab/bin/tasks/android_engine_dependency_proxy_test.dart
0 → 100644
View file @
f6b47a5f
// 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/apk_utils.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
final
String
gradlew
=
Platform
.
isWindows
?
'gradlew.bat'
:
'gradlew'
;
final
String
gradlewExecutable
=
Platform
.
isWindows
?
'.
\\
$gradlew
'
:
'./
$gradlew
'
;
/// Tests that we respect storage proxy URLs in gradle dependencies.
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
'
);
section
(
'Create project'
);
await
runProjectTest
((
FlutterProject
flutterProject
)
async
{
await
inDirectory
(
path
.
join
(
flutterProject
.
rootPath
,
'android'
),
()
async
{
section
(
'Insert gradle testing script'
);
final
File
build
=
File
(
path
.
join
(
flutterProject
.
rootPath
,
'android'
,
'app'
,
'build.gradle'
));
build
.
writeAsStringSync
(
'''
task printEngineMavenUrl() {
doLast {
println project.repositories.find { it.name == '
maven
' }.url
}
}
'''
,
mode:
FileMode
.
append
,
flush:
true
,
);
section
(
'Checking default maven URL'
);
String
mavenUrl
=
await
eval
(
gradlewExecutable
,
<
String
>[
'printEngineMavenUrl'
,
'-q'
],
);
if
(
mavenUrl
!=
'https://storage.googleapis.com/download.flutter.io'
)
{
throw
TaskResult
.
failure
(
'Expected Android engine maven dependency URL to '
'resolve to https://storage.googleapis.com/download.flutter.io. Got '
'
$mavenUrl
instead'
);
}
section
(
'Checking overriden maven URL'
);
mavenUrl
=
await
eval
(
gradlewExecutable
,
<
String
>[
'printEngineMavenUrl'
,
'-q'
],
environment:
<
String
,
String
>{
'FLUTTER_STORAGE_BASE_URL'
:
'my.special.proxy'
,
}
);
if
(
mavenUrl
!=
'https://my.special.proxy/download.flutter.io'
)
{
throw
TaskResult
.
failure
(
'Expected overriden Android engine maven '
'dependency URL to resolve to proxy location '
'https://my.special.proxy/download.flutter.io. Got '
'
$mavenUrl
instead'
);
}
});
});
return
TaskResult
.
success
(
null
);
});
}
packages/flutter_tools/gradle/aar_init_script.gradle
View file @
f6b47a5f
...
...
@@ -53,11 +53,12 @@ void configureProject(Project project, String outputDir) {
"See: https://github.com/flutter/flutter/issues/40866"
)
}
String
storageUrl
=
System
.
getenv
(
'FLUTTER_STORAGE_BASE_URL'
)
?:
"storage.googleapis.com"
// This is a Flutter plugin project. Plugin projects don't apply the Flutter Gradle plugin,
// as a result, add the dependency on the embedding.
project
.
repositories
{
maven
{
url
"https://
storage.googleapis.com
/download.flutter.io"
url
"https://
$storageUrl
/download.flutter.io"
}
}
String
engineVersion
=
Paths
.
get
(
getFlutterRoot
(
project
),
"bin"
,
"internal"
,
"engine.version"
)
...
...
packages/flutter_tools/gradle/flutter.gradle
View file @
f6b47a5f
...
...
@@ -41,7 +41,7 @@ android {
apply
plugin:
FlutterPlugin
class
FlutterPlugin
implements
Plugin
<
Project
>
{
private
static
final
String
MAVEN_REPO
=
"https://storage.googleapis.com/download.flutter.io
"
;
private
static
final
String
DEFAULT_MAVEN_HOST
=
"storage.googleapis.com
"
;
// The platforms that can be passed to the `--Ptarget-platform` flag.
private
static
final
String
PLATFORM_ARM32
=
"android-arm"
;
...
...
@@ -200,10 +200,10 @@ class FlutterPlugin implements Plugin<Project> {
if
(!
supportsBuildMode
(
flutterBuildMode
))
{
return
}
String
hostedRepository
=
System
.
env
.
FLUTTER_STORAGE_BASE_URL
?:
DEFAULT_MAVEN_HOST
String
repository
=
useLocalEngine
()
?
project
.
property
(
'local-engine-repo'
)
:
MAVEN_REPO
:
"https://$hostedRepository/download.flutter.io"
project
.
rootProject
.
allprojects
{
repositories
{
maven
{
...
...
packages/flutter_tools/gradle/resolve_dependencies.gradle
View file @
f6b47a5f
...
...
@@ -14,11 +14,13 @@
import
java.nio.file.Paths
String
storageUrl
=
System
.
getenv
(
'FLUTTER_STORAGE_BASE_URL'
)
?:
"storage.googleapis.com"
repositories
{
google
()
jcenter
()
maven
{
url
"https://
storage.googleapis.com
/download.flutter.io"
url
"https://
$storageUrl
/download.flutter.io"
}
}
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
f6b47a5f
...
...
@@ -648,12 +648,13 @@ void printHowToConsumeAar({
1. Open
${fileSystem.path.join('<host>', 'app', 'build.gradle')}
2. Ensure you have the repositories configured, otherwise add them:
String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "storage.googleapis.com"
repositories {
maven {
url '
$
{
repoDirectory
.
path
}
'
}
maven {
url '
https:
//
storage.googleapis.com
/download.flutter.io'
url '
https:
//
\$storageUrl
/download.flutter.io'
}
}
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
f6b47a5f
...
...
@@ -2343,12 +2343,13 @@ plugin1=${plugin1.path}
' 1. Open <host>/app/build.gradle
\n
'
' 2. Ensure you have the repositories configured, otherwise add them:
\n
'
'
\n
'
' String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "storage.googleapis.com"
\n
'
' repositories {
\n
'
' maven {
\n
'
" url 'build/'
\n
"
' }
\n
'
' maven {
\n
'
" url 'https://
storage.googleapis.com
/download.flutter.io'
\n
"
" url 'https://
\
$storageUrl
/download.flutter.io'
\n
"
' }
\n
'
' }
\n
'
'
\n
'
...
...
@@ -2393,12 +2394,13 @@ plugin1=${plugin1.path}
' 1. Open <host>/app/build.gradle
\n
'
' 2. Ensure you have the repositories configured, otherwise add them:
\n
'
'
\n
'
' String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "storage.googleapis.com"
\n
'
' repositories {
\n
'
' maven {
\n
'
" url 'build/'
\n
"
' }
\n
'
' maven {
\n
'
" url 'https://
storage.googleapis.com
/download.flutter.io'
\n
"
" url 'https://
\
$storageUrl
/download.flutter.io'
\n
"
' }
\n
'
' }
\n
'
'
\n
'
...
...
@@ -2430,12 +2432,13 @@ plugin1=${plugin1.path}
' 1. Open <host>/app/build.gradle
\n
'
' 2. Ensure you have the repositories configured, otherwise add them:
\n
'
'
\n
'
' String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "storage.googleapis.com"
\n
'
' repositories {
\n
'
' maven {
\n
'
" url 'build/'
\n
"
' }
\n
'
' maven {
\n
'
" url 'https://
storage.googleapis.com
/download.flutter.io'
\n
"
" url 'https://
\
$storageUrl
/download.flutter.io'
\n
"
' }
\n
'
' }
\n
'
'
\n
'
...
...
@@ -2468,12 +2471,13 @@ plugin1=${plugin1.path}
' 1. Open <host>/app/build.gradle
\n
'
' 2. Ensure you have the repositories configured, otherwise add them:
\n
'
'
\n
'
' String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "storage.googleapis.com"
\n
'
' repositories {
\n
'
' maven {
\n
'
" url 'build/'
\n
"
' }
\n
'
' maven {
\n
'
" url 'https://
storage.googleapis.com
/download.flutter.io'
\n
"
" url 'https://
\
$storageUrl
/download.flutter.io'
\n
"
' }
\n
'
' }
\n
'
'
\n
'
...
...
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