mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Roll buildroot and update method of getting android SDK and support libs (#7284)
* Get support, use new SDK tooling from buildroot * Roll NDK to 19 * Skip Android bits on Windows with note
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
# .gclient file (the parent of 'src').
|
||||
#
|
||||
# Then commit .DEPS.git locally (gclient doesn't like dirty trees) and run
|
||||
# gclient sync
|
||||
# gclient sync..
|
||||
# Verify the thing happened you wanted. Then revert your .DEPS.git change
|
||||
# DO NOT CHECK IN CHANGES TO .DEPS.git upstream. It will be automatically
|
||||
# updated by a bot when you modify this one.
|
||||
@@ -116,7 +116,7 @@ allowed_hosts = [
|
||||
]
|
||||
|
||||
deps = {
|
||||
'src': 'https://github.com/flutter/buildroot.git' + '@' + '4a37279db248051cd25bbc93526c3001bdb8d785',
|
||||
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'ad6c0a07231e416bb3f96886b50778c70c491778',
|
||||
|
||||
# Fuchsia compatibility
|
||||
#
|
||||
@@ -403,13 +403,76 @@ hooks = [
|
||||
'action': ['python', 'src/build/vs_toolchain.py', 'update'],
|
||||
},
|
||||
{
|
||||
'name': 'download_android_tools',
|
||||
# Pull dart sdk if needed
|
||||
# this will be used by android_tools
|
||||
'name': 'dart',
|
||||
'pattern': '.',
|
||||
'action': ['python', 'src/tools/dart/update.py'],
|
||||
},
|
||||
{
|
||||
'name': 'prepare_android_downloader',
|
||||
'pattern': '.',
|
||||
'cwd': 'src/tools/android/android_sdk_downloader',
|
||||
'condition': 'host_os == "linux" or host_os == "mac"',
|
||||
'action': [
|
||||
'python',
|
||||
'src/tools/android/download_android_tools.py',
|
||||
'../../../third_party/dart/tools/sdks/dart-sdk/bin/pub', # this hook _must_ be run _after_ the dart hook.
|
||||
'get'
|
||||
],
|
||||
},
|
||||
# TODO(dnfield): This can be enabled when we actually support building
|
||||
# the android engine on windows. For now there's no sense in having
|
||||
# windows clients download bits they don't need.
|
||||
# see: https://github.com/flutter/flutter/issues/13841
|
||||
# {
|
||||
# 'name': 'prepare_android_downloader_win',
|
||||
# 'pattern': '.',
|
||||
# 'cwd': 'src\\tools\\android\\android_sdk_downloader',
|
||||
# 'condition': 'host_os == "win"',
|
||||
# 'action': [
|
||||
# '..\\..\\..\\third_party\\dart\\tools\\sdks\\dart-sdk\\bin\\pub.bat', # this hook _must_ be run _after_ the dart hook.
|
||||
# 'get'
|
||||
# ],
|
||||
# },
|
||||
{
|
||||
'name': 'download_android_tools',
|
||||
'pattern': '.',
|
||||
'condition': 'host_os == "mac" or host_os == "linux"',
|
||||
'action': [
|
||||
'src/third_party/dart/tools/sdks/dart-sdk/bin/dart', # this hook _must_ be run _after_ the dart hook.
|
||||
'--enable-asserts',
|
||||
'src/tools/android/android_sdk_downloader/lib/main.dart',
|
||||
'-y', # Accept licenses
|
||||
'--out=src/third_party/android_tools',
|
||||
'--platform=28',
|
||||
'--platform-revision=6',
|
||||
'--build-tools-version=28.0.3',
|
||||
'--platform-tools-version=28.0.1',
|
||||
'--tools-version=26.1.1',
|
||||
'--ndk-version=19.0.5232133'
|
||||
],
|
||||
},
|
||||
# TODO(dnfield): This can be enabled when we actually support building
|
||||
# the android engine on windows. For now there's no sense in having
|
||||
# windows clients download bits they don't need.
|
||||
# see: https://github.com/flutter/flutter/issues/13841
|
||||
# {
|
||||
# 'name': 'download_android_tools_win',
|
||||
# 'pattern': '.',
|
||||
# 'condition': 'host_os == "win"',
|
||||
# 'action': [
|
||||
# 'src\\third_party\\dart\\tools\\sdks\\dart-sdk\\bin\\dart.exe', # this hook _must_ be run _after_ the dart hook.
|
||||
# '--enable-asserts',
|
||||
# 'src\\tools\\android\\android_sdk_downloader\\lib\\main.dart',
|
||||
# '-y', # Accept licenses
|
||||
# '--out=src\\third_party\\android_tools',
|
||||
# '--platform=28',
|
||||
# '--platform-revision=6',
|
||||
# '--build-tools-version=28.0.3',
|
||||
# '--platform-tools-version=28.0.1',
|
||||
# '--tools-version=26.1.1',
|
||||
# '--ndk-version=19.0.5232133'
|
||||
# ],
|
||||
# },
|
||||
{
|
||||
'name': 'download_android_support',
|
||||
'pattern': '.',
|
||||
@@ -426,12 +489,6 @@ hooks = [
|
||||
'src/tools/buildtools/update.py',
|
||||
],
|
||||
},
|
||||
{
|
||||
# Pull dart sdk if needed
|
||||
'name': 'dart',
|
||||
'pattern': '.',
|
||||
'action': ['python', 'src/tools/dart/update.py'],
|
||||
},
|
||||
{
|
||||
'name': 'generate_package_files',
|
||||
'pattern': '.',
|
||||
|
||||
@@ -154,6 +154,11 @@ java_library("flutter_shell_java") {
|
||||
|
||||
deps = [
|
||||
":android_support_v13",
|
||||
":android_support_annotations",
|
||||
":android_support_compat",
|
||||
":android_support_fragment",
|
||||
":android_arch_lifecycle_common",
|
||||
":android_arch_lifecycle_viewmodel",
|
||||
]
|
||||
|
||||
jar_path = "$root_out_dir/flutter_java.jar"
|
||||
@@ -162,7 +167,37 @@ java_library("flutter_shell_java") {
|
||||
java_prebuilt("android_support_v13") {
|
||||
supports_android = true
|
||||
|
||||
jar_path = "//third_party/android_tools/sdk/extras/android/support/v13/android-support-v13.jar"
|
||||
jar_path = "//third_party/android_support/android_support_v13.jar"
|
||||
}
|
||||
|
||||
java_prebuilt("android_support_compat") {
|
||||
supports_android = true
|
||||
|
||||
jar_path = "//third_party/android_support/android_support_compat.jar"
|
||||
}
|
||||
|
||||
java_prebuilt("android_support_annotations") {
|
||||
supports_android = true
|
||||
|
||||
jar_path = "//third_party/android_support/android_support_annotations.jar"
|
||||
}
|
||||
|
||||
java_prebuilt("android_support_fragment") {
|
||||
supports_android = true
|
||||
|
||||
jar_path = "//third_party/android_support/android_support_fragment.jar"
|
||||
}
|
||||
|
||||
java_prebuilt("android_arch_lifecycle_common") {
|
||||
supports_android = true
|
||||
|
||||
jar_path = "//third_party/android_support/android_arch_lifecycle_common.jar"
|
||||
}
|
||||
|
||||
java_prebuilt("android_arch_lifecycle_viewmodel") {
|
||||
supports_android = true
|
||||
|
||||
jar_path = "//third_party/android_support/android_arch_lifecycle_viewmodel.jar"
|
||||
}
|
||||
|
||||
copy("flutter_shell_assets") {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
https://maven.google.com/com/android/support/support-fragment/28.0.0/support-fragment-28.0.0.aar
|
||||
@@ -8,40 +8,48 @@ import sys
|
||||
import urllib2
|
||||
import cStringIO
|
||||
import zipfile
|
||||
import json
|
||||
|
||||
# Path constants. (All of these should be absolute paths.)
|
||||
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
FLUTTER_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..'))
|
||||
INSTALL_DIR = os.path.join(FLUTTER_DIR, 'third_party', 'android_support')
|
||||
|
||||
def GetInstalledVersion(version_stamp):
|
||||
version_file = os.path.join(INSTALL_DIR, version_stamp)
|
||||
def GetInstalledVersion(out_file_name):
|
||||
version_file = os.path.join(INSTALL_DIR, out_file_name + '.stamp')
|
||||
if not os.path.exists(version_file):
|
||||
return None
|
||||
with open(version_file) as f:
|
||||
return f.read().strip()
|
||||
|
||||
def main():
|
||||
def getFile(url, out_file_name):
|
||||
# Read latest version.
|
||||
version_stamp = 'VERSION_SUPPORT_FRAGMENT'
|
||||
version = ''
|
||||
with open(os.path.join(THIS_DIR, version_stamp)) as f:
|
||||
version = f.read().strip()
|
||||
# Return if installed binaries are up to date.
|
||||
if version == GetInstalledVersion(version_stamp):
|
||||
if url == GetInstalledVersion(out_file_name):
|
||||
return
|
||||
|
||||
# Download the AAR and extract the JAR.
|
||||
aar = urllib2.urlopen(version).read()
|
||||
aar_zip = zipfile.ZipFile(cStringIO.StringIO(aar))
|
||||
downloaded_file = urllib2.urlopen(url).read()
|
||||
if not os.path.exists(INSTALL_DIR):
|
||||
os.mkdir(INSTALL_DIR)
|
||||
with open(os.path.join(INSTALL_DIR, 'android_support_fragment.jar'), 'w') as f:
|
||||
f.write(aar_zip.read('classes.jar'))
|
||||
os.mkdir(INSTALL_DIR)
|
||||
|
||||
if (url.endswith('.aar')):
|
||||
aar_zip = zipfile.ZipFile(cStringIO.StringIO(downloaded_file))
|
||||
with open(os.path.join(INSTALL_DIR, out_file_name), 'w') as f:
|
||||
f.write(aar_zip.read('classes.jar'))
|
||||
else:
|
||||
with open(os.path.join(INSTALL_DIR, out_file_name), 'w') as f:
|
||||
f.write(downloaded_file)
|
||||
|
||||
# Write version as the last step.
|
||||
with open(os.path.join(INSTALL_DIR, version_stamp), 'w') as f:
|
||||
f.write('%s\n' % version)
|
||||
with open(os.path.join(INSTALL_DIR, out_file_name + '.stamp'), 'w') as f:
|
||||
f.write('%s\n' % url)
|
||||
|
||||
|
||||
def main():
|
||||
with open (os.path.join(THIS_DIR, 'files.json')) as f:
|
||||
files = json.load(f)
|
||||
|
||||
for file, url in files.items():
|
||||
getFile(url, file)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"android_arch_lifecycle_common.jar": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common/1.1.1/common-1.1.1.jar",
|
||||
"android_arch_lifecycle_viewmodel.jar": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/viewmodel/1.1.1/viewmodel-1.1.1.aar",
|
||||
"android_support_fragment.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/28.0.0/support-fragment-28.0.0.aar",
|
||||
"android_support_v13.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-v13/28.0.0/support-v13-28.0.0.aar",
|
||||
"android_support_annotations.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/28.0.0/support-annotations-28.0.0.jar",
|
||||
"android_support_compat.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-compat/28.0.0/support-compat-28.0.0.aar"
|
||||
}
|
||||
@@ -25,7 +25,12 @@ def main():
|
||||
|
||||
classpath = [
|
||||
ANDROID_SRC_ROOT,
|
||||
'third_party/android_tools/sdk/extras/android/support/v13/android-support-v13.jar',
|
||||
'third_party/android_support/android_arch_lifecycle_common.jar',
|
||||
'third_party/android_support/android_arch_lifecycle_viewmodel.jar',
|
||||
'third_party/android_support/android_support_annotations.jar',
|
||||
'third_party/android_support/android_support_compat.jar',
|
||||
'third_party/android_support/android_support_fragment.jar',
|
||||
'third_party/android_support/android_support_v13.jar',
|
||||
'third_party/android_tools/sdk/platforms/android-28/android.jar',
|
||||
'base/android/java/src',
|
||||
'third_party/jsr-305/src/ri/src/main/java',
|
||||
|
||||
Reference in New Issue
Block a user