1- @file:OptIn(ExperimentalWasmDsl ::class )
2-
3- import com.vanniktech.maven.publish.SonatypeHost
4- import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
5-
61plugins {
7- kotlin(" multiplatform" )
8- alias(libs.plugins.androidLibrary)
9- alias(libs.plugins.jetbrainsCompose)
10- alias(libs.plugins.composeCompiler)
11- alias(libs.plugins.dokka)
12- alias(libs.plugins.mavenPublish)
2+ id(" com.mikepenz.convention.android-library" )
3+ id(" com.mikepenz.convention.kotlin-multiplatform" )
4+ id(" com.mikepenz.convention.compose" )
5+ id(" com.mikepenz.convention.publishing" )
136}
147
158android {
16- compileSdk = libs.versions.compileSdk.get().toInt()
179 namespace = " com.mikepenz.aboutlibraries.ui.compose"
1810
19- defaultConfig {
20- minSdk = libs.versions.minSdk.get().toInt()
21- }
22-
23- buildTypes {
24- named(" release" ) {
25- isMinifyEnabled = false
26- proguardFiles(
27- getDefaultProguardFile(" proguard-android-optimize.txt" ), " proguard-rules.pro"
28- )
29- }
30- }
31-
32- compileOptions {
33- sourceCompatibility = JavaVersion .VERSION_11
34- targetCompatibility = JavaVersion .VERSION_11
35- }
36-
3711 tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
38- kotlinOptions {
39- jvmTarget = " 11"
40-
41- if (project.findProperty(" composeCompilerReports" ) == " true" ) {
42- freeCompilerArgs + = listOf (
43- " -P" ,
44- " plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.layout.buildDirectory.asFile.get().absolutePath} /compose_compiler"
45- )
46- }
47- if (project.findProperty(" composeCompilerMetrics" ) == " true" ) {
48- freeCompilerArgs + = listOf (
49- " -P" ,
50- " plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.layout.buildDirectory.asFile.get().absolutePath} /compose_compiler"
51- )
52- }
53-
12+ compilerOptions {
5413 val outputDir = rootDir.resolve(" aboutlibraries-core/compose_compiler_config.conf" ).path
55- compilerOptions.freeCompilerArgs.addAll(
56- " -P" ,
57- " plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir} "
58- )
14+ freeCompilerArgs.addAll(" -P" , " plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir} " )
5915 }
6016 }
61-
62- buildFeatures {
63- compose = true
64- }
65-
66- lint {
67- abortOnError = false
68- }
6917}
7018
7119kotlin {
72- applyDefaultHierarchyTemplate()
73-
74- jvm()
75-
76- androidTarget {
77- publishLibraryVariants(" release" )
78- }
79-
80- js(IR ) {
81- browser()
82- }
83-
84- iosX64()
85- iosArm64()
86- iosSimulatorArm64()
87- macosX64()
88- macosArm64()
89- wasmJs {
90- nodejs()
91- }
92-
9320 sourceSets {
9421 val commonMain by getting {
9522 dependencies {
@@ -108,7 +35,6 @@ dependencies {
10835
10936 debugImplementation(compose.uiTooling)
11037 " androidMainImplementation" (compose.preview)
111-
11238 " androidMainImplementation" (libs.androidx.core.ktx)
11339}
11440
@@ -117,23 +43,4 @@ configurations.configureEach {
11743 // https://github.com/chrisbanes/tivi/blob/5e7586465337d326a1f1e40e0b412ecd2779bb5c/build.gradle#L72
11844 exclude(group = " androidx.appcompat" )
11945 exclude(group = " com.google.android.material" , module = " material" )
120-
121-
122- }
123-
124- tasks.dokkaHtml.configure {
125- dokkaSourceSets {
126- configureEach {
127- noAndroidSdkLink.set(false )
128- }
129- }
130- }
131-
132-
133-
134- if (project.hasProperty(" pushall" ) || project.hasProperty(" library_compose_only" )) {
135- mavenPublishing {
136- publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL , true )
137- signAllPublications()
138- }
13946}
0 commit comments