Skip to content

Commit

Permalink
No more gradlew, instead get gradle during gclient sync (flutter#28264)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield authored Aug 23, 2021
1 parent 9d9c532 commit 22af55c
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 602 deletions.
11 changes: 11 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,17 @@ deps = {
'src/third_party/pkg/when':
Var('dart_git') + '/when.git' + '@' + '0.2.0',

'src/gradle': {
'packages': [
{
'version': 'version:7.0.2',
'package': 'flutter/gradle'
}
],
'condition': 'download_android_deps',
'dep_type': 'cipd'
},

'src/third_party/android_tools/ndk': {
'packages': [
{
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/tool_signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Signature: e892e715f8184778851c5efcb6a1323a
Signature: 42213051c23cf7aacd7319a315599219

4 changes: 0 additions & 4 deletions testing/android_background_image/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@
/captures
.externalNativeBuild
.cache

!gradlew
!gradlew.bat
!gradle/wrapper/**
4 changes: 2 additions & 2 deletions testing/android_background_image/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _android_sources = [
gradle_task("android_lint") {
app_name = "android_background_image"
task = "lint"
gradlew_dir = rebase_path(".")
gradle_project_dir = rebase_path(".")
sources = _android_sources
outputs = [ "$root_out_dir/android_background_image/build/reports" ]

Expand All @@ -24,7 +24,7 @@ gradle_task("android_lint") {
gradle_task("build_apk") {
app_name = "android_background_image"
task = "assembleDebug"
gradlew_dir = rebase_path(".")
gradle_project_dir = rebase_path(".")
sources = _android_sources
outputs = [ "$root_out_dir/android_background_image/app/outputs/apk/debug/app-debug.apk" ]

Expand Down
11 changes: 0 additions & 11 deletions testing/android_background_image/android/gradle-home/.vpython

This file was deleted.

14 changes: 0 additions & 14 deletions testing/android_background_image/android/gradle-home/bin/python

This file was deleted.

Binary file not shown.

This file was deleted.

172 changes: 0 additions & 172 deletions testing/android_background_image/android/gradlew

This file was deleted.

84 changes: 0 additions & 84 deletions testing/android_background_image/android/gradlew.bat

This file was deleted.

6 changes: 3 additions & 3 deletions testing/rules/android.gni
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ template("gradle_task") {
assert(defined(invoker.task), "task is a required parmaeter")
assert(defined(invoker.outputs), "outputs is a required parameter")
assert(defined(invoker.sources), "sources is a required parameter")
assert(defined(invoker.gradlew_dir),
"gradlew_dir is required (normally: rebase_path(\".\"")
assert(defined(invoker.gradle_project_dir),
"gradle_project_dir is required (normally: rebase_path(\".\"")
assert(defined(invoker.app_name), "app_name is a required parameter")

script = "//flutter/testing/rules/run_gradle.py"
Expand All @@ -20,7 +20,7 @@ template("gradle_task") {
outputs = invoker.outputs
out_dir = rebase_path("$root_out_dir/${invoker.app_name}")
args = [
invoker.gradlew_dir,
invoker.gradle_project_dir,
invoker.task,
"--no-daemon",
"-Pflutter_jar=" + rebase_path("$root_out_dir/flutter.jar"),
Expand Down
13 changes: 8 additions & 5 deletions testing/rules/run_gradle.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# found in the LICENSE file.

"""
Invokes gradlew for building the scenario_app from GN/Ninja.
Invokes //gradle for building the Android apps from GN/Ninja.
"""

import os
Expand All @@ -14,6 +14,11 @@
import platform

SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))

BAT = '.bat' if sys.platform.startswith(('cygwin', 'win')) else ''
GRADLE_BIN = os.path.normpath(os.path.join(SCRIPT_PATH, '..', '..', '..',
'gradle', 'bin', 'gradle%s' % BAT))

ANDROID_HOME = os.path.normpath(os.path.join(SCRIPT_PATH, '..', '..', '..',
'third_party', 'android_tools', 'sdk'))

Expand All @@ -28,11 +33,9 @@ def main():
if not os.path.isdir(ANDROID_HOME):
raise Exception('%s (ANDROID_HOME) is not a directory' % ANDROID_HOME)

BAT = '.bat' if sys.platform.startswith(('cygwin', 'win')) else ''
android_dir = sys.argv[1]
gradle_bin = os.path.join('.', 'gradlew%s' % BAT)
result = subprocess.check_output(
args=[gradle_bin] + sys.argv[2:],
subprocess.check_output(
args=[GRADLE_BIN] + sys.argv[2:],
cwd=android_dir,
env=dict(os.environ, ANDROID_HOME=ANDROID_HOME, JAVA_HOME=JAVA_HOME),
)
Expand Down
Loading

0 comments on commit 22af55c

Please sign in to comment.