Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 6e6963a

Browse files
Merge pull request #373 from wojtek-kalicinski/agp7.0.0-beta03
Upgrade to AGP 7.0.0-beta03
2 parents 807e020 + e6a614c commit 6e6963a

File tree

7 files changed

+129
-62
lines changed

7 files changed

+129
-62
lines changed

androidTest-shared/build.gradle.kts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ plugins {
2020
}
2121

2222
android {
23-
compileSdkVersion(Versions.COMPILE_SDK)
23+
compileSdk = Versions.COMPILE_SDK
2424
defaultConfig {
25-
minSdkVersion(Versions.MIN_SDK)
26-
targetSdkVersion(Versions.TARGET_SDK)
27-
versionCode = 1
28-
versionName = "1.0"
25+
minSdk = Versions.MIN_SDK
26+
targetSdk = Versions.TARGET_SDK
2927

3028
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3129
}
3230

33-
lintOptions {
31+
lint {
3432
// Version changes are beyond our control, so don't warn. The IDE will still mark these.
3533
disable("GradleDependency")
3634
}

ar/build.gradle.kts

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import kotlin.reflect.full.memberFunctions
18+
119
/*
220
* Copyright 2020 Google LLC
321
*
@@ -21,30 +39,30 @@ plugins {
2139
}
2240

2341
android {
24-
compileSdkVersion(Versions.COMPILE_SDK)
42+
compileSdk = Versions.COMPILE_SDK
2543
defaultConfig {
26-
minSdkVersion(Versions.MIN_SDK)
27-
targetSdkVersion(Versions.TARGET_SDK)
28-
versionCode = 1
29-
versionName = "1.0"
44+
minSdk = Versions.MIN_SDK
45+
targetSdk = Versions.TARGET_SDK
3046
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3147
consumerProguardFiles("consumer-proguard-rules.pro")
3248
}
3349

3450
buildTypes {
3551
maybeCreate("staging")
3652
getByName("staging") {
37-
initWith(getByName("debug"))
53+
// TODO: replace with initWith(getByName("debug")) in 7.0.0-beta04
54+
// https://issuetracker.google.com/issues/186798050
55+
this::class.memberFunctions.first { it.name == "initWith" }.call(this, getByName("debug"))
3856

3957
// Specifies a sorted list of fallback build types that the
4058
// plugin should try to use when a dependency does not include a
4159
// "staging" build type.
4260
// Used with :test-shared, which doesn't have a staging variant.
43-
setMatchingFallbacks(listOf("debug"))
61+
matchingFallbacks += listOf("debug")
4462
}
4563
}
4664

47-
lintOptions {
65+
lint {
4866
disable("InvalidPackage")
4967
// Version changes are beyond our control, so don't warn. The IDE will still mark these.
5068
disable("GradleDependency")

benchmark/build.gradle.kts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import kotlin.reflect.full.memberFunctions
18+
119
/*
220
* Copyright 2020 Google LLC
321
*
@@ -17,35 +35,33 @@
1735
plugins {
1836
id("com.android.library")
1937
kotlin("android")
20-
kotlin("android.extensions")
2138
id("androidx.benchmark")
2239
kotlin("kapt")
2340
}
2441

2542
android {
26-
compileSdkVersion(Versions.COMPILE_SDK)
43+
compileSdk = Versions.COMPILE_SDK
2744
defaultConfig {
28-
minSdkVersion(Versions.MIN_SDK)
29-
targetSdkVersion(Versions.TARGET_SDK)
30-
versionCode = 1
31-
versionName = "1.0"
45+
minSdk = Versions.MIN_SDK
46+
targetSdk = Versions.TARGET_SDK
3247
testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner"
3348
}
3449

3550
buildTypes {
3651
maybeCreate("staging")
3752
getByName("staging") {
38-
initWith(getByName("debug"))
53+
// TODO: replace with initWith(getByName("debug")) in 7.0.0-beta04
54+
// https://issuetracker.google.com/issues/186798050
55+
this::class.memberFunctions.first { it.name == "initWith" }.call(this, getByName("debug"))
3956
isDefault = true
40-
versionNameSuffix = "-staging"
4157
isMinifyEnabled = true
4258
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
4359

4460
// Specifies a sorted list of fallback build types that the
4561
// plugin should try to use when a dependency does not include a
4662
// "staging" build type.
4763
// Used with :test-shared, which doesn't have a staging variant.
48-
setMatchingFallbacks(listOf("debug"))
64+
matchingFallbacks += listOf("debug")
4965
}
5066
}
5167

buildSrc/src/main/java/Versions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ object Versions {
2323
const val TARGET_SDK = 30
2424
const val MIN_SDK = 21
2525

26-
const val ANDROID_GRADLE_PLUGIN = "7.0.0-alpha14"
26+
const val ANDROID_GRADLE_PLUGIN = "7.0.0-beta03"
2727
const val BENCHMARK = "1.0.0"
2828
const val COMPOSE = "1.0.0-beta04"
2929
const val FIREBASE_CRASHLYTICS = "2.3.0"
3030
const val GOOGLE_SERVICES = "4.3.3"
3131
const val KOTLIN = "1.4.32"
3232
const val NAVIGATION = "2.3.5"
33-
const val HILT_AGP = "2.34-beta"
33+
const val HILT_AGP = "2.36"
3434

3535
// TODO: Remove this once the version for
3636
// "org.threeten:threetenbp:${Versions.threetenbp}:no-tzdb" using java-platform in the
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Wed Feb 10 08:38:31 CET 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-rc-2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

mobile/build.gradle.kts

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import kotlin.reflect.full.memberFunctions
18+
119
/*
220
* Copyright 2020 Google LLC
321
*
@@ -17,7 +35,6 @@
1735
plugins {
1836
id("com.android.application")
1937
kotlin("android")
20-
kotlin("android.extensions")
2138
kotlin("kapt")
2239
id("androidx.navigation.safeargs.kotlin")
2340
id("com.google.firebase.crashlytics")
@@ -37,23 +54,23 @@ android {
3754
buildConfigField(
3855
"com.google.android.gms.maps.model.LatLng",
3956
"MAP_VIEWPORT_BOUND_NE",
40-
"new com.google.android.gms.maps.model.LatLng(${properties["map_viewport_bound_ne"]})"
57+
"new com.google.android.gms.maps.model.LatLng(${project.properties["map_viewport_bound_ne"]})"
4158
)
4259
buildConfigField(
4360
"com.google.android.gms.maps.model.LatLng",
4461
"MAP_VIEWPORT_BOUND_SW",
45-
"new com.google.android.gms.maps.model.LatLng(${properties["map_viewport_bound_sw"]})"
62+
"new com.google.android.gms.maps.model.LatLng(${project.properties["map_viewport_bound_sw"]})"
4663
)
4764

48-
buildConfigField("float", "MAP_CAMERA_FOCUS_ZOOM", properties["map_camera_focus_zoom"] as String)
65+
buildConfigField("float", "MAP_CAMERA_FOCUS_ZOOM", project.properties["map_camera_focus_zoom"] as String)
4966

50-
resValue("dimen", "map_camera_bearing", properties["map_default_camera_bearing"] as String)
51-
resValue("dimen", "map_camera_target_lat", properties["map_default_camera_target_lat"] as String)
52-
resValue("dimen", "map_camera_target_lng", properties["map_default_camera_target_lng"] as String)
53-
resValue("dimen", "map_camera_tilt", properties["map_default_camera_tilt"] as String)
54-
resValue("dimen", "map_camera_zoom", properties["map_default_camera_zoom"] as String)
55-
resValue("dimen", "map_viewport_min_zoom", properties["map_viewport_min_zoom"] as String)
56-
resValue("dimen", "map_viewport_max_zoom", properties["map_viewport_max_zoom"] as String)
67+
resValue("dimen", "map_camera_bearing", project.properties["map_default_camera_bearing"] as String)
68+
resValue("dimen", "map_camera_target_lat", project.properties["map_default_camera_target_lat"] as String)
69+
resValue("dimen", "map_camera_target_lng", project.properties["map_default_camera_target_lng"] as String)
70+
resValue("dimen", "map_camera_tilt", project.properties["map_default_camera_tilt"] as String)
71+
resValue("dimen", "map_camera_zoom", project.properties["map_default_camera_zoom"] as String)
72+
resValue("dimen", "map_viewport_min_zoom", project.properties["map_viewport_min_zoom"] as String)
73+
resValue("dimen", "map_viewport_max_zoom", project.properties["map_viewport_max_zoom"] as String)
5774

5875
manifestPlaceholders["crashlyticsEnabled"] = true
5976

@@ -93,14 +110,16 @@ android {
93110
}
94111
maybeCreate("staging")
95112
getByName("staging") {
96-
initWith(getByName("debug"))
113+
// TODO: replace with initWith(getByName("debug")) in 7.0.0-beta04
114+
// https://issuetracker.google.com/issues/186798050
115+
this::class.memberFunctions.first { it.name == "initWith" }.call(this, getByName("debug"))
97116
versionNameSuffix = "-staging"
98117

99118
// Specifies a sorted list of fallback build types that the
100119
// plugin should try to use when a dependency does not include a
101120
// "staging" build type.
102121
// Used with :test-shared, which doesn't have a staging variant.
103-
setMatchingFallbacks(listOf("debug"))
122+
matchingFallbacks += listOf("debug")
104123
}
105124
}
106125

@@ -134,7 +153,7 @@ android {
134153
}
135154
}
136155

137-
lintOptions {
156+
lint {
138157
// Eliminates UnusedResources false positives for resources used in DataBinding layouts
139158
isCheckGeneratedSources = true
140159
// Running lint over the debug variant is enough
@@ -162,8 +181,8 @@ android {
162181
}
163182

164183
packagingOptions {
165-
exclude("META-INF/AL2.0")
166-
exclude("META-INF/LGPL2.1")
184+
resources.excludes += "META-INF/AL2.0"
185+
resources.excludes += "META-INF/LGPL2.1"
167186
}
168187
}
169188

shared/build.gradle.kts

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import kotlin.reflect.full.memberFunctions
18+
119
/*
220
* Copyright 2020 Google LLC
321
*
@@ -17,39 +35,36 @@
1735
plugins {
1836
id("com.android.library")
1937
kotlin("android")
20-
kotlin("android.extensions")
2138
kotlin("kapt")
2239
id("dagger.hilt.android.plugin")
2340
}
2441

2542
android {
26-
compileSdkVersion(Versions.COMPILE_SDK)
43+
compileSdk = Versions.COMPILE_SDK
2744
defaultConfig {
28-
minSdkVersion(Versions.MIN_SDK)
29-
targetSdkVersion(Versions.TARGET_SDK)
30-
versionCode = 1
31-
versionName = "1.0"
45+
minSdk = Versions.MIN_SDK
46+
targetSdk = Versions.TARGET_SDK
3247
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3348

34-
buildConfigField("String", "CONFERENCE_TIMEZONE", properties["conference_timezone"] as String)
35-
buildConfigField("String", "CONFERENCE_DAY1_START", properties["conference_day1_start"] as String)
36-
buildConfigField("String", "CONFERENCE_DAY1_END", properties["conference_day1_end"] as String)
37-
buildConfigField("String", "CONFERENCE_DAY2_START", properties["conference_day2_start"] as String)
38-
buildConfigField("String", "CONFERENCE_DAY2_END", properties["conference_day2_end"] as String)
39-
buildConfigField("String", "CONFERENCE_DAY3_START", properties["conference_day3_start"] as String)
40-
buildConfigField("String", "CONFERENCE_DAY3_END", properties["conference_day3_end"] as String)
49+
buildConfigField("String", "CONFERENCE_TIMEZONE", project.properties["conference_timezone"] as String)
50+
buildConfigField("String", "CONFERENCE_DAY1_START", project.properties["conference_day1_start"] as String)
51+
buildConfigField("String", "CONFERENCE_DAY1_END", project.properties["conference_day1_end"] as String)
52+
buildConfigField("String", "CONFERENCE_DAY2_START", project.properties["conference_day2_start"] as String)
53+
buildConfigField("String", "CONFERENCE_DAY2_END", project.properties["conference_day2_end"] as String)
54+
buildConfigField("String", "CONFERENCE_DAY3_START", project.properties["conference_day3_start"] as String)
55+
buildConfigField("String", "CONFERENCE_DAY3_END", project.properties["conference_day3_end"] as String)
4156

42-
buildConfigField("String", "CONFERENCE_DAY1_AFTERHOURS_START", properties["conference_day1_afterhours_start"] as String)
43-
buildConfigField("String", "CONFERENCE_DAY2_CONCERT_START", properties["conference_day2_concert_start"] as String)
57+
buildConfigField("String", "CONFERENCE_DAY1_AFTERHOURS_START", project.properties["conference_day1_afterhours_start"] as String)
58+
buildConfigField("String", "CONFERENCE_DAY2_CONCERT_START", project.properties["conference_day2_concert_start"] as String)
4459

4560
buildConfigField(
4661
"String",
47-
"BOOTSTRAP_CONF_DATA_FILENAME", properties["bootstrap_conference_data_filename"] as String
62+
"BOOTSTRAP_CONF_DATA_FILENAME", project.properties["bootstrap_conference_data_filename"] as String
4863
)
4964

5065
buildConfigField(
5166
"String",
52-
"CONFERENCE_WIFI_OFFERING_START", properties["conference_wifi_offering_start"] as String
67+
"CONFERENCE_WIFI_OFFERING_START", project.properties["conference_wifi_offering_start"] as String
5368
)
5469

5570
consumerProguardFiles("consumer-proguard-rules.pro")
@@ -72,17 +87,18 @@ android {
7287
}
7388
maybeCreate("staging")
7489
getByName("staging") {
75-
initWith(getByName("debug"))
90+
// TODO: replace with initWith(getByName("debug")) in 7.0.0-beta04
91+
this::class.memberFunctions.first { it.name == "initWith" }.call(this, getByName("debug"))
7692

7793
// Specifies a sorted list of fallback build types that the
7894
// plugin should try to use when a dependency does not include a
7995
// "staging" build type.
8096
// Used with :test-shared, which doesn't have a staging variant.
81-
setMatchingFallbacks(listOf("debug"))
97+
matchingFallbacks += listOf("debug")
8298
}
8399
}
84100

85-
lintOptions {
101+
lint {
86102
disable("InvalidPackage", "MissingTranslation")
87103
// Version changes are beyond our control, so don't warn. The IDE will still mark these.
88104
disable("GradleDependency")

0 commit comments

Comments
 (0)