1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

Merge branch 'master' of github.com:cbeust/kobalt

This commit is contained in:
Cedric Beust 2016-02-01 20:54:27 -08:00
commit d649eb3dd7
4 changed files with 20 additions and 15 deletions

View file

@ -1 +1 @@
kobalt.version=0.404 kobalt.version=0.407

View file

@ -238,10 +238,8 @@ abstract class JvmCompilerPlugin @Inject constructor(
CompilerActionInfo { CompilerActionInfo {
copyResources(project, JvmCompilerPlugin.SOURCE_SET_MAIN) copyResources(project, JvmCompilerPlugin.SOURCE_SET_MAIN)
val fullClasspath = if (isTest) val fullClasspath = if (isTest) dependencyManager.testDependencies(project, context)
dependencyManager.testDependencies(project, context) else dependencyManager.dependencies(project, context)
else
dependencyManager.dependencies(project, context)
// Remove all the excluded dependencies from the classpath // Remove all the excluded dependencies from the classpath
val classpath = fullClasspath.filter { val classpath = fullClasspath.filter {
@ -249,19 +247,19 @@ abstract class JvmCompilerPlugin @Inject constructor(
} }
val projectDirectory = File(project.directory) val projectDirectory = File(project.directory)
val buildDirectory = if (isTest) KFiles.makeOutputTestDir(project) val buildDirectory = if (isTest) File(project.buildDirectory, KFiles.TEST_CLASSES_DIR)
else File(project.classesDir(context)) else File(project.classesDir(context))
buildDirectory.mkdirs() buildDirectory.mkdirs()
val initialSourceDirectories = arrayListOf<File>() val initialSourceDirectories = arrayListOf<File>()
// Source directories from the contributors // Source directories from the contributors
initialSourceDirectories.addAll( initialSourceDirectories.addAll(
if (isTest) { if (isTest) {
context.pluginInfo.testSourceDirContributors.flatMap { it.testSourceDirectoriesFor(project, context) } context.pluginInfo.testSourceDirContributors.flatMap { it.testSourceDirectoriesFor(project, context) }
} else { } else {
context.pluginInfo.sourceDirContributors.flatMap { it.sourceDirectoriesFor(project, context) } context.pluginInfo.sourceDirContributors.flatMap { it.sourceDirectoriesFor(project, context) }
}) })
// Transform them with the interceptors, if any // Transform them with the interceptors, if any
val sourceDirectories = if (isTest) { val sourceDirectories = if (isTest) {

View file

@ -137,8 +137,15 @@ public class GithubApi @Inject constructor(val executors: KobaltExecutors,
} }
} catch(e: RetrofitError) { } catch(e: RetrofitError) {
val error = parseRetrofitError(e) val error = parseRetrofitError(e)
throw KobaltException("Couldn't retrieve releases, ${error.message ?: e}: " val details = if (error.errors != null) {
+ error.errors[0].code + " field: " + error.errors[0].field) 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 result
} }

View file

@ -1 +1 @@
kobalt.version=0.404 kobalt.version=0.407