Skip to content

Commit

Permalink
Update to SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-ramotar committed Nov 17, 2024
1 parent 24b23f3 commit 3bb29d3
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 118 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-XX:MaxMetaspaceSize=2G

# POM file
GROUP=org.mobilenativefoundation.store
VERSION_NAME=5.1.0-alpha05
VERSION_NAME=5.1.0-SNAPSHOT
POM_PACKAGING=pom
POM_DESCRIPTION = Store5 is a Kotlin Multiplatform network-resilient repository layer

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ testCore = "1.6.1"
kmmBridge = "0.3.2"
ktlint = "0.39.0"
kover = "0.6.0"
store = "5.1.0-alpha05"
store = "5.1.0-SNAPSHOT"
truth = "1.1.3"
binary-compatibility-validator = "0.15.0-Beta.2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,117 +17,109 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.withType
import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

class KotlinMultiplatformConventionPlugin : Plugin<Project> {
override fun apply(project: Project) = with(project) {


with(pluginManager) {
apply("org.jetbrains.kotlin.multiplatform")
apply("org.jetbrains.kotlin.plugin.serialization")
apply("com.android.library")
apply("com.vanniktech.maven.publish")
apply("org.jetbrains.dokka")
apply("org.jetbrains.kotlinx.kover")
apply("co.touchlab.faktory.kmmbridge")
apply("maven-publish")
apply("org.jetbrains.kotlin.native.cocoapods")
apply("kotlinx-atomicfu")
apply("org.jetbrains.kotlinx.binary-compatibility-validator")
}


extensions.configure<KotlinMultiplatformExtension> {
override fun apply(project: Project) =
with(project) {
with(pluginManager) {
apply("org.jetbrains.kotlin.multiplatform")
apply("org.jetbrains.kotlin.plugin.serialization")
apply("com.android.library")
apply("com.vanniktech.maven.publish")
apply("org.jetbrains.dokka")
apply("org.jetbrains.kotlinx.kover")
apply("co.touchlab.faktory.kmmbridge")
apply("maven-publish")
apply("org.jetbrains.kotlin.native.cocoapods")
apply("kotlinx-atomicfu")
apply("org.jetbrains.kotlinx.binary-compatibility-validator")
}

applyDefaultHierarchyTemplate()
extensions.configure<KotlinMultiplatformExtension> {
applyDefaultHierarchyTemplate()

androidTarget()
androidTarget()

jvm()
jvm()

iosX64()
iosArm64()
iosSimulatorArm64()
iosX64()
iosArm64()
iosSimulatorArm64()

linuxX64()
linuxX64()

js {
browser()
nodejs()
}
js {
browser()
nodejs()
}

jvmToolchain(11)
jvmToolchain(11)

targets.all {
compilations.all {
compilerOptions.configure {
freeCompilerArgs.add("-Xexpect-actual-classes")
targets.all {
compilations.all {
compilerOptions.configure {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
}

targets.withType<KotlinNativeTarget>().configureEach {
compilations.configureEach {
compilerOptions.configure {
freeCompilerArgs.add("-Xallocator=custom")
freeCompilerArgs.add("-XXLanguage:+ImplicitSignedToUnsignedIntegerConversion")
freeCompilerArgs.add("-Xadd-light-debug=enable")

freeCompilerArgs.addAll(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.cinterop.ExperimentalForeignApi",
"-opt-in=kotlinx.cinterop.BetaInteropApi",
)
targets.withType<KotlinNativeTarget>().configureEach {
compilations.configureEach {
compilerOptions.configure {
freeCompilerArgs.add("-Xallocator=custom")
freeCompilerArgs.add("-XXLanguage:+ImplicitSignedToUnsignedIntegerConversion")
freeCompilerArgs.add("-Xadd-light-debug=enable")

freeCompilerArgs.addAll(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.cinterop.ExperimentalForeignApi",
"-opt-in=kotlinx.cinterop.BetaInteropApi",
)
}
}
}
}

sourceSets.all {
languageSettings.apply {
optIn("kotlin.contracts.ExperimentalContracts")
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlin.RequiresOptIn")
sourceSets.all {
languageSettings.apply {
optIn("kotlin.contracts.ExperimentalContracts")
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlin.RequiresOptIn")
}
}
}

sourceSets.getByName("commonTest") {
dependencies {
implementation(kotlin("test"))
sourceSets.getByName("commonTest") {
dependencies {
implementation(kotlin("test"))
}
}
}

sourceSets.getByName("jvmTest") {
dependencies {
implementation(kotlin("test-junit"))
sourceSets.getByName("jvmTest") {
dependencies {
implementation(kotlin("test-junit"))
}
}
}

sourceSets.getByName("nativeMain") {
dependsOn(sourceSets.getByName("commonMain"))
sourceSets.getByName("nativeMain") {
dependsOn(sourceSets.getByName("commonMain"))
}
}


configureKotlin()
configureAndroid()
configureDokka()
configureMavenPublishing()
addGithubPackagesRepository()
configureKmmBridge()
configureAtomicFu()
}

configureKotlin()
configureAndroid()
configureDokka()
configureMavenPublishing()
addGithubPackagesRepository()
configureKmmBridge()
configureAtomicFu()
}
}


fun Project.configureKotlin() {
configureJava()
}
Expand Down Expand Up @@ -162,65 +154,64 @@ fun Project.configureAndroid() {
}
}


fun Project.android(action: LibraryExtension.() -> Unit) = extensions.configure<LibraryExtension>(action)

private fun Project.java(action: JavaPluginExtension.() -> Unit) = extensions.configure<JavaPluginExtension>(action)


object Versions {
const val COMPILE_SDK = 34
const val MIN_SDK = 24
const val TARGET_SDK = 34
const val STORE = "5.1.0-alpha05"
}


fun Project.configureMavenPublishing() = extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(S01)
signAllPublications()
const val STORE = "5.1.0-SNAPSHOT"
}

fun Project.configureMavenPublishing() =
extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(S01)
signAllPublications()
}

fun Project.configureKmmBridge() = extensions.configure<KmmBridgeExtension> {
githubReleaseArtifacts()
githubReleaseVersions()
versionPrefix.set(Versions.STORE)
spm()
}
fun Project.configureKmmBridge() =
extensions.configure<KmmBridgeExtension> {
githubReleaseArtifacts()
githubReleaseVersions()
versionPrefix.set(Versions.STORE)
spm()
}

fun Project.configureKover() = extensions.configure<KoverMergedConfig> {
enable()
fun Project.configureKover() =
extensions.configure<KoverMergedConfig> {
enable()

xmlReport {
onCheck.set(true)
reportFile.set(layout.projectDirectory.file("kover/coverage.xml"))
}
xmlReport {
onCheck.set(true)
reportFile.set(layout.projectDirectory.file("kover/coverage.xml"))
}

htmlReport {
onCheck.set(true)
reportDir.set(layout.projectDirectory.dir("kover/html"))
}
htmlReport {
onCheck.set(true)
reportDir.set(layout.projectDirectory.dir("kover/html"))
}

verify {
onCheck.set(true)
verify {
onCheck.set(true)
}
}
}


fun Project.configureAtomicFu() =
extensions.configure<AtomicFUPluginExtension> {
transformJvm = false
transformJs = false
}

fun Project.configureDokka() = tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(11)
fun Project.configureDokka() =
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(11)
}
}
}

fun Project.android(name: String) {
android {
Expand Down

0 comments on commit 3bb29d3

Please sign in to comment.