Updated version info + plugins
This commit is contained in:
parent
19a3ec0f46
commit
0b4f57b365
101
build.gradle.kts
101
build.gradle.kts
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
|
|
||||||
import dorkbox.gradle.kotlin
|
import dorkbox.gradle.kotlin
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
@ -25,13 +24,16 @@ import java.time.Instant
|
||||||
////// RELEASE : (to sonatype/maven central), <'publish and release' - 'publishToSonatypeAndRelease'>
|
////// RELEASE : (to sonatype/maven central), <'publish and release' - 'publishToSonatypeAndRelease'>
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
|
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS // always show the stacktrace!
|
||||||
|
gradle.startParameter.warningMode = WarningMode.All
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
|
|
||||||
id("com.dorkbox.GradleUtils") version "1.8"
|
id("com.dorkbox.GradleUtils") version "1.9"
|
||||||
id("com.dorkbox.Licensing") version "2.0"
|
id("com.dorkbox.Licensing") version "2.2"
|
||||||
id("com.dorkbox.VersionUpdate") version "1.7"
|
id("com.dorkbox.VersionUpdate") version "2.0"
|
||||||
id("com.dorkbox.GradlePublish") version "1.3"
|
id("com.dorkbox.GradlePublish") version "1.4"
|
||||||
id("com.dorkbox.GradleModuleInfo") version "1.0"
|
id("com.dorkbox.GradleModuleInfo") version "1.0"
|
||||||
|
|
||||||
kotlin("jvm") version "1.3.72"
|
kotlin("jvm") version "1.3.72"
|
||||||
|
@ -47,11 +49,8 @@ object Extras {
|
||||||
const val vendor = "Dorkbox LLC"
|
const val vendor = "Dorkbox LLC"
|
||||||
const val vendorUrl = "https://dorkbox.com"
|
const val vendorUrl = "https://dorkbox.com"
|
||||||
const val url = "https://git.dorkbox.com/dorkbox/Executor"
|
const val url = "https://git.dorkbox.com/dorkbox/Executor"
|
||||||
val buildDate = Instant.now().toString()
|
|
||||||
|
|
||||||
val JAVA_VERSION = JavaVersion.VERSION_11.toString()
|
val buildDate = Instant.now().toString()
|
||||||
const val KOTLIN_API_VERSION = "1.3"
|
|
||||||
const val KOTLIN_LANG_VERSION = "1.3"
|
|
||||||
|
|
||||||
const val coroutineVer = "1.3.8"
|
const val coroutineVer = "1.3.8"
|
||||||
}
|
}
|
||||||
|
@ -61,12 +60,29 @@ object Extras {
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
GradleUtils.load("$projectDir/../../gradle.properties", Extras)
|
GradleUtils.load("$projectDir/../../gradle.properties", Extras)
|
||||||
GradleUtils.fixIntellijPaths()
|
GradleUtils.fixIntellijPaths()
|
||||||
|
GradleUtils.defaultResolutionStrategy()
|
||||||
|
GradleUtils.compileConfiguration(JavaVersion.VERSION_11) {
|
||||||
|
it.apply {
|
||||||
|
// see: https://kotlinlang.org/docs/reference/using-gradle.html
|
||||||
|
apiVersion = "1.3"
|
||||||
|
languageVersion = "1.3"
|
||||||
|
|
||||||
|
freeCompilerArgs = listOf(
|
||||||
|
// enable the use of inline classes. see https://kotlinlang.org/docs/reference/inline-classes.html
|
||||||
|
"-Xinline-classes",
|
||||||
|
// enable the use of experimental methods
|
||||||
|
"-Xopt-in=kotlin.RequiresOptIn"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
licensing {
|
licensing {
|
||||||
license(License.APACHE_2) {
|
license(License.APACHE_2) {
|
||||||
description(Extras.description)
|
description(Extras.description)
|
||||||
url(Extras.url)
|
url(Extras.url)
|
||||||
author(Extras.vendor)
|
author(Extras.vendor)
|
||||||
|
|
||||||
extra("ZT Process Executor", License.APACHE_2) {
|
extra("ZT Process Executor", License.APACHE_2) {
|
||||||
it.url("https://github.com/zeroturnaround/zt-exec")
|
it.url("https://github.com/zeroturnaround/zt-exec")
|
||||||
it.copyright(2014)
|
it.copyright(2014)
|
||||||
|
@ -82,13 +98,6 @@ licensing {
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
|
||||||
setSrcDirs(listOf("src"))
|
|
||||||
|
|
||||||
// want to include java files for the source. 'setSrcDirs' resets includes...
|
|
||||||
include("**/*.java")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
setSrcDirs(listOf("src"))
|
setSrcDirs(listOf("src"))
|
||||||
|
|
||||||
|
@ -109,7 +118,7 @@ sourceSets {
|
||||||
setSrcDirs(listOf("test"))
|
setSrcDirs(listOf("test"))
|
||||||
|
|
||||||
// want to include java files for the source. 'setSrcDirs' resets includes...
|
// want to include java files for the source. 'setSrcDirs' resets includes...
|
||||||
include("**/*.kt")
|
include("**/*.java", "**/*.kt")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,46 +127,6 @@ repositories {
|
||||||
mavenLocal() // this must be first!
|
mavenLocal() // this must be first!
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
///////////////////////////////
|
|
||||||
////// Task defaults
|
|
||||||
///////////////////////////////
|
|
||||||
tasks.withType<JavaCompile> {
|
|
||||||
doFirst {
|
|
||||||
println("\tCompiling classes to Java $sourceCompatibility")
|
|
||||||
}
|
|
||||||
|
|
||||||
options.encoding = "UTF-8"
|
|
||||||
|
|
||||||
sourceCompatibility = Extras.JAVA_VERSION
|
|
||||||
targetCompatibility = Extras.JAVA_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
|
||||||
doFirst {
|
|
||||||
println("\tCompiling classes to Kotlin, Java ${kotlinOptions.jvmTarget}")
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceCompatibility = Extras.JAVA_VERSION
|
|
||||||
targetCompatibility = Extras.JAVA_VERSION
|
|
||||||
|
|
||||||
// see: https://kotlinlang.org/docs/reference/using-gradle.html
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = Extras.JAVA_VERSION
|
|
||||||
apiVersion = Extras.KOTLIN_API_VERSION
|
|
||||||
languageVersion = Extras.KOTLIN_LANG_VERSION
|
|
||||||
|
|
||||||
freeCompilerArgs = listOf(
|
|
||||||
// enable the use of inline classes. see https://kotlinlang.org/docs/reference/inline-classes.html
|
|
||||||
"-Xinline-classes",
|
|
||||||
// enable the use of experimental methods
|
|
||||||
"-Xopt-in=kotlin.RequiresOptIn"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Jar> {
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.jar.get().apply {
|
tasks.jar.get().apply {
|
||||||
manifest {
|
manifest {
|
||||||
|
@ -199,24 +168,6 @@ dependencies {
|
||||||
testImplementation("ch.qos.logback:logback-classic:1.2.3")
|
testImplementation("ch.qos.logback:logback-classic:1.2.3")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
configurations.all {
|
|
||||||
resolutionStrategy {
|
|
||||||
// fail eagerly on version conflict (includes transitive dependencies)
|
|
||||||
// e.g. multiple different versions of the same dependency (group and name are equal)
|
|
||||||
failOnVersionConflict()
|
|
||||||
|
|
||||||
// if there is a version we specified, USE THAT VERSION (over transitive versions)
|
|
||||||
preferProjectModules()
|
|
||||||
|
|
||||||
// cache dynamic versions for 10 minutes
|
|
||||||
cacheDynamicVersionsFor(10 * 60, "seconds")
|
|
||||||
|
|
||||||
// don't cache changing modules at all
|
|
||||||
cacheChangingModulesFor(0, "seconds")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publishToSonatype {
|
publishToSonatype {
|
||||||
groupId = Extras.group
|
groupId = Extras.group
|
||||||
artifactId = Extras.id
|
artifactId = Extras.id
|
||||||
|
|
Loading…
Reference in New Issue