Skip to content

Commit d95eb85

Browse files
authored
Migrate to new AGP KMP plugin (#580)
1 parent 6574786 commit d95eb85

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed
File renamed without changes.

timber/build.gradle

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
11
apply plugin: 'org.jetbrains.kotlin.multiplatform'
2-
apply plugin: 'com.android.library'
2+
apply plugin: 'com.android.kotlin.multiplatform.library'
33
apply plugin: 'com.vanniktech.maven.publish'
44
apply plugin: 'org.jetbrains.dokka' // Must be applied here for publish plugin.
55

6-
76
kotlin {
8-
androidTarget()
7+
androidLibrary {
8+
namespace 'timber.log'
9+
compileSdk libs.versions.compileSdk.get().toInteger()
10+
minSdk libs.versions.minSdk.get().toInteger()
11+
12+
optimization {
13+
// "it" --> https://issuetracker.google.com/issues/445115242
14+
it.consumerKeepRules.file('consumer-keep-rules.pro')
15+
}
16+
17+
lint {
18+
it.textReport = true
19+
}
20+
}
921

22+
// TODO Remove!
1023
jvmToolchain(17)
1124

25+
sourceSets {
26+
commonMain {
27+
dependencies {
28+
implementation libs.annotations
29+
}
30+
}
31+
commonTest {
32+
dependencies {
33+
implementation libs.annotations
34+
implementation libs.junit
35+
implementation libs.assertk
36+
implementation libs.robolectric
37+
}
38+
}
39+
}
40+
1241
abiValidation {
1342
enabled = true
1443
}
@@ -21,28 +50,6 @@ tasks.named('check') { check ->
2150
)
2251
}
2352

24-
android {
25-
namespace 'timber.log'
26-
compileSdkVersion libs.versions.compileSdk.get().toInteger()
27-
28-
defaultConfig {
29-
minSdkVersion libs.versions.minSdk.get()
30-
consumerProguardFiles 'consumer-proguard-rules.pro'
31-
}
32-
33-
lintOptions {
34-
textReport true
35-
textOutput 'stdout'
36-
}
37-
}
38-
3953
dependencies {
40-
implementation libs.annotations
41-
42-
testImplementation libs.annotations
43-
testImplementation libs.junit
44-
testImplementation libs.assertk
45-
testImplementation libs.robolectric
46-
4754
lintPublish project(':timber-lint')
4855
}
File renamed without changes.

0 commit comments

Comments
 (0)