Skip to content

Commit

Permalink
Add test for navigation lib, restructure testing setup, update to Kot…
Browse files Browse the repository at this point in the history
…lin 2.0.0-RC3
  • Loading branch information
zsmb13 committed May 11, 2024
1 parent be85baa commit e959c98
Show file tree
Hide file tree
Showing 21 changed files with 241 additions and 130 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.iml
.gradle
.kotlin
/local.properties
/.idea
.DS_Store
Expand Down
4 changes: 4 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ gradlePlugin {
id = "co.zsmb.requirektx.library"
implementationClass = "KmpLibraryConventionPlugin"
}
register("publishing") {
id = "co.zsmb.requirektx.publishing"
implementationClass = "PublishingConventionPlugin"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import com.android.build.gradle.LibraryExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -16,7 +14,6 @@ class KmpLibraryConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.multiplatform")
apply("com.vanniktech.maven.publish")
}

configure<KotlinMultiplatformExtension> {
Expand Down Expand Up @@ -54,6 +51,19 @@ class KmpLibraryConventionPlugin : Plugin<Project> {
watchosX64()
}

val commonMain by sourceSets.commonMain
val jbMain by sourceSets.creating {
dependsOn(commonMain)
}

targets.forEach { target ->
if (target.platformType !in listOf(KotlinPlatformType.androidJvm, KotlinPlatformType.common)) {
target.compilations.getByName("main").defaultSourceSet {
dependsOn(jbMain)
}
}
}

val commonTest by sourceSets.commonTest
val jbTest by sourceSets.creating {
dependsOn(commonTest)
Expand Down Expand Up @@ -90,37 +100,6 @@ class KmpLibraryConventionPlugin : Plugin<Project> {
targetCompatibility = JavaVersion.VERSION_1_8
}
}

configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()

pom {
name.set("requireKTX")
description.set("Kotlin utilities for easily grabbing required values")
inceptionYear.set("2021")
url.set("https://github.com/zsmb13/requireKTX")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("zsmb13")
name.set("Márton Braun")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:github.com/zsmb13/requireKTX.git")
developerConnection.set("scm:git:ssh://github.com/zsmb13/requireKTX.git")
url.set("https://github.com/zsmb13/requireKTX/tree/main")
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.*

class PublishingConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.vanniktech.maven.publish")
}

configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()

pom {
name.set("requireKTX")
description.set("Kotlin utilities for easily grabbing required values")
inceptionYear.set("2021")
url.set("https://github.com/zsmb13/requireKTX")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("zsmb13")
name.set("Márton Braun")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:github.com/zsmb13/requireKTX.git")
developerConnection.set("scm:git:ssh://github.com/zsmb13/requireKTX.git")
url.set("https://github.com/zsmb13/requireKTX/tree/main")
}
}
}
}
}
}
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ plugins {
}

apiValidation {
ignoredProjects += "app"
ignoredProjects += listOf(
"app",
"requirektx-test-helper",
)
klib {
enabled = true
strictValidation = true
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ core-ktx = "1.13.1"
core-bundle = "1.0.0-rc01"
junit = "4.13.2"
junit-jupiter-api = "5.9.2"
kotlin = "1.9.24"
kotlin = "2.0.0-RC3"
material = "1.12.0"
maven-publish = "0.28.0"
navigation-runtime = "2.7.0-alpha04"
Expand Down Expand Up @@ -41,3 +41,4 @@ binaryCompatValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-valid
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
requireKtxLibrary = { id = "co.zsmb.requirektx.library", version = "unspecified" }
requireKtxPublishing = { id = "co.zsmb.requirektx.publishing", version = "unspecified" }
Loading

0 comments on commit e959c98

Please sign in to comment.