Skip to content

Commit c312fcd

Browse files
committed
Integrate w2sv.compose-module.gradle.kts convention plugin
1 parent 3e6099c commit c312fcd

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

build-logic/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ plugins {
33
alias(libs.plugins.ktlint)
44
}
55

6+
dependencies {
7+
// make version catalog available in plugins
8+
// https://github.com/gradle/gradle/issues/15383
9+
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
10+
}
11+
612
dependencies {
713
implementation(plugin(libs.plugins.android.library))
814
implementation(plugin(libs.plugins.kotlin.android))
15+
implementation(plugin(libs.plugins.kotlin.compose.compiler))
916
implementation(plugin(libs.plugins.ktlint))
1017
}
1118

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import gradle.kotlin.dsl.plugins._2035c710eaf7e06d9cfab030694b8afb.compose
2+
import org.gradle.accessors.dm.LibrariesForLibs
3+
4+
plugins {
5+
id("com.android.library")
6+
id("org.jetbrains.kotlin.plugin.compose")
7+
}
8+
9+
val libs = the<LibrariesForLibs>()
10+
11+
android {
12+
buildFeatures {
13+
compose = true
14+
}
15+
// androidx.compose.ui:ui-test-junit4-android:1.10.0 needs minSdk=23
16+
sourceSets {
17+
getByName("test") {
18+
defaultConfig {
19+
minSdk = 23
20+
}
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
lintChecks(libs.compose.lint.checks)
27+
}

composed-core/build.gradle.kts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
plugins {
22
id("w2sv.android-library")
3-
alias(libs.plugins.kotlin.compose.compiler)
3+
id("w2sv.compose-module")
44
alias(libs.plugins.kover)
55
}
66

7-
android {
8-
buildFeatures {
9-
compose = true
10-
}
11-
// androidx.compose.ui:ui-test-junit4-android:1.10.0 needs minSdk=23
12-
sourceSets {
13-
getByName("test") {
14-
defaultConfig {
15-
minSdk = 23
16-
}
17-
}
18-
}
19-
}
20-
217
tasks.withType(Test::class.java) {
228
android.sourceSets.getByName("main").res.srcDir("src/test/res")
239
}
@@ -58,7 +44,6 @@ dependencies {
5844
implementation(libs.compose.material3)
5945
implementation(libs.androidx.core.ktx)
6046
implementation(libs.androidx.annotation)
61-
lintChecks(libs.compose.lint.checks)
6247
testImplementation(libs.junit)
6348
testImplementation(libs.roboelectric)
6449
testImplementation(libs.androidx.ui.test.junit4.android)

composed-permissions/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
plugins {
22
id("w2sv.android-library")
3-
alias(libs.plugins.kotlin.compose.compiler)
4-
}
5-
6-
android {
7-
buildFeatures {
8-
compose = true
9-
}
3+
id("w2sv.compose-module")
104
}
115

126
publishing {
@@ -42,5 +36,4 @@ publishing {
4236
dependencies {
4337
api(libs.google.accompanist.permissions)
4438
implementation(libs.compose.ui.tooling)
45-
lintChecks(libs.compose.lint.checks)
4639
}

0 commit comments

Comments
 (0)