Fixed compilation versions for plugin and JVM target

This commit is contained in:
Alexander Nozik 2019-11-20 10:41:37 +03:00
parent cca2fdae8e
commit 1728ba7585
3 changed files with 14 additions and 3 deletions

View File

@ -18,6 +18,10 @@ repositories {
val kotlinVersion = "1.3.60"
java {
targetCompatibility = JavaVersion.VERSION_11
}
// Add plugins used in buildSrc as dependencies, also we should specify version only here
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
@ -73,7 +77,6 @@ publishing {
// Process each publication we have in this project
publications.filterIsInstance<MavenPublication>().forEach { publication ->
@Suppress("UnstableApiUsage")
publication.pom {
name.set(project.name)
description.set(project.description)

View File

@ -1,8 +1,11 @@
package scientifik
import Scientifik
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar
@ -20,9 +23,13 @@ open class ScientifikJVMPlugin : Plugin<Project> {
repositories.applyRepos()
extensions.findByType<JavaPluginExtension>()?.apply {
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
jvmTarget = Scientifik.JVM_VERSION
}
}

View File

@ -1,5 +1,6 @@
package scientifik
import Scientifik
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaBasePlugin
@ -27,7 +28,7 @@ open class ScientifikMPPlugin : Plugin<Project> {
jvm {
compilations.all {
kotlinOptions {
jvmTarget = "11"
jvmTarget = Scientifik.JVM_VERSION
}
}
}