summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJeremy Walker <jewalker@google.com>2018-06-27 15:10:01 -0700
committerJeremy Walker <jewalker@google.com>2018-06-28 14:09:40 -0700
commitfeae3302df0d56d2097fdb64576d177989f40c36 (patch)
tree6e484fb419cbd2f5f41c83f49852d81d81cae808 /templates
parent7ffae4e667af3de9884f47e7924ab404e40564da (diff)
downloadbuild-feae3302df0d56d2097fdb64576d177989f40c36.tar.gz
Temp androidX support fix.
Bug: 110369130 Test: Manually tested. Change-Id: I63710ea847b9913f795632d8e8e0e90b27c3b739
Diffstat (limited to 'templates')
-rw-r--r--templates/Wear/Wearable/build.gradle.ftl9
-rw-r--r--templates/WearPlusShared/Shared/build.gradle.ftl7
-rw-r--r--templates/WearPlusShared/Wearable/build.gradle.ftl9
-rw-r--r--templates/WearPlusShared/_MODULE_/build.gradle.ftl12
-rw-r--r--templates/base-application/_MODULE_/build.gradle.ftl40
-rw-r--r--templates/base/_MODULE_/build.gradle.ftl50
-rw-r--r--templates/base/gradle.properties.ftl24
-rw-r--r--templates/create/_MODULE_/build.gradle.ftl5
8 files changed, 127 insertions, 29 deletions
diff --git a/templates/Wear/Wearable/build.gradle.ftl b/templates/Wear/Wearable/build.gradle.ftl
index e1f0420b..c083d84e 100644
--- a/templates/Wear/Wearable/build.gradle.ftl
+++ b/templates/Wear/Wearable/build.gradle.ftl
@@ -20,7 +20,12 @@ buildscript {
}
dependencies {
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}
@@ -51,7 +56,11 @@ dependencies {
</#list>
implementation ${play_services_wearable_dependency}
+
+ <#-- TODO (jewalker): Revise once androidX is released to production. -->
+ <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
implementation ${android_support_v13_dependency}
+ </#if>
<#if sample.preview_wearable_support_provided_dependency?? && sample.preview_wearable_support_provided_dependency?has_content>
compileOnly '${sample.preview_wearable_support_provided_dependency}'
diff --git a/templates/WearPlusShared/Shared/build.gradle.ftl b/templates/WearPlusShared/Shared/build.gradle.ftl
index a645a3d7..93b040a8 100644
--- a/templates/WearPlusShared/Shared/build.gradle.ftl
+++ b/templates/WearPlusShared/Shared/build.gradle.ftl
@@ -20,11 +20,16 @@ buildscript {
}
dependencies {
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}
-apply plugin: 'android-library'
+apply plugin: 'com.android.library'
repositories {
jcenter()
diff --git a/templates/WearPlusShared/Wearable/build.gradle.ftl b/templates/WearPlusShared/Wearable/build.gradle.ftl
index ea65a407..641d61ff 100644
--- a/templates/WearPlusShared/Wearable/build.gradle.ftl
+++ b/templates/WearPlusShared/Wearable/build.gradle.ftl
@@ -20,7 +20,12 @@ buildscript {
}
dependencies {
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}
@@ -43,7 +48,11 @@ dependencies {
<@update_play_services_dependency dep="${dep}" />
</#list>
implementation ${play_services_wearable_dependency}
+
+ <#-- TODO (jewalker): Revise once androidX is released to production. -->
+ <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
implementation ${android_support_v13_dependency}
+ </#if>
<#if sample.preview_wearable_support_provided_dependency?? && sample.preview_wearable_support_provided_dependency?has_content>
compileOnly '${sample.preview_wearable_support_provided_dependency}'
diff --git a/templates/WearPlusShared/_MODULE_/build.gradle.ftl b/templates/WearPlusShared/_MODULE_/build.gradle.ftl
index cb459fd0..e6615193 100644
--- a/templates/WearPlusShared/_MODULE_/build.gradle.ftl
+++ b/templates/WearPlusShared/_MODULE_/build.gradle.ftl
@@ -20,7 +20,12 @@ buildscript {
}
dependencies {
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}
@@ -46,7 +51,12 @@ dependencies {
implementation files(${dep})
</#list>
implementation ${play_services_wearable_dependency}
- implementation ${android_support_v13_dependency}
+
+ <#-- TODO (jewalker): Revise once androidX is released to production. -->
+ <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
+ implementation ${android_support_v13_dependency}
+ </#if>
+
implementation project(':Shared')
wearApp project(':Wearable')
}
diff --git a/templates/base-application/_MODULE_/build.gradle.ftl b/templates/base-application/_MODULE_/build.gradle.ftl
index 5050a8cc..039da2f7 100644
--- a/templates/base-application/_MODULE_/build.gradle.ftl
+++ b/templates/base-application/_MODULE_/build.gradle.ftl
@@ -20,7 +20,13 @@ buildscript {
}
dependencies {
+
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}
@@ -38,25 +44,35 @@ repositories {
dependencies {
-<#if !sample.auto_add_support_lib?has_content || sample.auto_add_support_lib == "true">
- <#if sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 7>
- implementation "com.android.support:support-v4:27.1.1"
- <#elseif sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 13>
- implementation "com.android.support:support-v4:27.1.1"
- implementation "com.android.support:gridlayout-v7:27.1.1"
- implementation "com.android.support:cardview-v7:27.1.1"
- <#else>
- implementation "com.android.support:support-v4:27.1.1"
- implementation "com.android.support:support-v13:27.1.1"
- implementation "com.android.support:cardview-v7:27.1.1"
+
+ <#-- TODO (jewalker): Revise once androidX is released to production. -->
+ <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
+
+ <#if !sample.auto_add_support_lib?has_content || sample.auto_add_support_lib == "true">
+ <#if sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 7>
+ implementation "com.android.support:support-v4:27.1.1"
+ <#elseif sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 13>
+ implementation "com.android.support:support-v4:27.1.1"
+ implementation "com.android.support:gridlayout-v7:27.1.1"
+ implementation "com.android.support:cardview-v7:27.1.1"
+ <#else>
+ implementation "com.android.support:support-v4:27.1.1"
+ implementation "com.android.support:support-v13:27.1.1"
+ implementation "com.android.support:cardview-v7:27.1.1"
+ </#if>
+ </#if>
+
</#if>
-</#if>
+
+
+
<#list sample.dependency as dep>
<#-- Output dependency after checking if it is a play services depdency and
needs the latest version number attached. -->
<@update_play_services_dependency dep="${dep}" />
</#list>
+
<#list sample.dependency_external as dep>
implementation files(${dep})
</#list>
diff --git a/templates/base/_MODULE_/build.gradle.ftl b/templates/base/_MODULE_/build.gradle.ftl
index 137d8ce5..4b3770e1 100644
--- a/templates/base/_MODULE_/build.gradle.ftl
+++ b/templates/base/_MODULE_/build.gradle.ftl
@@ -20,7 +20,12 @@ buildscript {
}
dependencies {
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}
@@ -37,35 +42,50 @@ repositories {
}
dependencies {
-<#if !sample.auto_add_support_lib?has_content || sample.auto_add_support_lib == "true">
- <#if sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 7>
- implementation "com.android.support:support-v4:27.1.1"
- implementation "com.android.support:appcompat-v7:27.1.1"
- <#elseif sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 13>
- implementation "com.android.support:support-v4:27.1.1"
- implementation "com.android.support:gridlayout-v7:27.1.1"
- implementation "com.android.support:cardview-v7:27.1.1"
- implementation "com.android.support:appcompat-v7:27.1.1"
- <#else>
- implementation "com.android.support:support-v4:27.1.1"
- implementation "com.android.support:support-v13:27.1.1"
- implementation "com.android.support:cardview-v7:27.1.1"
- implementation "com.android.support:appcompat-v7:27.1.1"
+
+ <#-- TODO (jewalker): Revise once androidX is released to production. -->
+ <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
+
+ <#if !sample.auto_add_support_lib?has_content || sample.auto_add_support_lib == "true">
+ <#if sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 7>
+ implementation "com.android.support:support-v4:27.1.1"
+ implementation "com.android.support:appcompat-v7:27.1.1"
+ <#elseif sample.minSdk?matches(r'^\d+$') && sample.minSdk?number < 13>
+ implementation "com.android.support:support-v4:27.1.1"
+ implementation "com.android.support:gridlayout-v7:27.1.1"
+ implementation "com.android.support:cardview-v7:27.1.1"
+ implementation "com.android.support:appcompat-v7:27.1.1"
+ <#else>
+ implementation "com.android.support:support-v4:27.1.1"
+ implementation "com.android.support:support-v13:27.1.1"
+ implementation "com.android.support:cardview-v7:27.1.1"
+ implementation "com.android.support:appcompat-v7:27.1.1"
+ </#if>
+ </#if>
+
</#if>
-</#if>
+
<#list sample.dependency as dep>
<#-- Output dependency after checking if it is a play services depdency and
needs the latest version number attached. -->
<@update_play_services_dependency dep="${dep}" />
</#list>
+
<#list sample.dependency_external as dep>
implementation files(${dep})
</#list>
+
<#if sample.wearable.has_handheld_app?has_content && sample.wearable.has_handheld_app?lower_case == "true">
implementation ${play_services_wearable_dependency}
+
+ <#-- TODO (jewalker): Revise once androidX is released to production. -->
+ <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
implementation ${android_support_v13_dependency}
+ </#if>
+
wearApp project(':Wearable')
</#if>
+
}
// The sample build uses multiple directories to
diff --git a/templates/base/gradle.properties.ftl b/templates/base/gradle.properties.ftl
new file mode 100644
index 00000000..08ff2d39
--- /dev/null
+++ b/templates/base/gradle.properties.ftl
@@ -0,0 +1,24 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Settings specified in this file will override any Gradle settings
+# configured through the IDE.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+
+<#-- Required with AndroidX. -->
+<#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+android.useAndroidX=true
+android.enableJetifier=true
+</#if>
diff --git a/templates/create/_MODULE_/build.gradle.ftl b/templates/create/_MODULE_/build.gradle.ftl
index 47c4b417..ec54650e 100644
--- a/templates/create/_MODULE_/build.gradle.ftl
+++ b/templates/create/_MODULE_/build.gradle.ftl
@@ -26,7 +26,12 @@ buildscript {
}
dependencies {
+ <#-- TODO (jewalker): Remove once 3.2 is in production. -->
+ <#if sample.androidX?? && sample.androidX?has_content && sample.androidX == "true">
+ classpath 'com.android.tools.build:gradle:3.2.0-beta01'
+ <#else>
classpath 'com.android.tools.build:gradle:3.1.3'
+ </#if>
}
}