Skip to content

Commit 8df03fa

Browse files
Upgrade versions and adjust compatibility
1 parent 3a5b55b commit 8df03fa

11 files changed

Lines changed: 80 additions & 87 deletions

File tree

DynamicFeatureNavigation/DSL/app/build.gradle

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@ apply plugin: 'com.android.application'
1818
apply plugin: 'kotlin-android'
1919

2020
android {
21-
compileSdkVersion 29
22-
buildToolsVersion "29.0.3"
21+
compileSdkVersion 30
22+
buildToolsVersion "30.0.2"
2323

2424
defaultConfig {
2525
applicationId "com.example.android.dfn.dsl"
2626
minSdkVersion 21
27-
targetSdkVersion 29
27+
targetSdkVersion 30
2828
versionCode 1
2929
versionName "1.0"
3030

3131
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3232
}
3333

3434
compileOptions {
35-
sourceCompatibility JavaVersion.VERSION_1_8
36-
targetCompatibility JavaVersion.VERSION_1_8
35+
sourceCompatibility JavaVersion.VERSION_11
36+
targetCompatibility JavaVersion.VERSION_11
3737
}
3838

3939
kotlinOptions {
40-
jvmTarget = JavaVersion.VERSION_1_8.toString()
40+
jvmTarget = JavaVersion.VERSION_11.toString()
4141
}
4242

4343
buildTypes {
@@ -53,10 +53,9 @@ android {
5353
}
5454

5555
dependencies {
56-
api 'androidx.core:core-ktx:1.2.0'
57-
api 'androidx.fragment:fragment:1.2.4'
58-
api 'androidx.constraintlayout:constraintlayout:1.1.3'
59-
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
60-
implementation 'androidx.appcompat:appcompat:1.1.0'
61-
implementation 'androidx.navigation:navigation-dynamic-features-fragment:2.3.0-alpha06'
56+
api 'androidx.fragment:fragment:1.3.4-ktx'
57+
api 'androidx.constraintlayout:constraintlayout:2.0.4'
58+
api "org.jetbrains.kotlin:kotlin-stdlib:1.5.0"
59+
implementation 'androidx.appcompat:appcompat:1.3.0'
60+
implementation 'androidx.navigation:navigation-dynamic-features-fragment:2.4.0-alpha01'
6261
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2020 The Android Open Source Project
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+
* http://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+
buildscript {
18+
19+
repositories {
20+
google()
21+
mavenCentral()
22+
}
23+
dependencies {
24+
classpath("com.android.tools.build:gradle:7.0.0-beta02")
25+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
26+
// NOTE: Do not place your application dependencies here; they belong
27+
// in the individual module build.gradle files
28+
}
29+
}
30+
31+
allprojects {
32+
33+
repositories {
34+
google()
35+
mavenCentral()
36+
}
37+
}
38+

DynamicFeatureNavigation/DSL/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME
1919
distributionPath=wrapper/dists
2020
zipStoreBase=GRADLE_USER_HOME
2121
zipStorePath=wrapper/dists
22-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
22+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

DynamicFeatureNavigation/DSL/included/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ apply plugin: 'com.android.dynamic-feature'
1818
apply plugin: 'kotlin-android'
1919

2020
android {
21-
compileSdkVersion 29
22-
buildToolsVersion "29.0.3"
21+
compileSdkVersion 30
22+
buildToolsVersion "30.0.2"
2323

2424
defaultConfig {
2525
minSdkVersion 21
26-
targetSdkVersion 29
26+
targetSdkVersion 30
2727
versionCode 1
2828
versionName "1.0"
2929
}

DynamicFeatureNavigation/DSL/ondemand/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ apply plugin: 'com.android.dynamic-feature'
1818
apply plugin: 'kotlin-android'
1919

2020
android {
21-
compileSdkVersion 29
22-
buildToolsVersion "29.0.3"
21+
compileSdkVersion 30
22+
buildToolsVersion "30.0.2"
2323

2424
defaultConfig {
2525
minSdkVersion 21
26-
targetSdkVersion 29
26+
targetSdkVersion 30
2727
versionCode 1
2828
versionName "1.0"
2929
}
Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import com.android.build.gradle.api.ApkVariantOutput
2-
import com.android.build.gradle.api.ApplicationVariant
3-
import com.android.build.gradle.api.BaseVariantOutput
4-
51
/*
62
* Copyright 2020 Google LLC.
73
*
@@ -24,11 +20,11 @@ plugins {
2420
}
2521

2622
android {
27-
compileSdkVersion(29)
23+
compileSdk = 30
2824
defaultConfig {
2925
applicationId = "com.google.android.samples.dynamicnavigator"
30-
minSdkVersion(21)
31-
targetSdkVersion(29)
26+
minSdk = 21
27+
targetSdk =30
3228
versionCode = 3
3329
versionName = "1.0"
3430
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -41,55 +37,19 @@ android {
4137
}
4238

4339
compileOptions {
44-
sourceCompatibility = JavaVersion.VERSION_1_8
45-
targetCompatibility = JavaVersion.VERSION_1_8
40+
sourceCompatibility = JavaVersion.VERSION_11
41+
targetCompatibility = JavaVersion.VERSION_11
4642
}
4743

48-
dynamicFeatures = mutableSetOf(":dynamicfeature", ":includedgraphfeature")
44+
dynamicFeatures.addAll(setOf(":dynamicfeature", ":includedgraphfeature"))
4945

5046
packagingOptions {
51-
exclude("META-INF/**.version")
47+
resources.excludes.add("META-INF/**.version")
5248
}
5349
}
5450

5551
dependencies {
56-
api("androidx.navigation:navigation-dynamic-features-fragment:2.3.0")
57-
api("androidx.appcompat:appcompat:1.1.0")
58-
api("androidx.constraintlayout:constraintlayout:1.1.3")
59-
}
60-
61-
val bundletoolJar = project.rootDir.resolve("third_party/bundletool/bundletool-all-0.13.0.jar")
62-
63-
android.applicationVariants.all(object : Action<ApplicationVariant> {
64-
override fun execute(variant: ApplicationVariant) {
65-
variant.outputs.forEach { output: BaseVariantOutput? ->
66-
(output as? ApkVariantOutput)?.let { apkOutput: ApkVariantOutput ->
67-
var filePath = apkOutput.outputFile.absolutePath
68-
filePath = filePath.replaceAfterLast(".", "aab")
69-
filePath = filePath.replace("build/outputs/apk/", "build/outputs/bundle/")
70-
var outputPath = filePath.replace("build/outputs/bundle/", "build/outputs/apks/")
71-
outputPath = outputPath.replaceAfterLast(".", "apks")
72-
73-
tasks.register<JavaExec>("buildApks${variant.name.capitalize()}") {
74-
classpath = files(bundletoolJar)
75-
args = listOf(
76-
"build-apks",
77-
"--overwrite",
78-
"--local-testing",
79-
"--bundle",
80-
filePath,
81-
"--output",
82-
outputPath
83-
)
84-
dependsOn("bundle${variant.name.capitalize()}")
85-
}
86-
87-
tasks.register<JavaExec>("installApkSplitsForTest${variant.name.capitalize()}") {
88-
classpath = files(bundletoolJar)
89-
args = listOf("install-apks", "--apks", outputPath)
90-
dependsOn("buildApks${variant.name.capitalize()}")
91-
}
92-
}
93-
}
94-
}
95-
})
52+
api("androidx.navigation:navigation-dynamic-features-fragment:2.4.0-alpha01")
53+
api("androidx.appcompat:appcompat:1.3.0")
54+
api("androidx.constraintlayout:constraintlayout:2.0.4")
55+
}

DynamicFeatureNavigation/XML/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ buildscript {
2020

2121
repositories {
2222
google()
23-
jcenter()
23+
mavenCentral()
2424
}
2525
dependencies {
26-
classpath("com.android.tools.build:gradle:4.1.0-alpha08")
27-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61")
26+
classpath("com.android.tools.build:gradle:7.0.0-beta02")
27+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
2828
// NOTE: Do not place your application dependencies here; they belong
2929
// in the individual module build.gradle files
3030
}
@@ -34,6 +34,6 @@ allprojects {
3434

3535
repositories {
3636
google()
37-
jcenter()
37+
mavenCentral()
3838
}
3939
}

DynamicFeatureNavigation/XML/dynamicfeature/build.gradle.kts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ plugins {
2020
}
2121

2222
android {
23-
compileSdkVersion(29)
23+
compileSdk = 30
2424
defaultConfig {
25-
minSdkVersion(21)
26-
targetSdkVersion(29)
27-
versionCode = 1
28-
versionName = "1.0"
25+
minSdk = 21
2926
}
3027

3128
compileOptions {

DynamicFeatureNavigation/XML/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

DynamicFeatureNavigation/XML/includedgraphfeature/build.gradle.kts

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

2222
android {
23-
compileSdkVersion(29)
23+
compileSdk = 30
2424
defaultConfig {
25-
minSdkVersion(21)
26-
targetSdkVersion(29)
27-
versionCode = 1
28-
versionName = "1.0"
25+
minSdk = 21
2926
}
3027

3128
compileOptions {
32-
sourceCompatibility = JavaVersion.VERSION_1_8
33-
targetCompatibility = JavaVersion.VERSION_1_8
29+
sourceCompatibility = JavaVersion.VERSION_11
30+
targetCompatibility = JavaVersion.VERSION_11
3431
}
3532
}
3633

0 commit comments

Comments
 (0)