From dac01c371acc91bc0169b18f04ee5d29884395d8 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 30 Jan 2016 23:21:12 +0400 Subject: [PATCH 1/5] NPE in GithubApi. --- .../main/kotlin/com/beust/kobalt/misc/GithubApi.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt index 4864b3d5..a7d3fcd7 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt @@ -137,8 +137,15 @@ public class GithubApi @Inject constructor(val executors: KobaltExecutors, } } catch(e: RetrofitError) { val error = parseRetrofitError(e) - throw KobaltException("Couldn't retrieve releases, ${error.message ?: e}: " - + error.errors[0].code + " field: " + error.errors[0].field) + val details = if (error.errors != null) { + error.errors[0] + } else { + null + } + // TODO: If the credentials didn't work ("bad credentials"), should start again + // using cbeust/kobalt, like above. Right now, just bailing. + log(2, "Couldn't retrieve releases from github, ${error.message ?: e}: " + + details?.code + " field: " + details?.field) } result } From bddcd3071d31db1e2215351defdaed89f299049b Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 30 Jan 2016 23:21:27 +0400 Subject: [PATCH 2/5] =?UTF-8?q?0.406.=E2=80=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kobalt/wrapper/kobalt-wrapper.properties | 2 +- src/main/resources/kobalt.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index fb433082..39ecd5f1 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=0.404 \ No newline at end of file +kobalt.version=0.406 \ No newline at end of file diff --git a/src/main/resources/kobalt.properties b/src/main/resources/kobalt.properties index e8f06090..b19139e9 100644 --- a/src/main/resources/kobalt.properties +++ b/src/main/resources/kobalt.properties @@ -1 +1 @@ -kobalt.version=0.404 +kobalt.version=0.406 From 94a7aedd9651f7e4b425787668ac9662f0f7a29f Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 2 Feb 2016 01:46:10 +0400 Subject: [PATCH 3/5] Fix test directory output. --- .../kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt index 169b3e5f..c7d4efaf 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt @@ -249,8 +249,8 @@ abstract class JvmCompilerPlugin @Inject constructor( } val projectDirectory = File(project.directory) - val buildDirectory = if (isTest) KFiles.makeOutputTestDir(project) - else File(project.classesDir(context)) + val buildDirectory = if (isTest) File(project.buildDirectory, KFiles.TEST_CLASSES_DIR) + else File(project.classesDir(context)) buildDirectory.mkdirs() val initialSourceDirectories = arrayListOf() From f39c3ce5149769bb3f0fc88f2948e644d679a6e7 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 2 Feb 2016 02:20:01 +0400 Subject: [PATCH 4/5] 0.408. --- kobalt/wrapper/kobalt-wrapper.properties | 2 +- src/main/resources/kobalt.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 39ecd5f1..5e75246b 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=0.406 \ No newline at end of file +kobalt.version=0.407 \ No newline at end of file diff --git a/src/main/resources/kobalt.properties b/src/main/resources/kobalt.properties index b19139e9..1bfab0ca 100644 --- a/src/main/resources/kobalt.properties +++ b/src/main/resources/kobalt.properties @@ -1 +1 @@ -kobalt.version=0.406 +kobalt.version=0.407 From 5027a9208745b32889db3d3d2d58fd9656123f91 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 2 Feb 2016 02:57:49 +0400 Subject: [PATCH 5/5] Reformat. --- .../beust/kobalt/internal/JvmCompilerPlugin.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt index c7d4efaf..bd74d8a2 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt @@ -238,10 +238,8 @@ abstract class JvmCompilerPlugin @Inject constructor( CompilerActionInfo { copyResources(project, JvmCompilerPlugin.SOURCE_SET_MAIN) - val fullClasspath = if (isTest) - dependencyManager.testDependencies(project, context) - else - dependencyManager.dependencies(project, context) + val fullClasspath = if (isTest) dependencyManager.testDependencies(project, context) + else dependencyManager.dependencies(project, context) // Remove all the excluded dependencies from the classpath val classpath = fullClasspath.filter { @@ -257,11 +255,11 @@ abstract class JvmCompilerPlugin @Inject constructor( // Source directories from the contributors initialSourceDirectories.addAll( - if (isTest) { - context.pluginInfo.testSourceDirContributors.flatMap { it.testSourceDirectoriesFor(project, context) } - } else { - context.pluginInfo.sourceDirContributors.flatMap { it.sourceDirectoriesFor(project, context) } - }) + if (isTest) { + context.pluginInfo.testSourceDirContributors.flatMap { it.testSourceDirectoriesFor(project, context) } + } else { + context.pluginInfo.sourceDirContributors.flatMap { it.sourceDirectoriesFor(project, context) } + }) // Transform them with the interceptors, if any val sourceDirectories = if (isTest) {