diff --git a/build.gradle.kts b/build.gradle.kts index 006e1bc..881a76f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "scientifik" -version = "0.2.1" +version = "0.2.2" repositories { gradlePluginPortal() @@ -23,16 +23,17 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion") implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0") - implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.12.10") + implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.13.2") implementation("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4") - implementation("org.jetbrains.dokka:dokka-gradle-plugin:0.9.18") + implementation("org.jetbrains.dokka:dokka-gradle-plugin:0.10.0") + implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.10.0") } gradlePlugin { plugins { create("scientifik-publish") { id = "scientifik.publish" - description = "The publication plugin for bintray and bitbucket" + description = "The publication plugin for bintray and github" implementationClass = "scientifik.ScientifikPublishPlugin" } diff --git a/src/main/kotlin/scientifik/ScientifikJSPlugin.kt b/src/main/kotlin/scientifik/ScientifikJSPlugin.kt index f746979..93dc330 100644 --- a/src/main/kotlin/scientifik/ScientifikJSPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikJSPlugin.kt @@ -50,9 +50,9 @@ open class ScientifikJSPlugin : Plugin { dependsOn(browserWebpack) from(fileTree("src/main/web")) into(browserWebpack.destinationDirectory!!) - doLast{ - val indexFile = File(browserWebpack.destinationDirectory!!,"index.html") - if(indexFile.exists()){ + doLast { + val indexFile = File(browserWebpack.destinationDirectory!!, "index.html") + if (indexFile.exists()) { println("Run JS distribution at: ${indexFile.canonicalPath}") } } diff --git a/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt b/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt index 851061e..89a4777 100644 --- a/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikJVMPlugin.kt @@ -28,6 +28,7 @@ open class ScientifikJVMPlugin : Plugin { } configure { + val sourceSet = sourceSets["main"].apply { languageSettings.applySettings() dependencies { @@ -35,6 +36,14 @@ open class ScientifikJVMPlugin : Plugin { } } + sourceSets["test"].apply { + languageSettings.applySettings() + dependencies { + implementation(kotlin("test")) + implementation(kotlin("test-junit")) + } + } + val sourcesJar by tasks.registering(Jar::class) { archiveClassifier.set("sources") from(sourceSet.kotlin.srcDirs.first()) @@ -54,7 +63,6 @@ open class ScientifikJVMPlugin : Plugin { val dokka by tasks.getting(DokkaTask::class) { outputFormat = "html" outputDirectory = "$buildDir/javadoc" - jdkVersion = 8 } val kdocJar by tasks.registering(Jar::class) { diff --git a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt index ffacd6e..a5e4332 100644 --- a/src/main/kotlin/scientifik/ScientifikMPPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikMPPlugin.kt @@ -82,25 +82,9 @@ open class ScientifikMPPlugin : Plugin { val dokka by tasks.getting(DokkaTask::class) { outputFormat = "html" outputDirectory = "$buildDir/javadoc" - jdkVersion = 8 + multiplatform{ - kotlinTasks { - // dokka fails to retrieve sources from MPP-tasks so we only define the jvm task - listOf(tasks.getByPath("compileKotlinJvm")) } - sourceRoot { - // assuming only single source dir - path = sourceSets["commonMain"].kotlin.srcDirs.first().toString() - platforms = listOf("Common") - } - // although the JVM sources are now taken from the task, - // we still define the jvm source root to get the JVM marker in the generated html - sourceRoot { - // assuming only single source dir - path = sourceSets["jvmMain"].kotlin.srcDirs.first().toString() - platforms = listOf("JVM") - } - } val kdocJar by tasks.registering(Jar::class) { diff --git a/src/main/kotlin/scientifik/ScientifikNativePlugin.kt b/src/main/kotlin/scientifik/ScientifikNativePlugin.kt index d1fa4e1..95b4d45 100644 --- a/src/main/kotlin/scientifik/ScientifikNativePlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikNativePlugin.kt @@ -19,10 +19,8 @@ class ScientifikNativePlugin : Plugin { dependsOn(commonMain) dependencies { + api(kotlin("native")) //TODO add stdlib here - target.afterEvaluate { - //TODO add optional libraries here - } } } diff --git a/src/main/kotlin/scientifik/ScientifikPublishPlugin.kt b/src/main/kotlin/scientifik/ScientifikPublishPlugin.kt index 6316b41..f8d635d 100644 --- a/src/main/kotlin/scientifik/ScientifikPublishPlugin.kt +++ b/src/main/kotlin/scientifik/ScientifikPublishPlugin.kt @@ -79,6 +79,7 @@ open class ScientifikPublishPlugin : Plugin { username = githubUser password = githubToken } + } val githubPublishTasks = publications.filterIsInstance().map { publication ->