kotlin 1.3.60, gradle 6, junit5

This commit is contained in:
Alexander Nozik 2019-11-17 21:41:23 +03:00
parent af1e79ddba
commit 8071d33c44
8 changed files with 43 additions and 39 deletions

View File

@ -7,7 +7,7 @@ plugins {
} }
group = "scientifik" group = "scientifik"
version = "0.2.2" version = "0.2.4"
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
@ -16,7 +16,7 @@ repositories {
maven("https://dl.bintray.com/kotlin/kotlin-eap") maven("https://dl.bintray.com/kotlin/kotlin-eap")
} }
val kotlinVersion = "1.3.50" val kotlinVersion = "1.3.60"
// Add plugins used in buildSrc as dependencies, also we should specify version only here // Add plugins used in buildSrc as dependencies, also we should specify version only here
dependencies { dependencies {

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

33
gradlew vendored
View File

@ -125,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if $cygwin ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
@ -154,19 +154,19 @@ if $cygwin ; then
else else
eval `echo args$i`="\"$arg\"" eval `echo args$i`="\"$arg\""
fi fi
i=$((i+1)) i=`expr $i + 1`
done done
case $i in case $i in
(0) set -- ;; 0) set -- ;;
(1) set -- "$args0" ;; 1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;; 2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;; 3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }
APP_ARGS=$(save "$@") APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules # Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

View File

@ -6,4 +6,5 @@ object Scientifik {
const val coroutinesVersion = "1.3.2" const val coroutinesVersion = "1.3.2"
const val atomicfuVersion = "0.12.11" const val atomicfuVersion = "0.12.11"
const val serializationVersion = "0.13.0" const val serializationVersion = "0.13.0"
const val JVM_VERSION = "11"
} }

View File

@ -36,12 +36,10 @@ open class ScientifikJSPlugin : Plugin<Project> {
tasks.apply { tasks.apply {
val browserWebpack by getting(KotlinWebpack::class) { val browserWebpack by getting(KotlinWebpack::class) {
afterEvaluate { afterEvaluate {
val destination = listOf(archiveBaseName, archiveAppendix, archiveVersion, archiveClassifier) val destination = listOf(name, version.toString()).joinToString("-")
.filter { it != null && it.isNotBlank() }
.joinToString("-")
destinationDirectory = destinationDirectory?.resolve(destination) destinationDirectory = destinationDirectory?.resolve(destination)
} }
archiveFileName = "main.bundle.js" outputFileName = "main.bundle.js"
} }
afterEvaluate { afterEvaluate {

View File

@ -6,6 +6,7 @@ import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.*
import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
@ -22,7 +23,7 @@ open class ScientifikJVMPlugin : Plugin<Project> {
tasks.withType<KotlinCompile> { tasks.withType<KotlinCompile> {
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "11"
} }
} }
@ -39,7 +40,9 @@ open class ScientifikJVMPlugin : Plugin<Project> {
languageSettings.applySettings() languageSettings.applySettings()
dependencies { dependencies {
implementation(kotlin("test")) implementation(kotlin("test"))
implementation(kotlin("test-junit")) //implementation(kotlin("test-junit"))
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter:5.5.2")
} }
} }
@ -60,6 +63,8 @@ open class ScientifikJVMPlugin : Plugin<Project> {
} }
pluginManager.withPlugin("org.jetbrains.dokka") { pluginManager.withPlugin("org.jetbrains.dokka") {
logger.info("Adding dokka functionality to project ${this@with.name}")
val dokka by tasks.getting(DokkaTask::class) { val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html" outputFormat = "html"
outputDirectory = "$buildDir/javadoc" outputDirectory = "$buildDir/javadoc"
@ -83,9 +88,9 @@ open class ScientifikJVMPlugin : Plugin<Project> {
} }
} }
} }
tasks.withType<Test>(){
useJUnitPlatform()
}
} }
} }

View File

@ -7,6 +7,7 @@ import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.Copy import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.bundling.Jar import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.*
import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
@ -27,7 +28,7 @@ open class ScientifikMPPlugin : Plugin<Project> {
jvm { jvm {
compilations.all { compilations.all {
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "11"
} }
} }
} }
@ -57,7 +58,9 @@ open class ScientifikMPPlugin : Plugin<Project> {
val jvmTest by getting { val jvmTest by getting {
dependencies { dependencies {
implementation(kotlin("test")) implementation(kotlin("test"))
implementation(kotlin("test-junit")) //implementation(kotlin("test-junit"))
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter:5.5.2")
} }
} }
val jsMain by getting { val jsMain by getting {
@ -79,6 +82,7 @@ open class ScientifikMPPlugin : Plugin<Project> {
} }
pluginManager.withPlugin("org.jetbrains.dokka") { pluginManager.withPlugin("org.jetbrains.dokka") {
logger.info("Adding dokka functionality to project ${this@run.name}")
val dokka by tasks.getting(DokkaTask::class) { val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html" outputFormat = "html"
outputDirectory = "$buildDir/javadoc" outputDirectory = "$buildDir/javadoc"
@ -112,14 +116,11 @@ open class ScientifikMPPlugin : Plugin<Project> {
tasks.apply { tasks.apply {
val jsBrowserWebpack by getting(KotlinWebpack::class) { val jsBrowserWebpack by getting(KotlinWebpack::class) {
archiveClassifier = "js" afterEvaluate {
project.afterEvaluate { val destination = listOf(name, version.toString()).joinToString("-")
val destination = listOf(archiveBaseName, archiveAppendix, archiveVersion, archiveClassifier)
.filter { it != null && it.isNotBlank() }
.joinToString("-")
destinationDirectory = destinationDirectory?.resolve(destination) destinationDirectory = destinationDirectory?.resolve(destination)
} }
archiveFileName = "main.bundle.js" outputFileName = "main.bundle.js"
} }
afterEvaluate { afterEvaluate {
@ -138,6 +139,10 @@ open class ScientifikMPPlugin : Plugin<Project> {
findByName("assemble")?.dependsOn(installJsDist) findByName("assemble")?.dependsOn(installJsDist)
} }
withType<Test>(){
useJUnitPlatform()
}
} }
} }