mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 08:38:13 -07:00
Warnings.
This commit is contained in:
parent
d842e5aa74
commit
6094528f32
5 changed files with 13 additions and 24 deletions
|
@ -1,22 +1,17 @@
|
||||||
package com.beust.kobalt.internal.remote
|
package com.beust.kobalt.internal.remote
|
||||||
|
|
||||||
import com.beust.kobalt.Args
|
|
||||||
import com.beust.kobalt.SystemProperties
|
import com.beust.kobalt.SystemProperties
|
||||||
import com.beust.kobalt.kotlin.BuildFileCompiler
|
|
||||||
import com.beust.kobalt.mainNoExit
|
|
||||||
import com.beust.kobalt.misc.log
|
import com.beust.kobalt.misc.log
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import com.google.gson.JsonParser
|
import com.google.gson.JsonParser
|
||||||
import javax.inject.Inject
|
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.BufferedWriter
|
|
||||||
import java.io.InputStreamReader
|
import java.io.InputStreamReader
|
||||||
import java.io.PrintWriter
|
import java.io.PrintWriter
|
||||||
import java.net.ConnectException
|
import java.net.ConnectException
|
||||||
import java.net.Socket
|
import java.net.Socket
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
import java.util.concurrent.Executors
|
import javax.inject.Inject
|
||||||
|
|
||||||
public class KobaltClient @Inject constructor() : Runnable {
|
public class KobaltClient @Inject constructor() : Runnable {
|
||||||
var outgoing: PrintWriter? = null
|
var outgoing: PrintWriter? = null
|
||||||
|
@ -32,8 +27,6 @@ public class KobaltClient @Inject constructor() : Runnable {
|
||||||
outgoing = PrintWriter(socket.outputStream, true)
|
outgoing = PrintWriter(socket.outputStream, true)
|
||||||
val testBuildfile = Paths.get(SystemProperties.homeDir, "java", "testng", "Build.kt")
|
val testBuildfile = Paths.get(SystemProperties.homeDir, "java", "testng", "Build.kt")
|
||||||
.toFile().absolutePath
|
.toFile().absolutePath
|
||||||
val testBuildfile2 = Paths.get(SystemProperties.homeDir, "java", "jcommander", "Build.kt")
|
|
||||||
.toFile().absolutePath
|
|
||||||
val c : String = "{ \"name\":\"GetDependencies\", \"buildFile\": \"$testBuildfile\"}"
|
val c : String = "{ \"name\":\"GetDependencies\", \"buildFile\": \"$testBuildfile\"}"
|
||||||
outgoing!!.println(c)
|
outgoing!!.println(c)
|
||||||
val ins = BufferedReader(InputStreamReader(socket.inputStream))
|
val ins = BufferedReader(InputStreamReader(socket.inputStream))
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Logger(val dev: Boolean) {
|
||||||
|
|
||||||
|
|
||||||
final fun warn(tag: String, message: String, e: Throwable? = null) =
|
final fun warn(tag: String, message: String, e: Throwable? = null) =
|
||||||
println(getPattern("W", "***** WARNING ", tag, message))
|
println(getPattern("W", "***** WARNING ${e?.message}", tag, message))
|
||||||
|
|
||||||
final fun log(tag: String, message: String, newLine: Boolean) =
|
final fun log(tag: String, message: String, newLine: Boolean) =
|
||||||
with(getPattern("L", "", tag, message)) {
|
with(getPattern("L", "", tag, message)) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler) :
|
||||||
val version = configurations[project.name!!]?.buildToolsVersion
|
val version = configurations[project.name!!]?.buildToolsVersion
|
||||||
if (OperatingSystem.current().isWindows()) {
|
if (OperatingSystem.current().isWindows()) {
|
||||||
if (version == "22.0.1" || version == "23.0.1") {
|
if (version == "22.0.1" || version == "23.0.1") {
|
||||||
return version as String
|
return version
|
||||||
} else {
|
} else {
|
||||||
return "build-tools-$version"
|
return "build-tools-$version"
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,6 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
|
||||||
includedFiles: List<IncludedFile>,
|
includedFiles: List<IncludedFile>,
|
||||||
expandJarFiles : Boolean = false,
|
expandJarFiles : Boolean = false,
|
||||||
outputStreamFactory: (OutputStream) -> ZipOutputStream = DEFAULT_STREAM_FACTORY) : File {
|
outputStreamFactory: (OutputStream) -> ZipOutputStream = DEFAULT_STREAM_FACTORY) : File {
|
||||||
val buildDir = KFiles.makeDir(project.directory, project.buildDirectory!!)
|
|
||||||
val fullArchiveName = archiveName ?: arrayListOf(project.name!!, project.version!!).joinToString("-") + suffix
|
val fullArchiveName = archiveName ?: arrayListOf(project.name!!, project.version!!).joinToString("-") + suffix
|
||||||
val archiveDir = libsDir(project)
|
val archiveDir = libsDir(project)
|
||||||
val result = File(archiveDir.path, fullArchiveName)
|
val result = File(archiveDir.path, fullArchiveName)
|
||||||
|
|
|
@ -6,16 +6,16 @@ import com.beust.kobalt.maven.Gpg
|
||||||
import com.beust.kobalt.maven.Http
|
import com.beust.kobalt.maven.Http
|
||||||
import com.beust.kobalt.maven.KobaltException
|
import com.beust.kobalt.maven.KobaltException
|
||||||
import com.beust.kobalt.maven.Md5
|
import com.beust.kobalt.maven.Md5
|
||||||
import com.beust.kobalt.misc.*
|
import com.beust.kobalt.misc.KobaltExecutors
|
||||||
import com.google.gson.Gson
|
import com.beust.kobalt.misc.error
|
||||||
|
import com.beust.kobalt.misc.log
|
||||||
|
import com.beust.kobalt.misc.warn
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import com.google.gson.JsonParser
|
import com.google.gson.JsonParser
|
||||||
import com.google.inject.assistedinject.Assisted
|
import com.google.inject.assistedinject.Assisted
|
||||||
import com.squareup.okhttp.Response
|
import com.squareup.okhttp.Response
|
||||||
import org.jetbrains.annotations.Nullable
|
import org.jetbrains.annotations.Nullable
|
||||||
import java.io.ByteArrayInputStream
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.nio.charset.Charset
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
data class JCenterPackage(val jo: JsonObject) {
|
data class JCenterPackage(val jo: JsonObject) {
|
||||||
|
@ -34,15 +34,12 @@ open public class UnauthenticatedJCenterApi @Inject constructor(open val http: H
|
||||||
// return Parser().parse(ByteArrayInputStream(response.toByteArray(Charset.defaultCharset()))) as JsonObject
|
// return Parser().parse(ByteArrayInputStream(response.toByteArray(Charset.defaultCharset()))) as JsonObject
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getPackage(name: String) : JCenterPackage {
|
// fun getPackage() : JCenterPackage {
|
||||||
val url = arrayListOf(BINTRAY_URL_API, "packages", "cbeust", "maven", "kobalt").joinToString("/")
|
// val url = arrayListOf(BINTRAY_URL_API, "packages", "cbeust", "maven", "kobalt").joinToString("/")
|
||||||
val response = http.get(url).getAsString()
|
// val response = http.get(url).getAsString()
|
||||||
val result = parseResponse(response)
|
// val result = parseResponse(response)
|
||||||
return JCenterPackage(result)
|
// return JCenterPackage(result)
|
||||||
}
|
// }
|
||||||
|
|
||||||
val kobaltPackage : JCenterPackage
|
|
||||||
get() = getPackage("kobalt")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val username: String?,
|
public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val username: String?,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue