From a9fd6f1464d2e2f8f6550bfd2d36a0df8fa385a5 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 20 Jun 2018 17:14:57 +0200 Subject: [PATCH] Convert gradle from kotlin to groovy (at the moment, kotlin makes it more difficult) --- build.gradle | 70 +++++++++++++++++++++++++++++++ build.gradle.kts | 107 ----------------------------------------------- 2 files changed, 70 insertions(+), 107 deletions(-) create mode 100644 build.gradle delete mode 100644 build.gradle.kts diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..908edbe --- /dev/null +++ b/build.gradle @@ -0,0 +1,70 @@ +plugins { + id 'java' + id 'maven' +} + +ext { + bcVersion = '1.59' + jnaVersion = '4.5.1' +} + +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 + +sourceSets { + main { + java { + setSrcDirs Collections.singletonList('src') + } + } + test { + java { + setSrcDirs Collections.singletonList('test') + } + } +} + + +repositories { + mavenLocal() + mavenCentral() +} + +dependencies { + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' + + compile group: 'com.github.jponge', name: 'lzma-java', version: '1.3' + compile group: 'com.fasterxml.uuid', name: 'java-uuid-generator', version: '3.1.5' + + compile group: 'com.esotericsoftware', name: 'kryo', version: '4.0.2' + compile group: 'io.netty', name: 'netty-all', version: '4.1.24.Final' + + compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: bcVersion + compile group: 'org.bouncycastle', name: 'bcpg-jdk15on', version: bcVersion + compile group: 'org.bouncycastle', name: 'bcmail-jdk15on', version: bcVersion +// compile group: 'org.bouncycastle', name: 'bctls-jdk15on', version: bcVersion + + compile group: 'org.lwjgl', name: 'lwjgl-xxhash', version: '3.1.6' + compile group: 'org.javassist', name: 'javassist', version: '3.21.0-GA' + + compile group: 'com.dorkbox', name: 'ShellExecutor', version: '1.1+' + + compile group: 'net.java.dev.jna', name: 'jna', version: jnaVersion + compile group: 'net.java.dev.jna', name: 'jna-platform', version: jnaVersion + + // unit testing + testCompile group: 'junit', name: 'junit', version: '4.12' + testRuntime group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.6' +} + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' + options.incremental = true + options.fork = true + options.forkOptions.executable = 'javac' + + // setup compile options. we specifically want to suppress usage of "Unsafe" + options.compilerArgs += ['-XDignore.symbol.file', '-Xlint:deprecation'] +} + + diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index d1be120..0000000 --- a/build.gradle.kts +++ /dev/null @@ -1,107 +0,0 @@ -import org.gradle.api.internal.HasConvention -import org.gradle.internal.impldep.org.apache.http.client.methods.RequestBuilder.options -import org.jetbrains.kotlin.gradle.dsl.Coroutines -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet -import org.jetbrains.kotlin.gradle.plugin.android.AndroidGradleWrapper.srcDir -import java.io.File - -buildscript { - dependencies { -// classpath("com.bmuschko:gradle-docker-plugin:${property("gradle_docker_plugin.version")}") - } -} - -plugins { - java - maven - // the version is defined in the parent project. Change this if you are working DIRECTLY with Utilities -// kotlin("jvm") version "1.2.40" - kotlin("jvm") -} - -apply { - plugin("java") - plugin("kotlin") -} - -kotlin.experimental.coroutines = Coroutines.ENABLE - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -// make working with sourcesets easier -val sourceSets = java.sourceSets -fun sourceSets(block: SourceSetContainer.() -> Unit) = sourceSets.apply(block) - -val SourceSetContainer.main: SourceSet get() = getByName("main") -fun SourceSetContainer.main(block: SourceSet.() -> Unit) = main.apply(block) - -val SourceSetContainer.test: SourceSet get() = getByName("test") -fun SourceSetContainer.test(block: SourceSet.() -> Unit) = test.apply(block) - -var SourceDirectorySet.sourceDirs: Iterable - get() = srcDirs - set(value) { - setSrcDirs(value) - } - -sourceSets { - main { - java { - sourceDirs = files("src") - } - } - test { - java { - sourceDirs = files("test") - } - } -} - - -repositories { - mavenLocal() - mavenCentral() -} - -dependencies { - val bcVersion = "1.59" - - compile(group = "org.slf4j", name = "slf4j-api", version = "1.7.25") - compile(group = "ch.qos.logback", name = "logback-classic", version = "1.1.6") - - compile(group = "com.github.jponge", name = "lzma-java", version = "1.3") - compile(group = "com.fasterxml.uuid", name = "java-uuid-generator", version = "3.1.5") - - compile(group = "com.esotericsoftware", name = "kryo", version = "4.0.2") - compile(group = "io.netty", name = "netty-all", version = "4.1.24.Final") - - compile(group = "org.bouncycastle", name = "bcprov-jdk15on", version = bcVersion) - compile(group = "org.bouncycastle", name = "bcpg-jdk15on", version = bcVersion) - compile(group = "org.bouncycastle", name = "bcmail-jdk15on", version = bcVersion) -// compile(group = "org.bouncycastle", name = "bctls-jdk15on", version = bcVersion) - - compile(group = "org.lwjgl", name = "lwjgl-xxhash", version = "3.1.6") - compile(group = "org.javassist", name = "javassist", version = "3.21.0-GA") - compile(group = "com.dorkbox", name = "ShellExecutor", version = "1.1+") - - compile(group = "net.java.dev.jna", name = "jna", version = "4.5.1") - compile(group = "net.java.dev.jna", name = "jna-platform", version = "4.5.1") - - // unit testing - testCompile(group = "junit", name = "junit", version = "4.12") -} - -tasks.withType { - options.encoding = "UTF-8" - options.isIncremental = true - options.isFork = true - options.forkOptions.executable = "javac" - - // setup compile options. we specifically want to suppress usage of "Unsafe" - options.compilerArgs = listOf("-XDignore.symbol.file", "-Xlint:deprecation") -} - -