mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
First try at running under Java 9.
This commit is contained in:
parent
86e39cbb58
commit
c99a9eb6cd
4 changed files with 45 additions and 40 deletions
|
@ -25,16 +25,18 @@ val bs = buildScript {
|
||||||
}
|
}
|
||||||
|
|
||||||
object Versions {
|
object Versions {
|
||||||
val okhttp = "3.2.0"
|
val okhttp = "3.9.0"
|
||||||
val okio = "1.6.0"
|
val okio = "1.13.0"
|
||||||
val retrofit = "2.1.0"
|
val retrofit = "2.3.0"
|
||||||
val gson = "2.6.2"
|
val gson = "2.8.2"
|
||||||
val maven = "3.3.9"
|
val guice = "4.1.0"
|
||||||
val mavenResolver = "1.0.3"
|
val maven = "3.5.2"
|
||||||
|
val mavenResolver = "1.1.0"
|
||||||
val slf4j = "1.7.3"
|
val slf4j = "1.7.3"
|
||||||
val kotlin = "1.1.2"
|
val kotlin = "1.1.51"
|
||||||
val aether = "1.0.2.v20150114"
|
val aether = "1.0.2.v20150114"
|
||||||
val testng = "6.11"
|
val testng = "6.12"
|
||||||
|
val jcommander = "1.72"
|
||||||
|
|
||||||
// JUnit 5
|
// JUnit 5
|
||||||
val junit = "4.12"
|
val junit = "4.12"
|
||||||
|
@ -97,34 +99,32 @@ val kobaltPluginApi = project {
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(
|
compile(
|
||||||
"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}",
|
"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}",
|
||||||
"com.google.inject:guice:4.0",
|
"com.google.inject:guice:${Versions.guice}",
|
||||||
"com.google.inject.extensions:guice-assistedinject:4.0",
|
"com.google.inject.extensions:guice-assistedinject:4.1.0",
|
||||||
"javax.inject:javax.inject:1",
|
"javax.inject:javax.inject:1",
|
||||||
"com.google.guava:guava:21.0",
|
"com.google.guava:guava:23.3-jre",
|
||||||
"org.apache.maven:maven-model:${Versions.maven}",
|
"org.apache.maven:maven-model:${Versions.maven}",
|
||||||
"io.reactivex:rxjava:1.1.5",
|
"io.reactivex:rxjava:1.3.3",
|
||||||
"com.squareup.okio:okio:${Versions.okio}",
|
"com.squareup.okio:okio:${Versions.okio}",
|
||||||
"com.google.code.gson:gson:${Versions.gson}",
|
"com.google.code.gson:gson:${Versions.gson}",
|
||||||
"com.squareup.okhttp3:okhttp:${Versions.okhttp}",
|
"com.squareup.okhttp3:okhttp:${Versions.okhttp}",
|
||||||
"com.squareup.retrofit2:retrofit:${Versions.retrofit}",
|
"com.squareup.retrofit2:retrofit:${Versions.retrofit}",
|
||||||
"com.squareup.retrofit2:converter-gson:${Versions.retrofit}",
|
"com.squareup.retrofit2:converter-gson:${Versions.retrofit}",
|
||||||
"com.beust:jcommander:1.48",
|
"com.beust:jcommander:${Versions.jcommander}",
|
||||||
"org.eclipse.jgit:org.eclipse.jgit:4.5.0.201609210915-r",
|
"org.eclipse.jgit:org.eclipse.jgit:4.9.0.201710071750-r",
|
||||||
"org.slf4j:slf4j-simple:${Versions.slf4j}",
|
"org.slf4j:slf4j-simple:${Versions.slf4j}",
|
||||||
*mavenResolver("api", "spi", "util", "impl", "connector-basic", "transport-http", "transport-file"),
|
*mavenResolver("api", "spi", "util", "impl", "connector-basic", "transport-http", "transport-file"),
|
||||||
"org.apache.maven:maven-aether-provider:3.3.9",
|
"org.apache.maven:maven-aether-provider:3.3.9",
|
||||||
"org.testng.testng-remote:testng-remote:1.3.2",
|
"org.testng.testng-remote:testng-remote:1.3.2",
|
||||||
"org.testng:testng:${Versions.testng}",
|
"org.testng:testng:${Versions.testng}",
|
||||||
"commons-io:commons-io:2.5",
|
|
||||||
"org.junit.platform:junit-platform-surefire-provider:${Versions.junitPlatform}",
|
"org.junit.platform:junit-platform-surefire-provider:${Versions.junitPlatform}",
|
||||||
"org.junit.platform:junit-platform-runner:${Versions.junitPlatform}",
|
"org.junit.platform:junit-platform-runner:${Versions.junitPlatform}",
|
||||||
"org.junit.platform:junit-platform-engine:${Versions.junitPlatform}",
|
"org.junit.platform:junit-platform-engine:${Versions.junitPlatform}",
|
||||||
"org.junit.platform:junit-platform-console:${Versions.junitPlatform}",
|
"org.junit.platform:junit-platform-console:${Versions.junitPlatform}",
|
||||||
"org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiter}",
|
"org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiter}",
|
||||||
"org.junit.vintage:junit-vintage-engine:${Versions.junitVintageVersion}",
|
"org.junit.vintage:junit-vintage-engine:${Versions.junitVintageVersion}",
|
||||||
|
"org.apache.commons:commons-compress:1.15",
|
||||||
"org.apache.commons:commons-compress:1.13",
|
"commons-io:commons-io:2.6"
|
||||||
"commons-io:commons-io:2.5"
|
|
||||||
)
|
)
|
||||||
exclude(*aether("impl", "spi", "util", "api"))
|
exclude(*aether("impl", "spi", "util", "api"))
|
||||||
}
|
}
|
||||||
|
@ -161,24 +161,30 @@ val kobaltApp = project(kobaltPluginApi, wrapper) {
|
||||||
// Used by the main app
|
// Used by the main app
|
||||||
compile(
|
compile(
|
||||||
"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}",
|
"org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}",
|
||||||
"com.github.spullara.mustache.java:compiler:0.9.1",
|
"com.github.spullara.mustache.java:compiler:0.9.5",
|
||||||
"javax.inject:javax.inject:1",
|
"javax.inject:javax.inject:1",
|
||||||
"com.google.inject:guice:4.0",
|
"com.google.inject:guice:${Versions.guice}",
|
||||||
"com.google.inject.extensions:guice-assistedinject:4.0",
|
"com.google.inject.extensions:guice-assistedinject:${Versions.guice}",
|
||||||
"com.beust:jcommander:1.65",
|
"com.beust:jcommander:${Versions.jcommander}",
|
||||||
"org.apache.maven:maven-model:${Versions.maven}",
|
"org.apache.maven:maven-model:${Versions.maven}",
|
||||||
"com.google.code.findbugs:jsr305:3.0.1",
|
"com.google.code.findbugs:jsr305:3.0.2",
|
||||||
"com.google.code.gson:gson:${Versions.gson}",
|
"com.google.code.gson:gson:${Versions.gson}",
|
||||||
"com.squareup.retrofit2:retrofit:${Versions.retrofit}",
|
"com.squareup.retrofit2:retrofit:${Versions.retrofit}",
|
||||||
"com.squareup.retrofit2:converter-gson:${Versions.retrofit}",
|
"com.squareup.retrofit2:converter-gson:${Versions.retrofit}",
|
||||||
"com.squareup.okhttp3:okhttp-ws:${Versions.okhttp}",
|
"com.squareup.okhttp3:okhttp-ws:3.4.2",
|
||||||
"biz.aQute.bnd:bndlib:2.4.0",
|
"biz.aQute.bnd:bndlib:2.4.0",
|
||||||
*mavenResolver("spi"),
|
*mavenResolver("spi"),
|
||||||
|
|
||||||
"com.squareup.okhttp3:logging-interceptor:3.2.0",
|
"com.squareup.okhttp3:logging-interceptor:3.9.0",
|
||||||
|
|
||||||
"com.sparkjava:spark-core:2.5",
|
"com.sparkjava:spark-core:2.6.0",
|
||||||
"org.codehaus.groovy:groovy:2.4.8"
|
"org.codehaus.groovy:groovy:2.4.12",
|
||||||
|
|
||||||
|
// Java 9
|
||||||
|
"javax.xml.bind:jaxb-api:2.3.0",
|
||||||
|
"com.sun.xml.bind:jaxb-impl:2.3.0",
|
||||||
|
"com.sun.xml.bind:jaxb-core:2.3.0",
|
||||||
|
"com.sun.activation:javax.activation:1.2.0"
|
||||||
|
|
||||||
// "org.eclipse.jetty:jetty-server:${Versions.jetty}",
|
// "org.eclipse.jetty:jetty-server:${Versions.jetty}",
|
||||||
// "org.eclipse.jetty:jetty-servlet:${Versions.jetty}",
|
// "org.eclipse.jetty:jetty-servlet:${Versions.jetty}",
|
||||||
|
@ -194,7 +200,7 @@ val kobaltApp = project(kobaltPluginApi, wrapper) {
|
||||||
dependenciesTest {
|
dependenciesTest {
|
||||||
compile("org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}",
|
compile("org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}",
|
||||||
"org.testng:testng:${Versions.testng}",
|
"org.testng:testng:${Versions.testng}",
|
||||||
"org.assertj:assertj-core:3.4.1",
|
"org.assertj:assertj-core:3.8.0",
|
||||||
*mavenResolver("util")
|
*mavenResolver("util")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,12 +86,12 @@ class GithubApi2 @Inject constructor(
|
||||||
.execute()
|
.execute()
|
||||||
val code = response.code()
|
val code = response.code()
|
||||||
if (code != Http.CREATED) {
|
if (code != Http.CREATED) {
|
||||||
val error = Gson().fromJson(response.errorBody().string(), RetrofitError::class.java)
|
val error = Gson().fromJson(response.errorBody()?.string(), RetrofitError::class.java)
|
||||||
throw KobaltException("Couldn't upload release, ${error.message}: " + error.errors[0].code)
|
throw KobaltException("Couldn't upload release, ${error.message}: " + error.errors[0].code)
|
||||||
} else {
|
} else {
|
||||||
val body = response.body()
|
val body = response.body()
|
||||||
|
|
||||||
uploadAsset(accessToken, body.uploadUrl!!, Http.TypedFile("application/zip", zipFile), tagName)
|
uploadAsset(accessToken, body?.uploadUrl!!, Http.TypedFile("application/zip", zipFile), tagName)
|
||||||
.toBlocking()
|
.toBlocking()
|
||||||
.forEach { action ->
|
.forEach { action ->
|
||||||
kobaltLog(1, "\n${zipFile.name} successfully uploaded")
|
kobaltLog(1, "\n${zipFile.name} successfully uploaded")
|
||||||
|
|
|
@ -155,7 +155,7 @@ class KotlinCompiler @Inject constructor(
|
||||||
moduleName = projectName
|
moduleName = projectName
|
||||||
destination = outputDir
|
destination = outputDir
|
||||||
classpath = classpathString
|
classpath = classpathString
|
||||||
freeArgs = sourceFiles
|
freeArgs = sourceFiles.toMutableList()
|
||||||
friendPaths = friends
|
friendPaths = friends
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,10 +178,10 @@ class KotlinCompiler @Inject constructor(
|
||||||
"skip-runtime-version-check" -> args.skipRuntimeVersionCheck = true
|
"skip-runtime-version-check" -> args.skipRuntimeVersionCheck = true
|
||||||
"single-module" -> args.singleModule = true
|
"single-module" -> args.singleModule = true
|
||||||
"load-builtins-from-dependencies" -> args.loadBuiltInsFromDependencies = true
|
"load-builtins-from-dependencies" -> args.loadBuiltInsFromDependencies = true
|
||||||
|
// TODO fix
|
||||||
"coroutines=enable" -> args.coroutinesEnable = true
|
//"coroutines=enable" -> args.coroutinesEnable = true
|
||||||
"coroutines=warn" -> args.coroutinesWarn = true
|
//"coroutines=warn" -> args.coroutinesWarn = true
|
||||||
"coroutines=error" -> args.coroutinesError = true
|
//"coroutines=error" -> args.coroutinesError = true
|
||||||
"no-inline" -> args.noInline = true
|
"no-inline" -> args.noInline = true
|
||||||
"multi-platform" -> args.multiPlatform = true
|
"multi-platform" -> args.multiPlatform = true
|
||||||
"no-check-impl" -> args.noCheckImpl = true
|
"no-check-impl" -> args.noCheckImpl = true
|
||||||
|
@ -214,7 +214,7 @@ class KotlinCompiler @Inject constructor(
|
||||||
+ " " + sourceFiles.joinToString(" "))
|
+ " " + sourceFiles.joinToString(" "))
|
||||||
logk(2, " Additional kotlinc arguments: "
|
logk(2, " Additional kotlinc arguments: "
|
||||||
+ " -moduleName " + args.moduleName
|
+ " -moduleName " + args.moduleName
|
||||||
+ " -friendPaths " + args.friendPaths.joinToString(";"))
|
+ " -friendPaths " + args.friendPaths?.joinToString(";"))
|
||||||
val collector = object : MessageCollector {
|
val collector = object : MessageCollector {
|
||||||
override fun clear() {
|
override fun clear() {
|
||||||
throw UnsupportedOperationException("not implemented")
|
throw UnsupportedOperationException("not implemented")
|
||||||
|
@ -233,8 +233,7 @@ class KotlinCompiler @Inject constructor(
|
||||||
s
|
s
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun report(severity: CompilerMessageSeverity,
|
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) {
|
||||||
message: String, location: CompilerMessageLocation) {
|
|
||||||
if (severity.isError) {
|
if (severity.isError) {
|
||||||
"Couldn't compile file: ${dump(location, message)}".let { fullMessage ->
|
"Couldn't compile file: ${dump(location, message)}".let { fullMessage ->
|
||||||
throw KobaltException(fullMessage)
|
throw KobaltException(fullMessage)
|
||||||
|
|
|
@ -101,12 +101,12 @@ class BintrayApi @Inject constructor(val http: Http,
|
||||||
val pkgName = config.name ?: project.name
|
val pkgName = config.name ?: project.name
|
||||||
val execute = service.getPackage(org ?: username!!, pkgName).execute()
|
val execute = service.getPackage(org ?: username!!, pkgName).execute()
|
||||||
|
|
||||||
if (execute.errorBody()?.string()?.contains("'$pkgName' was not found") ?: false) {
|
if (execute.errorBody()?.string()?.contains("'$pkgName' was not found") == true) {
|
||||||
warn("Package does not exist on bintray. Creating now.")
|
warn("Package does not exist on bintray. Creating now.")
|
||||||
val result = service.createPackage(org ?: username!!, buildPackageInfo(project, config))
|
val result = service.createPackage(org ?: username!!, buildPackageInfo(project, config))
|
||||||
.execute()
|
.execute()
|
||||||
if (result.errorBody() != null) {
|
if (result.errorBody() != null) {
|
||||||
throw KobaltException("Error while creating package:\n" + result.errorBody().string())
|
throw KobaltException("Error while creating package:\n" + result.errorBody())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue