Created
March 29, 2024 20:11
-
-
Save SergeiMikhailovskii/01a46e412fb418286ba51643d99976e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
alias(libs.plugins.kotlinMultiplatform) | |
alias(libs.plugins.androidLibrary) | |
id("maven-publish") | |
} | |
group = "com.mikhailovskii.kmp" | |
version = System.getenv("LIBRARY_VERSION") ?: libs.versions.pluginVersion.get() | |
kotlin { | |
androidTarget { | |
compilations.all { publishLibraryVariants("release", "debug") } | |
} | |
listOf( | |
iosX64(), | |
iosArm64(), | |
iosSimulatorArm64() | |
).forEach { | |
it.binaries.framework { | |
baseName = "in-app-review-kmp-rustore" | |
isStatic = true | |
} | |
} | |
jvmToolchain(17) | |
sourceSets { | |
androidMain.dependencies { | |
implementation(libs.rustore.review) | |
} | |
commonMain.dependencies { | |
api(projects.inAppReviewKmp) | |
} | |
} | |
} | |
android { | |
namespace = "com.mikhailovskii.inappreview" | |
compileSdk = 34 | |
defaultConfig { | |
minSdk = 26 | |
} | |
} | |
publishing { | |
publications { | |
matching { | |
return@matching it.name in listOf("iosArm64", "iosX64", "kotlinMultiplatform") | |
}.all { | |
tasks.withType<AbstractPublishToMaven>() | |
.matching { it.publication == this@all } | |
.configureEach { onlyIf { findProperty("isMainHost") == "true" } } | |
} | |
} | |
repositories { | |
maven { | |
url = uri("https://maven.pkg.github.com/SergeiMikhailovskii/kmp-app-review") | |
credentials { | |
username = System.getenv("GITHUB_USER") | |
password = System.getenv("GITHUB_API_KEY") | |
} | |
} | |
} | |
} | |
tasks.register("buildAndPublish", DefaultTask::class) { | |
dependsOn("build") | |
dependsOn("publish") | |
tasks.findByPath("publish")?.mustRunAfter("build") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment