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

Commit 824e70d

Browse files
committed
Migrating to KTS build script
Also bumps the versions as - Kotlin to 1.3.61 Using java-platform plugin for sharing most of the library versions. Using buildSrc for versions that are used for both classpath and dependency dependencies to keep it minimal because changing the code under buildSrc invalidates the entire gradle cache. Bug: 148411262 Change-Id: If7235501f87ca8116d9a0a2040ea6feccc481da6
1 parent 21f681e commit 824e70d

File tree

23 files changed

+858
-629
lines changed

23 files changed

+858
-629
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ local.properties
2525
.DS_Store
2626

2727
# IDEA/Android Studio project files, because
28-
# the project can be imported from settings.gradle
28+
# the project can be imported from settings.gradle.kts
2929
*.iml
3030
.idea/*
3131
!.idea/copyright
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Google LLC
2+
* Copyright 2020 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,31 +14,35 @@
1414
* limitations under the License.
1515
*/
1616

17-
apply plugin: 'com.android.library'
18-
apply plugin: 'kotlin-android'
17+
plugins {
18+
id("com.android.library")
19+
kotlin("android")
20+
}
1921

2022
android {
21-
compileSdkVersion rootProject.compileSdkVersion
23+
compileSdkVersion(Versions.COMPILE_SDK)
2224
defaultConfig {
23-
minSdkVersion rootProject.minSdkVersion
24-
targetSdkVersion rootProject.targetSdkVersion
25-
versionCode 1
26-
versionName "1.0"
25+
minSdkVersion(Versions.MIN_SDK)
26+
targetSdkVersion(Versions.TARGET_SDK)
27+
versionCode = 1
28+
versionName = "1.0"
2729

28-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2931
}
3032

3133
lintOptions {
3234
// Version changes are beyond our control, so don't warn. The IDE will still mark these.
33-
disable 'GradleDependency'
35+
disable("GradleDependency")
3436
}
3537
}
3638

3739
dependencies {
38-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$rootProject.kotlinVersion"
40+
api(platform(project(":depconstraints")))
41+
42+
implementation(Libs.KOTLIN_STDLIB)
3943

4044
// Architecture Components
41-
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"
42-
implementation "androidx.lifecycle:lifecycle-livedata:$rootProject.lifecycleVersion"
43-
implementation "androidx.lifecycle:lifecycle-viewmodel:$rootProject.lifecycleVersion"
45+
implementation(Libs.LIFECYCLE_EXTENSIONS)
46+
implementation(Libs.LIFECYCLE_LIVE_DATA)
47+
implementation(Libs.LIFECYCLE_VIEW_MODEL)
4448
}

ar/build.gradle

-63
This file was deleted.

ar/build.gradle.kts

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright 2020 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+
plugins {
18+
id("com.android.library")
19+
kotlin("android")
20+
kotlin("kapt")
21+
}
22+
23+
android {
24+
compileSdkVersion(Versions.COMPILE_SDK)
25+
defaultConfig {
26+
minSdkVersion(Versions.MIN_SDK)
27+
targetSdkVersion(Versions.TARGET_SDK)
28+
versionCode = 1
29+
versionName = "1.0"
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
31+
consumerProguardFiles("consumer-proguard-rules.pro")
32+
}
33+
34+
buildTypes {
35+
maybeCreate("staging")
36+
getByName("staging") {
37+
initWith(getByName("debug"))
38+
39+
// Specifies a sorted list of fallback build types that the
40+
// plugin should try to use when a dependency does not include a
41+
// "staging" build type.
42+
// Used with :test-shared, which doesn't have a staging variant.
43+
matchingFallbacks = listOf("debug")
44+
}
45+
}
46+
47+
lintOptions {
48+
disable("InvalidPackage")
49+
// Version changes are beyond our control, so don't warn. The IDE will still mark these.
50+
disable("GradleDependency")
51+
}
52+
53+
// Required by ArWebView
54+
compileOptions {
55+
sourceCompatibility = JavaVersion.VERSION_1_8
56+
targetCompatibility = JavaVersion.VERSION_1_8
57+
}
58+
}
59+
60+
dependencies {
61+
api(platform(project(":depconstraints")))
62+
implementation(project(":shared"))
63+
implementation(Libs.APPCOMPAT)
64+
implementation(Libs.ARCORE)
65+
implementation(Libs.GOOGLE_PLAY_SERVICES_VISION)
66+
implementation(Libs.KOTLIN_STDLIB)
67+
}

build.gradle

-162
This file was deleted.

0 commit comments

Comments
 (0)