Skip to content

Commit

Permalink
bump Gradle (and Dokka)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Jul 21, 2023
1 parent 1b8adfd commit 06c75d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 68 deletions.
14 changes: 9 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.jetbrains.kotlin.konan.target.HostManager

plugins {
kotlin("multiplatform") version "1.9.0"
id("org.jetbrains.dokka") version "0.9.18"
id("org.jetbrains.dokka") version "1.8.20"
id("maven-publish")
id("signing")
}
Expand All @@ -13,8 +13,12 @@ repositories {
mavenCentral()
}

tasks.dokka {
samples = listOf("src/commonTest/kotlin")
tasks.dokkaHtml {
dokkaSourceSets {
configureEach {
samples.from("src/commonTest/kotlin")
}
}
}

kotlin {
Expand Down Expand Up @@ -178,15 +182,15 @@ val ktlint by tasks.registering(JavaExec::class) {
group = "verification"
description = "Check Kotlin code style."
classpath = ktlintConfig
main = "com.pinterest.ktlint.Main"
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("src/**/*.kt")
}

val ktlintformat by tasks.registering(JavaExec::class) {
group = "formatting"
description = "Fix Kotlin code style deviations."
classpath = ktlintConfig
main = "com.pinterest.ktlint.Main"
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("-F", "src/**/*.kt", "*.kts")
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ POM_DESCRIPTION=A Kotlin multiplatform implementation of a v4 RFC4122 UUID


kotlin.mpp.enableCompatibilityMetadataVariant=true

org.gradle.jvmargs=-Xmx4g
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
65 changes: 3 additions & 62 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -1,65 +1,6 @@
group GROUP
version VERSION

dokka {
impliedPlatforms = ['Common'] // This will force platform tags for all non-common sources e.g. 'JVM'
kotlinTasks {
// dokka fails to retrieve sources from MPP-tasks so they must be set empty to avoid exception
// use sourceRoot instead (see below)
[]
}
packageOptions {
prefix = GROUP
}
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.commonMain.kotlin.srcDirs[0]
platforms = ['Common']
}
if (kotlin.sourceSets.getNames().contains('jvmMain')) {
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.jvmMain.kotlin.srcDirs[0]
platforms = ['JVM']
}
}
if (kotlin.sourceSets.getNames().contains('jsMain')) {
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.jsMain.kotlin.srcDirs[0]
platforms = ['js']
}
}
if (kotlin.sourceSets.getNames().contains('nativeMain')) {
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.nativeMain.kotlin.srcDirs[0]
platforms = ['native']
}
}
if (kotlin.sourceSets.getNames().contains('nix32Main')) {
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.nix32Main.kotlin.srcDirs[0]
platforms = ['native']
}
}
if (kotlin.sourceSets.getNames().contains('nix64Main')) {
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.nix64Main.kotlin.srcDirs[0]
platforms = ['native']
}
}
if (kotlin.sourceSets.getNames().contains('mingwMain')) {
sourceRoot {
// assuming there is only a single source dir...
path = kotlin.sourceSets.mingwMain.kotlin.srcDirs[0]
platforms = ['native']
}
}
}

def isReleaseBuild() {
return VERSION.contains('SNAPSHOT') == false
}
Expand All @@ -82,9 +23,9 @@ def getRepositoryPassword() {
return System.getenv('SONATYPE_PASSWORD') ?: ''
}

task javadocsJar(type: Jar, dependsOn: dokka) {
classifier = 'javadoc'
from dokka.outputDirectory
task javadocsJar(type: Jar, dependsOn: dokkaHtml) {
archiveClassifier = 'javadoc'
from dokkaHtml.outputDirectory
}

publishing {
Expand Down

0 comments on commit 06c75d1

Please sign in to comment.