mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-24 23:47:11 -07:00
Update to 1.0.0-beta.
This commit is contained in:
parent
db40768ea0
commit
5d1d63e9b6
43 changed files with 129 additions and 128 deletions
|
@ -1,5 +1,5 @@
|
|||
buildscript {
|
||||
ext.kotlin_version = '0.14.449'
|
||||
ext.kotlin_version = '1.0.0-beta-1038'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@ -41,7 +41,6 @@ dependencies {
|
|||
// "org.jetbrains.kotlin:kotlin-compiler:${kotlin_version}",
|
||||
|
||||
'com.beust:jcommander:1.48',
|
||||
'com.beust:klaxon:0.16',
|
||||
'com.squareup.okhttp:okhttp:2.4.0',
|
||||
'org.jsoup:jsoup:1.8.2',
|
||||
'com.google.inject:guice:4.0',
|
||||
|
|
|
@ -16,18 +16,14 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:0.14.449" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-compiler-embeddable:0.14.449" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.beust:jcommander:1.48" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.guava:guava:18.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.beust:klaxon:0.16" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okhttp:okhttp:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jsoup:jsoup:1.8.2" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.inject:guice:4.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.inject.extensions:guice-assistedinject:4.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.apache.maven:maven-model:3.3.3" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.github.spullara.mustache.java:compiler:0.8.18" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-runtime:0.14.449" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1" level="project" />
|
||||
<orderEntry type="library" name="Gradle: aopalliance:aopalliance:1.0" level="project" />
|
||||
|
@ -42,5 +38,8 @@
|
|||
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.1" level="project" />
|
||||
<orderEntry type="library" name="Gradle: io.reactivex:rxjava:1.0.14" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.4" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-1038" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-compiler-embeddable:1.0.0-beta-1038" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-runtime:1.0.0-beta-1038" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -53,12 +53,11 @@ val kobalt = kotlinProject(wrapper) {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile("org.jetbrains.kotlin:kotlin-stdlib:0.14.449",
|
||||
"org.jetbrains.kotlin:kotlin-compiler-embeddable:0.14.449",
|
||||
compile("org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-1038",
|
||||
"org.jetbrains.kotlin:kotlin-compiler-embeddable:1.0.0-beta-1038",
|
||||
|
||||
// file(homeDir("java/jcommander/target/jcommander-1.47.jar")),
|
||||
"com.beust:jcommander:1.48",
|
||||
"com.beust:klaxon:0.16",
|
||||
"com.squareup.okhttp:okhttp:2.5.0",
|
||||
"org.jsoup:jsoup:1.8.3",
|
||||
"com.google.inject:guice:4.0",
|
||||
|
@ -80,7 +79,7 @@ val assembleKobalt = assemble(kobalt) {
|
|||
mavenJars {
|
||||
fatJar = true
|
||||
manifest {
|
||||
attributes("Main-Class", "com.beust.kobalt.KobaltPackage")
|
||||
attributes("Main-Class", "com.beust.kobalt.MainKt")
|
||||
}
|
||||
}
|
||||
zip {
|
||||
|
@ -92,9 +91,9 @@ val assembleKobalt = assemble(kobalt) {
|
|||
}
|
||||
}
|
||||
|
||||
val cs = kotlinCompiler {
|
||||
args("-nowarn")
|
||||
}
|
||||
//val cs = kotlinCompiler {
|
||||
// args("-nowarn")
|
||||
//}
|
||||
|
||||
|
||||
val jc = jcenter(kobalt) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
kobalt.version=0.195
|
||||
kobalt.version=0.198
|
|
@ -20,7 +20,7 @@ class AsciiArt {
|
|||
" |_|\\_\\ \\___/ |_.__/ \\__,_| |_| \\__| "
|
||||
)
|
||||
|
||||
val banner : String get() = BANNERS.get(Random().nextInt(BANNERS.size()))
|
||||
val banner : String get() = BANNERS.get(Random().nextInt(BANNERS.size))
|
||||
|
||||
fun box(s: String) : List<String> {
|
||||
val ul = "\u2554"
|
||||
|
@ -38,9 +38,9 @@ class AsciiArt {
|
|||
}
|
||||
|
||||
return arrayListOf(
|
||||
ul + r(s.length() + 2, h) + ur,
|
||||
ul + r(s.length + 2, h) + ur,
|
||||
"$v $s $v",
|
||||
bl + r(s.length() + 2, h) + br)
|
||||
bl + r(s.length + 2, h) + br)
|
||||
}
|
||||
|
||||
fun logBox(s: String) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.io.File
|
|||
|
||||
@Directive
|
||||
fun homeDir(vararg dirs: String) : String = SystemProperties.homeDir +
|
||||
File.separator + dirs.toArrayList().join(File.separator)
|
||||
File.separator + dirs.toArrayList().joinToString(File.separator)
|
||||
|
||||
@Directive
|
||||
fun file(file: String) : String = IClasspathDependency.PREFIX_FILE + file
|
||||
|
|
|
@ -139,7 +139,7 @@ private class Main @Inject constructor(
|
|||
//
|
||||
val sb = StringBuffer("List of tasks\n")
|
||||
Plugins.plugins.forEach { plugin ->
|
||||
if (plugin.tasks.size() > 0) {
|
||||
if (plugin.tasks.size > 0) {
|
||||
sb.append("\n ===== ${plugin.name} =====\n")
|
||||
plugin.tasks.forEach { task ->
|
||||
sb.append(" ${task.name}\t\t${task.doc}\n")
|
||||
|
|
|
@ -73,7 +73,7 @@ public class Plugins @Inject constructor (val taskManagerProvider : Provider<Tas
|
|||
}
|
||||
|
||||
public val plugins : List<Plugin>
|
||||
get() = ArrayList(pluginMap.values())
|
||||
get() = ArrayList(pluginMap.values)
|
||||
|
||||
/**
|
||||
* The list of plugins found in the build file.
|
||||
|
@ -157,7 +157,7 @@ public class Plugins @Inject constructor (val taskManagerProvider : Provider<Tas
|
|||
if (method.returnType != TaskResult::class.java) {
|
||||
throw IllegalArgumentException("${t}should return a TaskResult")
|
||||
}
|
||||
if (method.parameterTypes.size() != 1) {
|
||||
if (method.parameterTypes.size != 1) {
|
||||
throw IllegalArgumentException("${t}should take exactly one parameter of type a Project")
|
||||
}
|
||||
with(method.parameterTypes) {
|
||||
|
|
|
@ -24,7 +24,8 @@ public class ProjectGenerator {
|
|||
* Turns a dot property into a proper Kotlin identifier, e.g. common.version -> commonVersion
|
||||
*/
|
||||
fun translate(key: String): String {
|
||||
return key.split('.').mapIndexed( { index, value -> if (index == 0) value else value.upperFirst() }).join("")
|
||||
return key.split('.').mapIndexed( { index, value -> if (index == 0) value else value.upperFirst() })
|
||||
.joinToString("")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,12 +36,12 @@ public class ProjectGenerator {
|
|||
}
|
||||
|
||||
val compilerInfos = detect(File("."))
|
||||
if (compilerInfos.size() > 1) {
|
||||
if (compilerInfos.size > 1) {
|
||||
log(1, "Multi language project detected, not supported yet")
|
||||
}
|
||||
val map = hashMapOf<String, Any?>()
|
||||
map.put("directive", if (compilerInfos.isEmpty()) "project" else compilerInfos.get(0).directive)
|
||||
if (compilerInfos.size() > 0) {
|
||||
if (compilerInfos.size > 0) {
|
||||
compilerInfos.get(0).let {
|
||||
val currentDir = File(".").absoluteFile.parentFile
|
||||
with(map) {
|
||||
|
@ -83,15 +84,13 @@ public class ProjectGenerator {
|
|||
put("artifactId", pom.artifactId ?: "com.example")
|
||||
put("version", pom.version ?: "0.1")
|
||||
put("name", pom.name ?: pom.artifactId)
|
||||
put("repositories", pom.repositories.map({ "\"${it}\"" }).join(","))
|
||||
put("repositories", pom.repositories.map({ "\"${it}\"" }).joinToString(","))
|
||||
}
|
||||
|
||||
val properties = pom.properties
|
||||
val mapped = properties.entrySet().toMap({it.key}, {translate(it.key)})
|
||||
val mapped = properties.entries.toMap({it.key}, {translate(it.key)})
|
||||
|
||||
map.put("properties", properties
|
||||
.entrySet()
|
||||
.map({ Pair(mapped.get(it.key), it.value) }))
|
||||
map.put("properties", properties.entries.map({ Pair(mapped.get(it.key), it.value) }))
|
||||
|
||||
val partition = pom.dependencies.groupBy { it.scope }
|
||||
.flatMap { it.value }
|
||||
|
@ -105,7 +104,7 @@ public class ProjectGenerator {
|
|||
|
||||
private fun updateVersion(dep: Dependency, mapped: Map<String, String>) =
|
||||
if ( dep.version.startsWith("\${")) {
|
||||
val property = dep.version.substring(2, dep.version.length() - 1)
|
||||
val property = dep.version.substring(2, dep.version.length - 1)
|
||||
Dependency(dep.groupId, dep.artifactId, "\${${mapped.get(property)}}", dep.optional, dep.scope)
|
||||
} else {
|
||||
dep
|
||||
|
@ -119,11 +118,11 @@ public class ProjectGenerator {
|
|||
val result = arrayListOf<Pair<ICompilerInfo, List<File>>>()
|
||||
Kobalt.compilers.forEach {
|
||||
val managedFiles = it.findManagedFiles(dir)
|
||||
if (managedFiles.size() > 0) {
|
||||
if (managedFiles.size > 0) {
|
||||
result.add(Pair(it, managedFiles))
|
||||
}
|
||||
}
|
||||
Collections.sort(result, { p1, p2 -> p1.second.size().compareTo(p2.second.size()) })
|
||||
Collections.sort(result, { p1, p2 -> p1.second.size.compareTo(p2.second.size) })
|
||||
return result.map { it.first }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ public class Template(val reader: Reader, val writer: PrintWriter, val map: Map<
|
|||
BufferedReader(reader).let {
|
||||
it.forEachLine { line ->
|
||||
var replacedLine = line
|
||||
map.keySet().forEach { key ->
|
||||
replacedLine = replacedLine.replace("{{${key}}}", map.get(key).toString(), false)
|
||||
map.keys.forEach { key ->
|
||||
replacedLine = replacedLine.replace("{{$key}}", map.get(key).toString(), false)
|
||||
}
|
||||
writer.append(replacedLine).append("\n")
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class Kobalt {
|
|||
private fun readProperties(properties: Properties, ins: InputStream) {
|
||||
properties.load(ins)
|
||||
ins.close()
|
||||
properties.forEach { es -> System.setProperty(es.getKey().toString(), es.getValue().toString()) }
|
||||
properties.forEach { es -> System.setProperty(es.key.toString(), es.value.toString()) }
|
||||
}
|
||||
|
||||
val version = properties.getProperty(PROPERTY_KOBALT_VERSION)
|
||||
|
|
|
@ -45,7 +45,7 @@ public class DynamicGraphExecutor<T>(val graph: DynamicGraph<T>,
|
|||
*/
|
||||
public fun run() : Int {
|
||||
var lastResult = TaskResult()
|
||||
while (graph.freeNodes.size() > 0) {
|
||||
while (graph.freeNodes.size > 0) {
|
||||
log(3, "Current count: ${graph.nodeCount}")
|
||||
synchronized(graph) {
|
||||
val freeNodes = graph.freeNodes
|
||||
|
@ -53,10 +53,10 @@ public class DynamicGraphExecutor<T>(val graph: DynamicGraph<T>,
|
|||
log(3, "submitting free nodes $freeNodes")
|
||||
val callables : List<IWorker<T>> = factory.createWorkers(freeNodes)
|
||||
callables.forEach { completion.submit(it) }
|
||||
var n = callables.size()
|
||||
var n = callables.size
|
||||
|
||||
// When a callable ends, see if it freed a node. If not, keep looping
|
||||
while (n > 0 && graph.freeNodes.size() == 0) {
|
||||
while (n > 0 && graph.freeNodes.size == 0) {
|
||||
try {
|
||||
val future = completion.take()
|
||||
val taskResult = future.get(2, TimeUnit.SECONDS)
|
||||
|
@ -137,7 +137,7 @@ public class DynamicGraph<T> {
|
|||
// - no other nodes depend on it
|
||||
if (! dependedUpon.containsKey(m)) {
|
||||
result.add(m)
|
||||
} else if (getUnfinishedNodes(du).size() == 0) {
|
||||
} else if (getUnfinishedNodes(du).size == 0) {
|
||||
result.add(m)
|
||||
}
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ public class DynamicGraph<T> {
|
|||
* @return the number of nodes in this graph.
|
||||
*/
|
||||
public val nodeCount: Int
|
||||
get() = nodesReady.size() + nodesRunning.size() + nodesFinished.size()
|
||||
get() = nodesReady.size + nodesRunning.size + nodesFinished.size
|
||||
|
||||
override public fun toString() : String {
|
||||
val result = StringBuilder("[DynamicGraph ")
|
||||
|
|
|
@ -28,14 +28,14 @@ abstract class GenericTestRunner(open val project: Project, open val classpath:
|
|||
val allArgs = arrayListOf<String>()
|
||||
allArgs.add(java!!.absolutePath)
|
||||
allArgs.add("-classpath")
|
||||
allArgs.add(classpath.map { it.jarFile.get().absolutePath }.join(File.pathSeparator))
|
||||
allArgs.add(classpath.map { it.jarFile.get().absolutePath }.joinToString(File.pathSeparator))
|
||||
allArgs.add(mainClass)
|
||||
allArgs.addAll(args)
|
||||
|
||||
val pb = ProcessBuilder(allArgs)
|
||||
pb.directory(File(project.directory))
|
||||
pb.inheritIO()
|
||||
log(1, "Running tests with classpath size ${classpath.size()}")
|
||||
log(1, "Running tests with classpath size ${classpath.size}")
|
||||
val process = pb.start()
|
||||
val errorCode = process.waitFor()
|
||||
if (errorCode == 0) {
|
||||
|
|
|
@ -99,7 +99,7 @@ abstract public class JvmCompilerPlugin @Inject constructor(
|
|||
throw IllegalArgumentException("Custom source sets not supported yet: ${sourceSet}")
|
||||
}
|
||||
|
||||
if (sourceDirs.size() > 0) {
|
||||
if (sourceDirs.size > 0) {
|
||||
lp(project, "Copying ${sourceSet} resources")
|
||||
val absOutputDir = File(KFiles.joinDir(project.directory, project.buildDirectory!!, outputDir))
|
||||
sourceDirs.map { File(it) }.filter { it.exists() } .forEach {
|
||||
|
|
|
@ -79,7 +79,7 @@ public class TaskManager @Inject constructor(val plugins: Plugins, val args: Arg
|
|||
val currentFreeTask = allFreeTasks.filter {
|
||||
TaskInfo(projectName, it.name).id == target
|
||||
}
|
||||
if (currentFreeTask.size() == 1) {
|
||||
if (currentFreeTask.size == 1) {
|
||||
currentFreeTask.get(0).let {
|
||||
val thisTaskInfo = TaskInfo(projectName, it.name)
|
||||
graph.addNode(it)
|
||||
|
@ -150,13 +150,13 @@ public class TaskManager @Inject constructor(val plugins: Plugins, val args: Arg
|
|||
private fun calculateFreeTasks(tasksByNames: Map<String, PluginTask>, reverseAfter: HashMap<String, String>)
|
||||
: Collection<PluginTask> {
|
||||
val freeTaskMap = hashMapOf<String, PluginTask>()
|
||||
tasksByNames.keySet().forEach {
|
||||
tasksByNames.keys.forEach {
|
||||
if (! runBefore.containsKey(it) && ! reverseAfter.containsKey(it)) {
|
||||
freeTaskMap.put(it, tasksByNames.get(it)!!)
|
||||
}
|
||||
}
|
||||
|
||||
return freeTaskMap.values()
|
||||
return freeTaskMap.values
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,7 +172,7 @@ public class TaskManager @Inject constructor(val plugins: Plugins, val args: Arg
|
|||
var done = false
|
||||
while (! done) {
|
||||
val newToProcess = hashSetOf<TaskInfo>()
|
||||
log(3, "toProcess size: " + toProcess.size())
|
||||
log(3, "toProcess size: " + toProcess.size)
|
||||
toProcess.forEach { target ->
|
||||
|
||||
val currentTask = TaskInfo(project.name!!, target.task)
|
||||
|
@ -209,7 +209,7 @@ class TaskWorker(val tasks: List<PluginTask>, val dryRun: Boolean) : IWorker<Plu
|
|||
// }
|
||||
|
||||
override fun call() : TaskResult2<PluginTask> {
|
||||
if (tasks.size() > 0) {
|
||||
if (tasks.size > 0) {
|
||||
tasks.get(0).let {
|
||||
log(1, "========== ${it.project.name}:${it.name}")
|
||||
}
|
||||
|
|
|
@ -12,12 +12,12 @@ public class TestNgRunner(override val project: Project, override val classpath:
|
|||
override val args: List<String>
|
||||
get() {
|
||||
arrayListOf<String>().let {
|
||||
if (project.testArgs.size() > 0) {
|
||||
if (project.testArgs.size > 0) {
|
||||
it.addAll(project.testArgs)
|
||||
} else {
|
||||
val testngXml = File(project.directory, KFiles.joinDir("src", "test", "resources", "testng.xml"))
|
||||
if (testngXml.exists()) {
|
||||
it.add(testngXml.getAbsolutePath())
|
||||
it.add(testngXml.absolutePath)
|
||||
} else {
|
||||
it.add("-testclass")
|
||||
it.addAll(findTestClasses())
|
||||
|
|
|
@ -28,7 +28,7 @@ class GetDependenciesCommand @Inject constructor(val executors: KobaltExecutors,
|
|||
val buildFile = BuildFile(Paths.get(received.get("buildFile").asString), "GetDependenciesCommand")
|
||||
val scriptCompiler = buildFileCompilerFactory.create(listOf(buildFile))
|
||||
scriptCompiler.observable.subscribe {
|
||||
buildScriptInfo -> if (buildScriptInfo.projects.size() > 0) {
|
||||
buildScriptInfo -> if (buildScriptInfo.projects.size > 0) {
|
||||
sender.sendData(toData(buildScriptInfo))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class KobaltClient @Inject constructor() : Runnable {
|
|||
} else {
|
||||
val data = jo.get("data").asString
|
||||
val dd = Gson().fromJson(data, GetDependenciesCommand.GetDependenciesData::class.java)
|
||||
println("Read GetDependencyData, project count: ${dd.projects.size()}")
|
||||
println("Read GetDependencyData, project count: ${dd.projects.size}")
|
||||
line = ins.readLine()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class KobaltServer @Inject constructor(val args: Args) : Runnable, IComma
|
|||
while (! quit) {
|
||||
val clientSocket = serverSocket.accept()
|
||||
outgoing = PrintWriter(clientSocket.outputStream, true)
|
||||
if (pending.size() > 0) {
|
||||
if (pending.size > 0) {
|
||||
log(1, "Emptying the queue, size $pending.size()")
|
||||
synchronized(pending) {
|
||||
pending.forEach { sendData(it) }
|
||||
|
|
|
@ -122,7 +122,7 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
|
|||
// will add all the dynamic plugins found in this code to Plugins.dynamicPlugins
|
||||
//
|
||||
val pluginSourceFile = KFiles.createTempFile(".kt")
|
||||
pluginSourceFile.writeText(pluginCode.join("\n"), Charset.defaultCharset())
|
||||
pluginSourceFile.writeText(pluginCode.joinToString("\n"), Charset.defaultCharset())
|
||||
log(2, "Saved ${pluginSourceFile.absolutePath}")
|
||||
|
||||
//
|
||||
|
@ -180,7 +180,7 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
|
|||
while (entry != null) {
|
||||
val name = entry.name;
|
||||
if (name.endsWith(".class")) {
|
||||
val className = name.substring(0, name.length() - 6).replace("/", ".")
|
||||
val className = name.substring(0, name.length - 6).replace("/", ".")
|
||||
var cl : Class<*>? = classLoader.loadClass(className)
|
||||
if (cl != null) {
|
||||
classes.add(cl)
|
||||
|
|
|
@ -16,7 +16,7 @@ public class DepFactory @Inject constructor(val localRepo: LocalRepo,
|
|||
public fun create(id: String, executor: ExecutorService,
|
||||
localFirst : Boolean = true) : IClasspathDependency {
|
||||
if (id.startsWith(IClasspathDependency.PREFIX_FILE)) {
|
||||
return FileDependency(id.substring(IClasspathDependency.PREFIX_FILE.length()))
|
||||
return FileDependency(id.substring(IClasspathDependency.PREFIX_FILE.length))
|
||||
} else {
|
||||
val c = id.split(":")
|
||||
var repoResult: RepoFinder.RepoResult?
|
||||
|
|
|
@ -47,7 +47,7 @@ public class Gpg {
|
|||
|
||||
val pb = ProcessBuilder(allArgs)
|
||||
pb.directory(directory)
|
||||
log(2, "Signing file: " + allArgs.join(" "))
|
||||
log(2, "Signing file: " + allArgs.joinToString(" "))
|
||||
val process = pb.start()
|
||||
|
||||
val br = BufferedReader(InputStreamReader(process.errorStream))
|
||||
|
|
|
@ -29,7 +29,7 @@ public class Http {
|
|||
val response = client.newCall(request.build()).execute()
|
||||
return Body(response.body(), response.code())
|
||||
} catch(ex: IOException) {
|
||||
throw KobaltException("Could not load URL ${url}, error: " + ex.getMessage(), ex)
|
||||
throw KobaltException("Could not load URL ${url}, error: " + ex.message, ex)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ open public class LocalRepo(open val localRepo: String = KFiles.localRepo) {
|
|||
|
||||
if (files != null) {
|
||||
val directories = files.filter { it.isDirectory }
|
||||
if (directories.size() > 0) {
|
||||
if (directories.size > 0) {
|
||||
Collections.sort(directories, { f1, f2 ->
|
||||
val v1 = Versions.toLongVersion(f1.name)
|
||||
val v2 = Versions.toLongVersion(f2.name)
|
||||
|
|
|
@ -63,7 +63,7 @@ public class MavenDependency @Inject constructor(override @Assisted("groupId") v
|
|||
|
||||
fun hasVersion(id: String) : Boolean {
|
||||
val c = id.split(":")
|
||||
return c.size() == 3 && !Strings.isEmpty(c[2])
|
||||
return c.size == 3 && !Strings.isEmpty(c[2])
|
||||
}
|
||||
|
||||
fun toId(g: String, a: String, v: String) = "$g:$a:$v"
|
||||
|
|
|
@ -39,13 +39,13 @@ public class RepoFinder @Inject constructor(val http: Http, val executors: Kobal
|
|||
* Schedule an HTTP request to each repo in its own thread.
|
||||
*/
|
||||
private fun loadCorrectRepo(id: String): RepoResult {
|
||||
val executor = executors.newExecutor("RepoFinder-${id}", Kobalt.repos.size())
|
||||
val executor = executors.newExecutor("RepoFinder-${id}", Kobalt.repos.size)
|
||||
val cs = ExecutorCompletionService<RepoResult>(executor)
|
||||
|
||||
try {
|
||||
log(2, "Looking for $id")
|
||||
Kobalt.repos.forEach { cs.submit(RepoFinderCallable(id, it)) }
|
||||
for (i in 0..Kobalt.repos.size() - 1) {
|
||||
for (i in 0..Kobalt.repos.size - 1) {
|
||||
try {
|
||||
val result = cs.take().get(2000, TimeUnit.MILLISECONDS)
|
||||
log(2, "Result for repo #${i}: ${result}")
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CheckVersions @Inject constructor(val depFactory : DepFactory,
|
|||
}
|
||||
}
|
||||
|
||||
if (newVersions.size() > 0) {
|
||||
if (newVersions.size > 0) {
|
||||
log(1, "New versions found:")
|
||||
newVersions.forEach { log(1, " ${it}") }
|
||||
} else {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package com.beust.kobalt.misc
|
||||
|
||||
import com.beust.klaxon.JsonArray
|
||||
import com.beust.klaxon.JsonObject
|
||||
import com.beust.klaxon.Parser
|
||||
import com.beust.klaxon.string
|
||||
import com.google.gson.JsonArray
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.JsonParser
|
||||
import com.google.inject.Inject
|
||||
import java.io.BufferedReader
|
||||
import java.io.IOException
|
||||
import java.io.InputStreamReader
|
||||
import java.net.URL
|
||||
import java.util.concurrent.Callable
|
||||
import java.util.concurrent.Future
|
||||
|
@ -26,11 +27,13 @@ public class GithubApi @Inject constructor(val executors: KobaltExecutors) {
|
|||
try {
|
||||
val ins = URL(url).openConnection().inputStream
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val jo = Parser().parse(ins) as JsonArray<JsonObject>
|
||||
val reader = BufferedReader(InputStreamReader(ins))
|
||||
val jo = JsonParser().parse(reader) as JsonArray
|
||||
// val jo = Parser().parse(ins) as JsonArray<JsonObject>
|
||||
if (jo.size() > 0) {
|
||||
var versionName = jo.get(0).string("name")
|
||||
var versionName = (jo.get(0) as JsonObject).get("name").asString
|
||||
if (versionName == null) {
|
||||
versionName = jo.get(0).string("tag_name")
|
||||
versionName = (jo.get(0) as JsonObject).get("tag_name").asString
|
||||
}
|
||||
if (versionName != null) {
|
||||
result = versionName
|
||||
|
|
|
@ -55,7 +55,7 @@ public class KFiles {
|
|||
|
||||
public val TEST_CLASSES_DIR : String = "test-classes"
|
||||
|
||||
public fun joinDir(vararg ts: String): String = ts.toArrayList().join(File.separator)
|
||||
public fun joinDir(vararg ts: String): String = ts.toArrayList().joinToString(File.separator)
|
||||
|
||||
public fun makeDir(dir: String, s: String) : File {
|
||||
val result = File(dir, s)
|
||||
|
@ -85,7 +85,7 @@ public class KFiles {
|
|||
}
|
||||
}
|
||||
// Return files relative to rootDir
|
||||
val r = result.map { it.substring(rootDir.absolutePath.length() + 1)}
|
||||
val r = result.map { it.substring(rootDir.absolutePath.length + 1)}
|
||||
return r
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class KFiles {
|
|||
Files.copy(from, to, option)
|
||||
} catch(ex: IOException) {
|
||||
// Windows is anal about this
|
||||
log(1, "Couldn't copy $from to $to: ${ex.getMessage()}")
|
||||
log(1, "Couldn't copy $from to $to: ${ex.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,13 @@ class KobaltExecutor(name: String, threadCount: Int)
|
|||
} catch (ce: CancellationException) {
|
||||
ex = ce;
|
||||
} catch (ee: ExecutionException) {
|
||||
ex = ee.getCause();
|
||||
ex = ee.cause;
|
||||
} catch (ie: InterruptedException) {
|
||||
Thread.currentThread().interrupt(); // ignore/reset
|
||||
}
|
||||
}
|
||||
if (ex != null) {
|
||||
error(if (ex.getMessage() != null) ex.getMessage()!! else ex.javaClass.toString())
|
||||
error(if (ex.message != null) ex.message!! else ex.javaClass.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class KobaltExecutors {
|
|||
|
||||
var remainingMs = maxMs
|
||||
var i = 0
|
||||
while (i < tasks.size() && remainingMs >= 0) {
|
||||
while (i < tasks.size && remainingMs >= 0) {
|
||||
var start = System.currentTimeMillis()
|
||||
val r = cs.take().get(remainingMs, TimeUnit.MILLISECONDS)
|
||||
progress(r)
|
||||
|
@ -72,7 +72,7 @@ public class KobaltExecutors {
|
|||
}
|
||||
|
||||
if (remainingMs < 0) {
|
||||
warn("Didn't receive all the results in time: $i / ${tasks.size()}")
|
||||
warn("Didn't receive all the results in time: $i / ${tasks.size}")
|
||||
} else {
|
||||
log(2, "Received all results in ${maxMs - remainingMs} ms")
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class Logger(val dev: Boolean) {
|
|||
|
||||
final fun error(tag: String, message: String, e: Throwable? = null) =
|
||||
println(getPattern("***** E", "***** ERROR ", tag, message) +
|
||||
if (e != null) " Exception: " + e.getMessage() else "")
|
||||
if (e != null) " Exception: " + e.message else "")
|
||||
|
||||
final fun warn(tag: String, message: String, e: Throwable? = null) =
|
||||
println(getPattern("W", "***** WARNING ", tag, message))
|
||||
|
|
|
@ -26,6 +26,6 @@ public class Strings {
|
|||
/**
|
||||
* @Return the number of times the given character occurs in the string
|
||||
*/
|
||||
public fun String.countChar(c: Char) : Int {
|
||||
public infix fun String.countChar(c: Char) : Int {
|
||||
return CharMatcher.`is`(c).countIn(this)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ public class ToString<T>(val name: String, vararg o: T) {
|
|||
val sb = StringBuffer()
|
||||
|
||||
init {
|
||||
for (i in 0..o.size() - 1 step 2) {
|
||||
for (i in 0..o.size - 1 step 2) {
|
||||
if (i > 0) sb.append(", ")
|
||||
sb.append(o.get(i).toString() + ":" + o.get(i + 1))
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class Topological<T> {
|
|||
val result = arrayListOf<T>()
|
||||
var dependMap = HashMultimap.create<T, T>()
|
||||
dependingOn.keySet().forEach { dependMap.putAll(it, dependingOn.get(it))}
|
||||
while (all.size() > 0) {
|
||||
while (all.size > 0) {
|
||||
val freeNodes = all.filter {
|
||||
dependMap.get(it).isEmpty()
|
||||
}
|
||||
|
|
|
@ -50,11 +50,11 @@ public class JavaPlugin @Inject constructor(
|
|||
val args = arrayListOf(
|
||||
javac!!.absolutePath,
|
||||
"-d", outputDirectory.absolutePath)
|
||||
if (cpList.size() > 0) {
|
||||
if (cpList.size > 0) {
|
||||
val stringClasspath = cpList.map { it.jarFile.get().absolutePath }
|
||||
validateClasspath(stringClasspath)
|
||||
args.add("-classpath")
|
||||
args.add(stringClasspath.join(File.pathSeparator))
|
||||
args.add(stringClasspath.joinToString(File.pathSeparator))
|
||||
}
|
||||
args.addAll(sourceFiles)
|
||||
|
||||
|
@ -64,8 +64,8 @@ public class JavaPlugin @Inject constructor(
|
|||
// pb.redirectErrorStream(true)
|
||||
// pb.redirectError(File("/tmp/kobalt-err"))
|
||||
// pb.redirectOutput(File("/tmp/kobalt-out"))
|
||||
val line = args.join(" ")
|
||||
log(1, " Compiling ${sourceFiles.size()} files with classpath size ${cpList.size()}")
|
||||
val line = args.joinToString(" ")
|
||||
log(1, " Compiling ${sourceFiles.size} files with classpath size ${cpList.size}")
|
||||
log(2, " Compiling $project:\n$line")
|
||||
val process = pb.start()
|
||||
val errorCode = process.waitFor()
|
||||
|
@ -89,7 +89,7 @@ public class JavaPlugin @Inject constructor(
|
|||
val classpath = calculateClasspath(project.compileDependencies)
|
||||
val args = arrayListOf(
|
||||
javadoc!!.absolutePath,
|
||||
"-classpath", classpath.map { it.jarFile.get().absolutePath }.join(File.pathSeparator),
|
||||
"-classpath", classpath.map { it.jarFile.get().absolutePath }.joinToString(File.pathSeparator),
|
||||
"-d", outputDir.absolutePath)
|
||||
args.addAll(sourceFiles)
|
||||
|
||||
|
@ -127,7 +127,7 @@ public class JavaPlugin @Inject constructor(
|
|||
.map { File(projectDir, it).absolutePath }
|
||||
|
||||
val result =
|
||||
if (absoluteSourceFiles.size() > 0) {
|
||||
if (absoluteSourceFiles.size > 0) {
|
||||
compilePrivate(project,
|
||||
testDependencies(project),
|
||||
absoluteSourceFiles,
|
||||
|
|
|
@ -24,7 +24,7 @@ class KotlinCompiler @Inject constructor(override val localRepo : LocalRepo,
|
|||
override val dependencyManager: DependencyManager,
|
||||
override val executors: KobaltExecutors)
|
||||
: JvmCompilerPlugin(localRepo, files, depFactory, dependencyManager, executors) {
|
||||
private val KOTLIN_VERSION = "0.14.449"
|
||||
private val KOTLIN_VERSION = "1.0.0-beta-1038"
|
||||
|
||||
override val name = "kotlin"
|
||||
|
||||
|
@ -52,10 +52,10 @@ class KotlinCompiler @Inject constructor(override val localRepo : LocalRepo,
|
|||
|
||||
validateClasspath(classpathList)
|
||||
|
||||
log(2, "Compiling ${source.size()} files with classpath:\n " + classpathList.join("\n "))
|
||||
log(2, "Compiling ${source.size} files with classpath:\n " + classpathList.joinToString("\n "))
|
||||
CLICompiler.doMainNoExit(K2JVMCompiler(), arrayOf(
|
||||
"-d", output,
|
||||
"-classpath", classpathList.join(File.pathSeparator), *source.toTypedArray(),
|
||||
"-classpath", classpathList.joinToString(File.pathSeparator), *source.toTypedArray(),
|
||||
*args.toTypedArray()))
|
||||
executor.shutdown()
|
||||
return TaskResult()
|
||||
|
|
|
@ -53,7 +53,7 @@ public class KotlinPlugin @Inject constructor(
|
|||
File(projectDirectory, it).absolutePath
|
||||
}
|
||||
|
||||
compilePrivate(classpath, absoluteSourceFiles, buildDirectory.getAbsolutePath())
|
||||
compilePrivate(classpath, absoluteSourceFiles, buildDirectory.absolutePath)
|
||||
lp(project, "Compilation succeeded")
|
||||
return TaskResult()
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class KotlinPlugin @Inject constructor(
|
|||
outputDirectory: String): TaskResult {
|
||||
File(outputDirectory).mkdirs()
|
||||
|
||||
log(1, " Compiling ${sources.size()} files with classpath size ${cpList.size()}")
|
||||
log(1, " Compiling ${sources.size} files with classpath size ${cpList.size}")
|
||||
|
||||
return kotlinCompilePrivate {
|
||||
classpath(cpList.map { it.jarFile.get().absolutePath })
|
||||
|
|
|
@ -57,7 +57,7 @@ public class JarUtils {
|
|||
|
||||
val defaultHandler: (Exception) -> Unit = { ex: Exception ->
|
||||
// Ignore duplicate entry exceptions
|
||||
if (! ex.getMessage()?.contains("duplicate")!!) {
|
||||
if (! ex.message?.contains("duplicate")!!) {
|
||||
throw ex
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class PackagingPlugin @Inject constructor(val dependencyManager : Depende
|
|||
ex.add(FileSystems.getDefault().getPathMatcher("glob:${it.spec}"))
|
||||
}
|
||||
ex.forEach {
|
||||
if (it.matches(Paths.get(file.getName()))) {
|
||||
if (it.matches(Paths.get(file.name))) {
|
||||
log(2, "Excluding ${file}")
|
||||
return true
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class PackagingPlugin @Inject constructor(val dependencyManager : Depende
|
|||
val filesNotExcluded : List<File> = files.filter { ! isExcluded(it, jar.excludes) }
|
||||
val fileSpecs = arrayListOf<IFileSpec>()
|
||||
filesNotExcluded.forEach {
|
||||
fileSpecs.add(FileSpec(it.path.toString().substring(prefixPath.toString().length() + 1)))
|
||||
fileSpecs.add(FileSpec(it.path.toString().substring(prefixPath.toString().length + 1)))
|
||||
}
|
||||
allFiles.add(IncludedFile(From(prefixPath.toString() + "/"), To(""), fileSpecs))
|
||||
} else {
|
||||
|
@ -189,7 +189,7 @@ public class PackagingPlugin @Inject constructor(val dependencyManager : Depende
|
|||
warn("Directory ${fromPath} doesn't exist, not including it in the jar")
|
||||
}
|
||||
}
|
||||
if (includedSpecs.size() > 0) {
|
||||
if (includedSpecs.size > 0) {
|
||||
log(3, "Including specs ${includedSpecs}")
|
||||
result.add(IncludedFile(From(includedFile.from), To(includedFile.to), includedSpecs))
|
||||
}
|
||||
|
@ -210,12 +210,12 @@ public class PackagingPlugin @Inject constructor(val dependencyManager : Depende
|
|||
outputStreamFactory: (OutputStream) -> ZipOutputStream = DEFAULT_STREAM_FACTORY) : File {
|
||||
val buildDir = KFiles.makeDir(project.directory, project.buildDirectory!!)
|
||||
val archiveDir = KFiles.makeDir(buildDir.path, "libs")
|
||||
val fullArchiveName = archiveName ?: arrayListOf(project.name!!, project.version!!).join("-") + suffix
|
||||
val fullArchiveName = archiveName ?: arrayListOf(project.name!!, project.version!!).joinToString("-") + suffix
|
||||
val result = File(archiveDir.path, fullArchiveName)
|
||||
val outStream = outputStreamFactory(FileOutputStream(result))
|
||||
log(2, "Creating ${result}")
|
||||
JarUtils.addFiles(project.directory, includedFiles, outStream, expandJarFiles)
|
||||
log(2, "Added ${includedFiles.size()} files to ${result}")
|
||||
log(2, "Added ${includedFiles.size} files to ${result}")
|
||||
outStream.flush()
|
||||
outStream.close()
|
||||
log(1, " Created ${result}")
|
||||
|
@ -360,7 +360,7 @@ class IncludedFile(val fromOriginal: From, val toOriginal: To, val specs: List<I
|
|||
public val from: String get() = fromOriginal.path.replace("\\", "/")
|
||||
public val to: String get() = toOriginal.path.replace("\\", "/")
|
||||
override public fun toString() = ToString("IncludedFile",
|
||||
"files", specs.map { it.toString() }.join(", "),
|
||||
"files", specs.map { it.toString() }.joinToString(", "),
|
||||
"from", from,
|
||||
"to", to)
|
||||
.s
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.beust.kobalt.plugin.publish
|
||||
|
||||
import com.beust.klaxon.*
|
||||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.internal.TaskResult
|
||||
import com.beust.kobalt.maven.Gpg
|
||||
|
@ -8,6 +7,9 @@ import com.beust.kobalt.maven.Http
|
|||
import com.beust.kobalt.maven.KobaltException
|
||||
import com.beust.kobalt.maven.Md5
|
||||
import com.beust.kobalt.misc.*
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.JsonParser
|
||||
import com.google.inject.assistedinject.Assisted
|
||||
import com.squareup.okhttp.Response
|
||||
import org.jetbrains.annotations.Nullable
|
||||
|
@ -17,8 +19,8 @@ import java.nio.charset.Charset
|
|||
import javax.inject.Inject
|
||||
|
||||
data class JCenterPackage(val jo: JsonObject) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val latestPublishedVersion = (jo.get("versions") as JsonArray<String>).get(0)
|
||||
// @Suppress("UNCHECKED_CAST")
|
||||
// val latestPublishedVersion = (jo.get("versions") as JsonArray).get(0) as JsonObject).
|
||||
}
|
||||
|
||||
open public class UnauthenticatedJCenterApi @Inject constructor(open val http: Http){
|
||||
|
@ -28,11 +30,12 @@ open public class UnauthenticatedJCenterApi @Inject constructor(open val http: H
|
|||
}
|
||||
|
||||
fun parseResponse(response: String) : JsonObject {
|
||||
return Parser().parse(ByteArrayInputStream(response.toByteArray(Charset.defaultCharset()))) as JsonObject
|
||||
return JsonParser().parse(response).asJsonObject
|
||||
// return Parser().parse(ByteArrayInputStream(response.toByteArray(Charset.defaultCharset()))) as JsonObject
|
||||
}
|
||||
|
||||
fun getPackage(name: String) : JCenterPackage {
|
||||
val url = arrayListOf(BINTRAY_URL_API, "packages", "cbeust", "maven", "kobalt").join("/")
|
||||
val url = arrayListOf(BINTRAY_URL_API, "packages", "cbeust", "maven", "kobalt").joinToString("/")
|
||||
val response = http.get(url).getAsString()
|
||||
val result = parseResponse(response)
|
||||
return JCenterPackage(result)
|
||||
|
@ -53,21 +56,20 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
|||
|
||||
fun packageExists(packageName: String) : Boolean {
|
||||
val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", username!!, "maven", packageName)
|
||||
.join("/")
|
||||
.joinToString("/")
|
||||
val response = http.get(username, password, url).getAsString()
|
||||
val jo = parseResponse(response)
|
||||
|
||||
return jo.string("name") == packageName
|
||||
return jo.get("name").asString == packageName
|
||||
}
|
||||
|
||||
fun createPackage(packageName: String) : String {
|
||||
val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", username!!, "maven").join("/")
|
||||
val jo = json {
|
||||
obj("name" to packageName)
|
||||
obj("license" to array("Apache 2.0"))
|
||||
}
|
||||
return http.post(username, password, url, jo.toJsonString())
|
||||
}
|
||||
// class ForPost(val name: String, val license: Array<String>)
|
||||
//
|
||||
// fun createPackage(packageName: String) : String {
|
||||
// val url = arrayListOf(UnauthenticatedJCenterApi.BINTRAY_URL_API, "packages", username!!, "maven").join("/")
|
||||
// val jsonString = Gson().toJson(ForPost(packageName, arrayOf("Apache 2.0")))
|
||||
// return http.post(username, password, url, jsonString)
|
||||
// }
|
||||
|
||||
fun uploadMaven(project: Project, files: List<File>, configuration : JCenterConfiguration?) : TaskResult {
|
||||
if (! packageExists(project.name!!)) {
|
||||
|
@ -86,7 +88,7 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
|||
project.artifactId!!,
|
||||
project.version!!,
|
||||
f.name)
|
||||
.join("/")
|
||||
.joinToString("/")
|
||||
}
|
||||
|
||||
return upload(files, configuration, fileToPath, generateMd5 = true, generateAsc = true)
|
||||
|
@ -126,14 +128,14 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
|||
if (configuration?.publish == true) options.add("publish=1")
|
||||
|
||||
val optionPath = StringBuffer()
|
||||
if (options.size() > 0) {
|
||||
optionPath.append("?" + options.join("&"))
|
||||
if (options.size > 0) {
|
||||
optionPath.append("?" + options.joinToString("&"))
|
||||
}
|
||||
|
||||
//
|
||||
// Uploads can'be done in parallel or JCenter rejects them
|
||||
//
|
||||
val fileCount = filesToUpload.size()
|
||||
val fileCount = filesToUpload.size
|
||||
if (fileCount > 0) {
|
||||
log(1, " Found $fileCount artifacts to upload: " + filesToUpload.get(0)
|
||||
+ if (fileCount > 1) "..." else "")
|
||||
|
@ -142,8 +144,8 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
|||
|
||||
|
||||
fun dots(total: Int, list: List<Boolean>) : String {
|
||||
val spaces : String = Array(total - list.size(), { " " }).join("")
|
||||
return "|" + list.map { if (it) "." else "X" }.join("") + spaces + "|"
|
||||
val spaces : String = Array(total - list.size, { " " }).joinToString("")
|
||||
return "|" + list.map { if (it) "." else "X" }.joinToString("") + spaces + "|"
|
||||
}
|
||||
|
||||
val results = arrayListOf<Boolean>()
|
||||
|
@ -153,7 +155,7 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
|||
{ r: Response ->
|
||||
results.add(false)
|
||||
val jo = parseResponse(r.body().string())
|
||||
errorMessages.add(jo.string("message") ?: "No message found")
|
||||
errorMessages.add(jo.get("message").asString ?: "No message found")
|
||||
})
|
||||
val end = if (i >= fileCount) "\n" else ""
|
||||
log(1, " Uploading " + (i++) + " / $fileCount " + dots(fileCount, results) + end, false)
|
||||
|
@ -161,8 +163,8 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
|
|||
if (errorMessages.isEmpty()) {
|
||||
return TaskResult()
|
||||
} else {
|
||||
error("Errors while uploading:\n" + errorMessages.map { " $it" }.join("\n"))
|
||||
return TaskResult(false, errorMessages.join("\n"))
|
||||
error("Errors while uploading:\n" + errorMessages.map { " $it" }.joinToString("\n"))
|
||||
return TaskResult(false, errorMessages.joinToString("\n"))
|
||||
}
|
||||
} else {
|
||||
warn("Found no artifacts to upload")
|
||||
|
|
|
@ -67,7 +67,7 @@ public class PublishPlugin @Inject constructor(val http: Http, val files: com.be
|
|||
|
||||
val jcenter = jcenterFactory.create(user, password)
|
||||
|
||||
val configuration = configurations.get(project.name)
|
||||
val configuration = configurations.getRaw(project.name)
|
||||
|
||||
//
|
||||
// Upload to Maven
|
||||
|
@ -89,7 +89,7 @@ public class PublishPlugin @Inject constructor(val http: Http, val files: com.be
|
|||
}
|
||||
}
|
||||
}
|
||||
return TaskResult(success, messages.join("\n "))
|
||||
return TaskResult(success, messages.joinToString("\n "))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Wrapper {
|
|||
private fun readProperties(properties: Properties, ins: InputStream) {
|
||||
properties.load(ins)
|
||||
ins.close()
|
||||
properties.forEach { es -> System.setProperty(es.getKey().toString(), es.getValue().toString()) }
|
||||
properties.forEach { es -> System.setProperty(es.key.toString(), es.value.toString()) }
|
||||
}
|
||||
|
||||
private fun maybeCreateProperties() : Properties {
|
||||
|
@ -169,7 +169,7 @@ public class Wrapper {
|
|||
args.addAll(argv)
|
||||
val pb = ProcessBuilder(args)
|
||||
pb.inheritIO()
|
||||
log(2, "Launching\n ${args.join(" ")}")
|
||||
log(2, "Launching\n ${args.joinToString(" ")}")
|
||||
val process = pb.start()
|
||||
process.waitFor()
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
kobalt.version=0.195
|
||||
kobalt.version=0.198
|
Loading…
Add table
Add a link
Reference in a new issue