From 29d9bc6288ac375817deea610bf0b9ca2875a35c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Mar 2017 14:20:01 -0800 Subject: [PATCH] Kotlin 1.1 and Kobalt 1.0.x optimization --- README.md | 4 +++- example/kobalt/src/Build.kt | 8 ++++---- kobalt/src/Build.kt | 13 ++++++------- .../kobalt/plugin/maven/local/MavenLocalPlugin.kt | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 37e0498..17d6363 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,9 @@ To use the plug-in include the following in your `Build.kt` file: ```kotlin import net.thauvin.erik.kobalt.plugin.maven.local.* -val pl = plugins("net.thauvin.erik:kobalt-maven-local:") +val bs = buildScript { + plugins("net.thauvin.erik:kobalt-maven-local:") +} val p = project { name = "example" diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 90604c2..2591382 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -4,10 +4,10 @@ import com.beust.kobalt.plugin.application.* import com.beust.kobalt.plugin.java.* import net.thauvin.erik.kobalt.plugin.maven.local.* -val repos = repos(localMaven()) - -//val pl = plugins(file("../kobaltBuild/libs/kobalt-maven-local-0.5.1.jar")) -val pl = plugins("net.thauvin.erik:kobalt-maven-local:0.5.1") +val bs = buildScript { + repos(localMaven()) + plugins("net.thauvin.erik:kobalt-maven-local:0.5.1") +} val example = project { diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index d3632c9..55a05fa 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,23 +1,22 @@ + +import com.beust.kobalt.buildScript import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.bintray -import com.beust.kobalt.plugins import com.beust.kobalt.project -import com.beust.kobalt.repos +import net.thauvin.erik.kobalt.plugin.versioneye.versionEye import org.apache.maven.model.Developer import org.apache.maven.model.License import org.apache.maven.model.Model import org.apache.maven.model.Scm -import net.thauvin.erik.kobalt.plugin.versioneye.* - -val pl = plugins("net.thauvin.erik:kobalt-versioneye:") -val repos = repos() +val bs = buildScript { + plugins("net.thauvin.erik:kobalt-versioneye:") +} val dev = false val kobaltDependency = if (dev) "kobalt" else "kobalt-plugin-api" val p = project { - name = "kobalt-maven-local" group = "net.thauvin.erik" artifactId = name diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/maven/local/MavenLocalPlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/maven/local/MavenLocalPlugin.kt index 3e84b9b..7f12a4b 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/maven/local/MavenLocalPlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/maven/local/MavenLocalPlugin.kt @@ -1,7 +1,7 @@ /* * MavenLocalPlugin.kt * - * Copyright (c) 2016, Erik C. Thauvin (erik@thauvin.net) + * Copyright (c) 2016-2017, Erik C. Thauvin (erik@thauvin.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ import java.nio.file.Files import java.nio.file.Paths import java.util.* -public class MavenLocalPlugin : BasePlugin(), ILocalMavenRepoPathInterceptor { +class MavenLocalPlugin : BasePlugin(), ILocalMavenRepoPathInterceptor { val MAVEN_LOCAL_REPO_PROPERTY = "maven.repo.local" var mvnLocalPath: String? = null