Skip to content

Commit 33ed337

Browse files
author
Nikolay Kochetkov
committed
Kotlin 1.9.10, AGP8
1 parent 9b4a50f commit 33ed337

13 files changed

Lines changed: 56 additions & 58 deletions

File tree

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
uses: actions/checkout@v2
1717
with:
1818
fetch-depth: 0
19-
- name: set up JDK 1.11
19+
- name: set up JDK 17
2020
uses: actions/setup-java@v1
2121
with:
22-
java-version: 1.11
22+
java-version: 17
2323
- name: Cache
2424
uses: actions/cache@v2
2525
with:

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616
ref: refs/remotes/origin/master
17-
- name: set up JDK 1.11
17+
- name: set up JDK 17
1818
uses: actions/setup-java@v1
1919
with:
20-
java-version: 1.11
20+
java-version: 17
2121
- name: Cache
2222
uses: actions/cache@v2
2323
with:

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

appupdatewrapper/build.gradle

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@ kapt {
2222
}
2323

2424
android {
25-
compileSdkVersion androidCompileSdkVersion
26-
buildToolsVersion androidBuildToolsVersion
25+
compileSdk androidCompileSdkVersion
2726
testOptions.unitTests.includeAndroidResources = true
2827

2928
compileOptions {
30-
sourceCompatibility = 1.8
31-
targetCompatibility = 1.8
29+
sourceCompatibility JavaVersion.VERSION_17
30+
targetCompatibility JavaVersion.VERSION_17
3231
}
3332

3433
kotlinOptions {
35-
jvmTarget = "1.8"
34+
jvmTarget = "17"
3635
}
3736

3837
defaultConfig {
@@ -52,15 +51,22 @@ android {
5251
}
5352
}
5453
namespace 'com.motorro.appupdatewrapper'
54+
55+
publishing {
56+
singleVariant('release') {
57+
withSourcesJar()
58+
withJavadocJar()
59+
}
60+
}
5561
}
5662

5763
dependencies {
5864
implementation fileTree(dir: 'libs', include: ['*.jar'])
5965

6066
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6167

62-
api 'androidx.core:core-ktx:1.10.1'
63-
api 'androidx.lifecycle:lifecycle-common:2.6.1'
68+
api 'androidx.core:core-ktx:1.12.0'
69+
api 'androidx.lifecycle:lifecycle-common:2.6.2'
6470
api 'com.google.android.play:core:1.10.3'
6571

6672
implementation 'com.jakewharton.timber:timber:5.0.1'
@@ -71,8 +77,8 @@ dependencies {
7177
testImplementation 'junit:junit:4.13.2'
7278
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
7379
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
74-
testImplementation 'org.robolectric:robolectric:4.8.1'
75-
testImplementation 'androidx.lifecycle:lifecycle-runtime-testing:2.6.1'
80+
testImplementation 'org.robolectric:robolectric:4.10.3'
81+
testImplementation 'androidx.lifecycle:lifecycle-runtime-testing:2.6.2'
7682
}
7783

7884
dokkaJavadoc.configure {
@@ -84,20 +90,6 @@ dokkaJavadoc.configure {
8490
}
8591
}
8692

87-
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
88-
archiveClassifier.set('javadoc')
89-
from "$buildDir/javadoc"
90-
}
91-
92-
task sourcesJar(type: Jar) {
93-
archiveClassifier.set('sources')
94-
from android.sourceSets.main.java.source
95-
}
96-
97-
artifacts {
98-
archives sourcesJar, javadocJar
99-
}
100-
10193
def libId = 'appupdatewrapper'
10294
def libName = 'appupdatewrapper'
10395
def libDesc = 'A wrapper for Android `AppUpdateManager` to encapsulate update workflow.'
@@ -108,8 +100,6 @@ afterEvaluate {
108100
// Creates a Maven publication called "release".
109101
release(MavenPublication) {
110102
from components.release
111-
artifact sourcesJar
112-
artifact javadocJar
113103
groupId = rootProject.group
114104
artifactId = libId
115105
version = rootProject.version

appupdatewrapper/src/test/java/com/motorro/appupdatewrapper/FlexibleUpdateKtTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package com.motorro.appupdatewrapper
1717

1818
import android.app.Activity
1919
import android.os.Looper.getMainLooper
20-
import androidx.test.core.app.ActivityScenario.launch
20+
import androidx.test.core.app.ActivityScenario.launchActivityForResult
2121
import androidx.test.ext.junit.runners.AndroidJUnit4
2222
import com.google.android.play.core.appupdate.testing.FakeAppUpdateManager
2323
import com.motorro.appupdatewrapper.AppUpdateWrapper.Companion.REQUEST_CODE_UPDATE
@@ -49,7 +49,7 @@ class FlexibleUpdateKtTest: TestAppTest() {
4949
@LooperMode(LooperMode.Mode.PAUSED)
5050
fun startsFlexibleUpdateIfAvailable() {
5151
lateinit var updateManager: FakeAppUpdateManager
52-
val scenario = launch(TestUpdateActivity::class.java)
52+
val scenario = launchActivityForResult(TestUpdateActivity::class.java)
5353
scenario.onActivity {
5454
updateManager = FakeAppUpdateManager(it).apply {
5555
setUpdateAvailable(100500)
@@ -77,7 +77,7 @@ class FlexibleUpdateKtTest: TestAppTest() {
7777
@LooperMode(LooperMode.Mode.PAUSED)
7878
fun cancelsUpdateOnUserReject() {
7979
lateinit var updateManager: FakeAppUpdateManager
80-
val scenario = launch(TestUpdateActivity::class.java)
80+
val scenario = launchActivityForResult(TestUpdateActivity::class.java)
8181
scenario.onActivity {
8282
updateManager = FakeAppUpdateManager(it).apply {
8383
setUpdateAvailable(100500)
@@ -102,7 +102,7 @@ class FlexibleUpdateKtTest: TestAppTest() {
102102
fun willNotAskUpdateConsentIfAlreadyCancelled() {
103103
whenever(flowBreaker.isEnoughTimePassedSinceLatestCancel()).thenReturn(false)
104104
lateinit var updateManager: FakeAppUpdateManager
105-
val scenario = launch(TestUpdateActivity::class.java)
105+
val scenario = launchActivityForResult(TestUpdateActivity::class.java)
106106
scenario.onActivity {
107107
updateManager = FakeAppUpdateManager(it).apply {
108108
setUpdateAvailable(100500)

appupdatewrapper/src/test/java/com/motorro/appupdatewrapper/ImmediateUpdateKtTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package com.motorro.appupdatewrapper
1717

1818
import android.app.Activity
1919
import android.os.Looper.getMainLooper
20-
import androidx.test.core.app.ActivityScenario.launch
20+
import androidx.test.core.app.ActivityScenario.launchActivityForResult
2121
import androidx.test.ext.junit.runners.AndroidJUnit4
2222
import com.google.android.play.core.appupdate.testing.FakeAppUpdateManager
2323
import com.motorro.appupdatewrapper.AppUpdateWrapper.Companion.REQUEST_CODE_UPDATE
@@ -35,7 +35,7 @@ class ImmediateUpdateKtTest: TestAppTest() {
3535
@LooperMode(LooperMode.Mode.PAUSED)
3636
fun startsImmediateUpdateIfAvailable() {
3737
lateinit var updateManager: FakeAppUpdateManager
38-
val scenario = launch(TestUpdateActivity::class.java)
38+
val scenario = launchActivityForResult(TestUpdateActivity::class.java)
3939
scenario.onActivity {
4040
updateManager = FakeAppUpdateManager(it).apply {
4141
setUpdateAvailable(100500)
@@ -55,7 +55,7 @@ class ImmediateUpdateKtTest: TestAppTest() {
5555
@LooperMode(LooperMode.Mode.PAUSED)
5656
fun failsIfUpdateIsNotAvailable() {
5757
lateinit var updateManager: FakeAppUpdateManager
58-
val scenario = launch(TestUpdateActivity::class.java)
58+
val scenario = launchActivityForResult(TestUpdateActivity::class.java)
5959
scenario.onActivity {
6060
updateManager = FakeAppUpdateManager(it).apply {
6161
setUpdateNotAvailable()

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ apply from: 'gradle/maven-publish-config.gradle'
44
apply plugin: 'io.github.gradle-nexus.publish-plugin'
55

66
buildscript {
7-
ext.kotlin_version = '1.8.21'
8-
ext.dokka_version = '1.8.10'
7+
ext.kotlin_version = '1.9.10'
8+
ext.dokka_version = '1.9.0'
99
repositories {
1010
google()
1111
mavenCentral()
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222
}
2323
dependencies {
24-
classpath 'com.android.tools.build:gradle:7.4.2'
24+
classpath 'com.android.tools.build:gradle:8.1.1'
2525
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2626
classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1'
2727
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
@@ -32,10 +32,10 @@ buildscript {
3232

3333
ext {
3434
// Android
35-
androidBuildToolsVersion = '33.0.0'
35+
androidBuildToolsVersion = '34.0.0'
3636
androidMinSdkVersion = 21
37-
androidTargetSdkVersion = 33
38-
androidCompileSdkVersion = 33
37+
androidTargetSdkVersion = 34
38+
androidCompileSdkVersion = 34
3939
versionName = project.version
4040
versionCode = buildVersionCode()
4141

@@ -60,11 +60,11 @@ allprojects {
6060
}
6161
}
6262

63-
task clean(type: Delete) {
63+
tasks.register('clean', Delete) {
6464
delete rootProject.buildDir
6565
}
6666

67-
task displayVersion(type: Task, group: 'documentation') {
67+
tasks.register('displayVersion', Task) {
6868
description 'Display application version name'
6969
doLast {
7070
println("Project version: ${project.version}")

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
org.gradle.jvmargs=-Xmx1536m
1+
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
22
org.gradle.parallel=true
33
org.gradle.caching=true
44
org.gradle.configureondemand=true
@@ -14,3 +14,6 @@ kotlin.code.style=official
1414
# Kotlin annotation processing config
1515
kapt.include.compile.classpath=false
1616
kapt.incremental.apt=true
17+
android.defaults.buildfeatures.buildconfig=true
18+
android.nonTransitiveRClass=false
19+
android.nonFinalResIds=false

0 commit comments

Comments
 (0)