mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
update to kotlin beta 4
This commit is contained in:
parent
e8f271fddf
commit
7c0dd710ea
8 changed files with 10 additions and 11 deletions
|
@ -111,7 +111,7 @@ val kobaltApp = kotlinProject(kobaltPluginApi, wrapper) {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Used by the plugins
|
// Used by the plugins
|
||||||
compile("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.0.0-beta-3595",
|
compile("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.0.0-beta-4584",
|
||||||
"org.jetbrains.dokka:dokka-fatjar:0.9.3")
|
"org.jetbrains.dokka:dokka-fatjar:0.9.3")
|
||||||
|
|
||||||
// Used by the main app
|
// Used by the main app
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class RepoFinder @Inject constructor(val executors: KobaltExecutors) {
|
||||||
val XPATH = XPATH_FACTORY.newXPath();
|
val XPATH = XPATH_FACTORY.newXPath();
|
||||||
|
|
||||||
fun findCorrectVersionRelease(metadataPath: String, repoUrl: String): String? {
|
fun findCorrectVersionRelease(metadataPath: String, repoUrl: String): String? {
|
||||||
val XPATHS = arrayListOf(
|
val XPATHS = listOf(
|
||||||
XPATH.compile("/metadata/version"),
|
XPATH.compile("/metadata/version"),
|
||||||
XPATH.compile("/metadata/versioning/latest"),
|
XPATH.compile("/metadata/versioning/latest"),
|
||||||
XPATH.compile("/metadata/versioning/release"))
|
XPATH.compile("/metadata/versioning/release"))
|
||||||
|
|
|
@ -283,9 +283,8 @@ class KFiles {
|
||||||
if (excludes.isEmpty()) {
|
if (excludes.isEmpty()) {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
val ex = arrayListOf<PathMatcher>()
|
val ex = excludes.map {
|
||||||
excludes.forEach {
|
FileSystems.getDefault().getPathMatcher("glob:${it.spec}")
|
||||||
ex.add(FileSystems.getDefault().getPathMatcher("glob:${it.spec}"))
|
|
||||||
}
|
}
|
||||||
ex.forEach {
|
ex.forEach {
|
||||||
if (it.matches(Paths.get(file))) {
|
if (it.matches(Paths.get(file))) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ open class RunCommand(val command: String) {
|
||||||
"\n " + allArgs.joinToString(" "))
|
"\n " + allArgs.joinToString(" "))
|
||||||
val process = pb.start()
|
val process = pb.start()
|
||||||
pb.environment().let { pbEnv ->
|
pb.environment().let { pbEnv ->
|
||||||
env.forEach {
|
env.forEach {it ->
|
||||||
pbEnv.put(it.key, it.value)
|
pbEnv.put(it.key, it.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import java.net.URL
|
||||||
import java.nio.charset.Charset
|
import java.nio.charset.Charset
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.text.Regex
|
|
||||||
|
|
||||||
class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val buildScriptUtil: BuildScriptUtil,
|
class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val buildScriptUtil: BuildScriptUtil,
|
||||||
val dependencyManager: DependencyManager, val files: KFiles) {
|
val dependencyManager: DependencyManager, val files: KFiles) {
|
||||||
|
@ -74,7 +73,7 @@ class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val
|
||||||
* val profile = true, otherwise return the same line
|
* val profile = true, otherwise return the same line
|
||||||
*/
|
*/
|
||||||
fun correctProfileLine(line: String) : String {
|
fun correctProfileLine(line: String) : String {
|
||||||
context.profiles.forEach {
|
(context.profiles as List<String>).forEach {
|
||||||
if (line.matches(Regex("[ \\t]*val[ \\t]+$it[ \\t]+=.*"))) {
|
if (line.matches(Regex("[ \\t]*val[ \\t]+$it[ \\t]+=.*"))) {
|
||||||
with("val $it = true") {
|
with("val $it = true") {
|
||||||
profileLines.add(this)
|
profileLines.add(this)
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.beust.kobalt.maven.DependencyManager
|
||||||
import com.beust.kobalt.misc.KobaltExecutors
|
import com.beust.kobalt.misc.KobaltExecutors
|
||||||
import com.beust.kobalt.misc.RunCommand
|
import com.beust.kobalt.misc.RunCommand
|
||||||
import com.beust.kobalt.misc.warn
|
import com.beust.kobalt.misc.warn
|
||||||
|
import com.beust.kobalt.plugin.packaging.Jar
|
||||||
import com.beust.kobalt.plugin.packaging.PackageConfig
|
import com.beust.kobalt.plugin.packaging.PackageConfig
|
||||||
import com.beust.kobalt.plugin.packaging.PackagingPlugin
|
import com.beust.kobalt.plugin.packaging.PackagingPlugin
|
||||||
import com.google.inject.Inject
|
import com.google.inject.Inject
|
||||||
|
@ -65,7 +66,7 @@ class ApplicationPlugin @Inject constructor(val executors: KobaltExecutors,
|
||||||
|
|
||||||
private fun isFatJar(packages: List<PackageConfig>, jarName: String): Boolean {
|
private fun isFatJar(packages: List<PackageConfig>, jarName: String): Boolean {
|
||||||
packages.forEach { pc ->
|
packages.forEach { pc ->
|
||||||
pc.jars.forEach { jar ->
|
(pc.jars as List<Jar>).forEach { jar ->
|
||||||
if ((jar.name == null || jar.name == jarName) && jar.fatJar) {
|
if ((jar.name == null || jar.name == jarName) && jar.fatJar) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class KotlinCompiler @Inject constructor(
|
||||||
val executors: KobaltExecutors,
|
val executors: KobaltExecutors,
|
||||||
val jvmCompiler: JvmCompiler) {
|
val jvmCompiler: JvmCompiler) {
|
||||||
companion object {
|
companion object {
|
||||||
val KOTLIN_VERSION = "1.0.0-beta-3595"
|
val KOTLIN_VERSION = "1.0.0-beta-4584"
|
||||||
}
|
}
|
||||||
|
|
||||||
val compilerAction = object: ICompilerAction {
|
val compilerAction = object: ICompilerAction {
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class DynamicGraphTest {
|
||||||
val factory = createFactory(runNodes, { n -> n != 3 })
|
val factory = createFactory(runNodes, { n -> n != 3 })
|
||||||
val ex = DynamicGraphExecutor(g, factory)
|
val ex = DynamicGraphExecutor(g, factory)
|
||||||
ex.run()
|
ex.run()
|
||||||
Thread.yield()
|
Thread.`yield`()
|
||||||
Assert.assertTrue(! runNodes.contains(4))
|
Assert.assertTrue(! runNodes.contains(4))
|
||||||
Assert.assertTrue(! runNodes.contains(10))
|
Assert.assertTrue(! runNodes.contains(10))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue