Commit 78ae8a2d authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Update gradle versions for generate_gradle.py

Also adds distributionUrl=, which my Android Studio told me is now
necessary :/

Also enables warnings via gradle.properties. Without this, I just get
a warning saying:
  "There was a warning, but to see it you need to enable warnings".

Bug: None
Change-Id: I7064ee3a82666866a56d2d69e04563fb7c7e44d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216323
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772373}
parent 8a802c41
......@@ -527,11 +527,35 @@ def _CreateJniLibsDir(output_dir, entry_output_dir, so_files):
def _GenerateLocalProperties(sdk_dir):
"""Returns the data for project.properties as a string."""
"""Returns the data for local.properties as a string."""
return '\n'.join([
'# Generated by //build/android/gradle/generate_gradle.py',
'sdk.dir=%s' % sdk_dir,
''])
'',
])
def _GenerateGradleWrapperPropertiesCanary():
"""Returns the data for gradle-wrapper.properties as a string."""
# Before May 2020, this wasn't necessary. Might not be necessary at some point
# in the future?
return '\n'.join([
'# Generated by //build/android/gradle/generate_gradle.py',
('distributionUrl=https\\://services.gradle.org/distributions/'
'gradle-6.4-rc-2-all.zip\n'),
'',
])
def _GenerateGradleProperties():
"""Returns the data for gradle.properties as a string."""
return '\n'.join([
'# Generated by //build/android/gradle/generate_gradle.py',
'',
'# Tells Gradle to show warnings during project sync.',
'org.gradle.warning.mode=all',
'',
])
def _GenerateBaseVars(generator, build_vars):
......@@ -930,6 +954,15 @@ def main():
_WriteFile(
os.path.join(generator.project_dir, 'local.properties'),
_GenerateLocalProperties(args.sdk_path))
_WriteFile(os.path.join(generator.project_dir, 'gradle.properties'),
_GenerateGradleProperties())
wrapper_properties = os.path.join(generator.project_dir, 'gradle', 'wrapper',
'gradle-wrapper.properties')
if os.path.exists(wrapper_properties):
os.unlink(wrapper_properties)
if args.canary:
_WriteFile(wrapper_properties, _GenerateGradleWrapperPropertiesCanary())
zip_tuples = []
generated_inputs = set()
......
......@@ -16,11 +16,11 @@ buildscript {
}
dependencies {
{% if channel == 'canary' %}
classpath "com.android.tools.build:gradle:4.0.0-alpha04"
classpath "com.android.tools.build:gradle:4.1.0-alpha09"
{% elif channel == 'beta' %}
classpath "com.android.tools.build:gradle:3.1.0-beta4"
classpath "com.android.tools.build:gradle:4.0.0-rc01"
{% else %}
classpath "com.android.tools.build:gradle:3.0.1"
classpath "com.android.tools.build:gradle:3.6.3"
{% endif %}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment