Skip to content

Commit

Permalink
Lift subproject to root
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbull committed Mar 3, 2024
1 parent f0f1dc7 commit b422ac8
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 218 deletions.
170 changes: 170 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.benmanes.gradle.versions.updates.gradle.GradleReleaseChannel
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.versions)
`maven-publish`
signing
}

tasks.withType<DependencyUpdatesTask> {
Expand All @@ -14,3 +20,167 @@ tasks.withType<DependencyUpdatesTask> {
}
}
}

kotlin {
explicitApi()

jvmToolchain(8)

jvm()

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

androidNativeArm32()
androidNativeArm64()
androidNativeX64()
androidNativeX86()

linuxArm64()
linuxX64()

mingwX64()

macosArm64()
macosX64()

iosArm64()
iosSimulatorArm64()
iosX64()

tvosArm64()
tvosSimulatorArm64()
tvosX64()

watchosArm32()
watchosArm64()
watchosSimulatorArm64()
watchosX64()

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
binaries.executable()
nodejs()
}

sourceSets {
all {
languageSettings.apply {
optIn("kotlin.contracts.ExperimentalContracts")
}
}

commonTest {
dependencies {
implementation(kotlin("test"))
}
}

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

jsTest {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}

tasks.withType<Jar> {
from(rootDir.resolve("LICENSE")) {
into("META-INF")
}
}

/* https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0 */
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}

rootProject.tasks.withType<KotlinNpmInstallTask> {
args.add("--ignore-engines")
}

publishing {
repositories {
maven {
if (project.version.toString().endsWith("SNAPSHOT")) {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
} else {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}

credentials {
val ossrhUsername: String? by project
val ossrhPassword: String? by project

username = ossrhUsername
password = ossrhPassword
}
}
}

publications.withType<MavenPublication> {
val targetName = this@withType.name

artifact(tasks.register("${targetName}JavadocJar", Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles a jar archive containing the Javadoc API documentation of target '$targetName'."
archiveClassifier.set("javadoc")
archiveAppendix.set(targetName)
})

pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/michaelbull/kotlin-itertools")
inceptionYear.set("2024")

licenses {
license {
name.set("ISC License")
url.set("https://opensource.org/licenses/isc-license.txt")
}
}

developers {
developer {
name.set("Michael Bull")
url.set("https://www.michael-bull.com")
}
}

scm {
connection.set("scm:git:https://github.com/michaelbull/kotlin-itertools")
developerConnection.set("scm:git:[email protected]:michaelbull/kotlin-itertools.git")
url.set("https://github.com/michaelbull/kotlin-itertools")
}

issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/michaelbull/kotlin-itertools/issues")
}

ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/michaelbull/kotlin-itertools/actions")
}
}
}
}

signing {
val signingKeyId: String? by project // must be the last 8 digits of the key
val signingKey: String? by project
val signingPassword: String? by project

useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}
7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

19 changes: 0 additions & 19 deletions buildSrc/settings.gradle.kts

This file was deleted.

94 changes: 0 additions & 94 deletions buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts

This file was deleted.

85 changes: 0 additions & 85 deletions buildSrc/src/main/kotlin/publish-conventions.gradle.kts

This file was deleted.

Loading

0 comments on commit b422ac8

Please sign in to comment.