159 lines
3.4 KiB
Kotlin
159 lines
3.4 KiB
Kotlin
import com.vanniktech.maven.publish.JavadocJar
|
|
import com.vanniktech.maven.publish.KotlinMultiplatform
|
|
import com.vanniktech.maven.publish.SonatypeHost
|
|
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlin.multiplatform)
|
|
alias(libs.plugins.android.library)
|
|
alias(libs.plugins.kotlin.compose)
|
|
alias(libs.plugins.kotlin.parcelize)
|
|
alias(libs.plugins.dokka)
|
|
alias(libs.plugins.gradle.maven.publish.plugin)
|
|
}
|
|
|
|
// -------------------
|
|
// Informations
|
|
// -------------------
|
|
|
|
// Module
|
|
val artifactId = "core"
|
|
val androidNamespace = "com.michaelflisar.composedialogs.core"
|
|
|
|
// Library
|
|
val libraryName = "ComposeDialogs"
|
|
val libraryDescription = "ComposeDialogs - $artifactId module"
|
|
val groupID = "io.github.mflisar.composedialogs"
|
|
val release = 2023
|
|
val github = "https://github.com/MFlisar/ComposeDialogs"
|
|
val license = "Apache License 2.0"
|
|
val licenseUrl = "$github/blob/main/LICENSE"
|
|
|
|
// -------------------
|
|
// Setup
|
|
// -------------------
|
|
|
|
kotlin {
|
|
|
|
// Java
|
|
jvm()
|
|
|
|
// Android
|
|
androidTarget {
|
|
publishLibraryVariants("release")
|
|
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
|
compilerOptions {
|
|
jvmTarget.set(JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
|
|
// iOS
|
|
//macosX64()
|
|
//macosArm64()
|
|
iosArm64()
|
|
iosX64()
|
|
iosSimulatorArm64()
|
|
|
|
// -------
|
|
// Sources
|
|
// -------
|
|
|
|
sourceSets {
|
|
|
|
commonMain.dependencies {
|
|
|
|
// Kotlin
|
|
implementation(kotlinx.coroutines)
|
|
|
|
// Compose
|
|
implementation(libs.compose.material3)
|
|
implementation(libs.compose.ui)
|
|
|
|
// Compose Unstyled
|
|
implementation(deps.composables.core)
|
|
}
|
|
|
|
androidMain.dependencies {
|
|
|
|
implementation(androidx.activity.compose)
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
|
|
namespace = androidNamespace
|
|
|
|
compileSdk = app.versions.compileSdk.get().toInt()
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdk = app.versions.minSdk.get().toInt()
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
consumerProguardFiles("proguard-rules.pro")
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
|
|
mavenPublishing {
|
|
|
|
configure(
|
|
KotlinMultiplatform(
|
|
javadocJar = JavadocJar.Dokka("dokkaHtml"),
|
|
sourcesJar = true
|
|
)
|
|
)
|
|
|
|
coordinates(
|
|
groupId = groupID,
|
|
artifactId = artifactId,
|
|
version = System.getenv("TAG")
|
|
)
|
|
|
|
pom {
|
|
name.set(libraryName)
|
|
description.set(libraryDescription)
|
|
inceptionYear.set("$release")
|
|
url.set(github)
|
|
|
|
licenses {
|
|
license {
|
|
name.set(license)
|
|
url.set(licenseUrl)
|
|
}
|
|
}
|
|
|
|
developers {
|
|
developer {
|
|
id.set("mflisar")
|
|
name.set("Michael Flisar")
|
|
email.set("mflisar.development@gmail.com")
|
|
}
|
|
}
|
|
|
|
scm {
|
|
url.set(github)
|
|
}
|
|
}
|
|
|
|
// Configure publishing to Maven Central
|
|
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
|
|
|
|
// Enable GPG signing for all publications
|
|
signAllPublications()
|
|
} |