From 09b48a2f6e41fade4977a5148ed5e35db92bcee6 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 12:18:52 -0800 Subject: [PATCH 01/37] Updated license copyright. --- LICENSE.TXT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.TXT b/LICENSE.TXT index 84fe1dc..f30d392 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,4 +1,4 @@ -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 From 5696c9bf8f49ab2f4aec37fba7cec58bfbf136ca Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 13:12:41 -0800 Subject: [PATCH 02/37] Updated scopes. --- .idea/copyright/profiles_settings.xml | 3 +++ .idea/scopes/Copyright.xml | 3 +++ .idea/scopes/Source.xml | 3 --- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .idea/scopes/Copyright.xml delete mode 100644 .idea/scopes/Source.xml diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index 3423376..9480ac9 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,5 +1,8 @@ + + + diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index de51878..84bf08f 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,32 +1,19 @@ -import com.beust.kobalt.* -import com.beust.kobalt.misc.* -import com.beust.kobalt.plugin.application.* -import com.beust.kobalt.plugin.packaging.* -import com.beust.kobalt.plugin.publish.* -import net.thauvin.erik.kobalt.plugin.versioneye.* +import com.beust.kobalt.plugin.packaging.assemble +import com.beust.kobalt.plugin.publish.autoGitTag +import com.beust.kobalt.plugin.publish.bintray +import com.beust.kobalt.profile +import com.beust.kobalt.project import org.apache.maven.model.* -import java.io.* -val semver = "0.4.4" - -val bs = buildScript { - val p = with(File("kobaltBuild/libs/kobalt-versioneye-$semver.jar")) { - if (exists()) { - kobaltLog(1, " >>> Using: $path") - file(path) - } else { - "net.thauvin.erik:kobalt-versioneye:" - } - } - plugins(p) -} +val dev by profile() +val kobaltDependency = if (dev) "kobalt" else "kobalt-plugin-api" val p = project { name = "kobalt-versioneye" group = "net.thauvin.erik" artifactId = name - version = semver + version = "0.4.5" pom = Model().apply { description = "VersionEye plug-in for the Kobalt build system." @@ -48,7 +35,7 @@ val p = project { } dependencies { - compile("com.beust:kobalt-plugin-api:") + compile("com.beust:$kobaltDependency:") } dependenciesTest { @@ -69,49 +56,4 @@ val p = project { description = "Release version $version" vcsTag = version } -} - -val example = project(p) { - - name = "example" - group = "com.example" - artifactId = name - version = "0.1" - directory = "example" - - dependencies { - compile("com.beust:jcommander:1.47") - //compile("org.slf4j:slf4j-api:") - compile("ch.qos.logback:logback-core:0.5") - compile("ch.qos.logback:logback-classic:1.1.7") - compile("commons-httpclient:commons-httpclient:jar:3.1") - compile("com.beust:kobalt-plugin-api:0.878") - } - - dependenciesTest { - compile("org.testng:testng:") - } - - assemble { - jar { - } - } - - application { - mainClass = "com.example.MainKt" - } - - versionEye { - // baseUrl = "https://www.versioneye.com/" - // colors = true - // name = "" - // org = "" - // quiet = false - // team = "" - // verbose = true - // visibility = "public" - - //failOn(Fail.licensesUnknownCheck, Fail.licensesCheck, Fail.securityCheck, Fail.dependenciesCheck) - } -} - +} \ No newline at end of file diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index ab67089..5430a86 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.30 \ No newline at end of file +kobalt.version=1.0.69 \ No newline at end of file From 88d10348c2c6c27c48aae835dad512a6cc90ccc5 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 19 Apr 2017 17:01:26 -0700 Subject: [PATCH 16/37] Added tests. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b93be0..6b6a336 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,4 +16,4 @@ cache: before_cache: - rm -rf .kobalt/* -script: ./kobaltw clean assemble +script: ./kobaltw clean assemble test From 3a00c8bc1d45a3f482a00b8f4a118b3345813f67 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 19 Apr 2017 17:02:15 -0700 Subject: [PATCH 17/37] Fixed test. --- .../thauvin/erik/kobalt/plugin/versioneye/UtilsTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/UtilsTest.kt b/src/test/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/UtilsTest.kt index ba68ca7..b057977 100644 --- a/src/test/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/UtilsTest.kt +++ b/src/test/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/UtilsTest.kt @@ -31,9 +31,9 @@ */ package net.thauvin.erik.kobalt.plugin.versioneye -import com.beust.kobalt.* -import org.testng.* -import org.testng.annotations.* +import com.beust.kobalt.AsciiArt +import org.testng.Assert +import org.testng.annotations.Test @Test class UtilsTest { @@ -78,7 +78,7 @@ class UtilsTest { "redLight(count:1, fail:false, colors:true)") Assert.assertEquals(Utils.redLight(0, false, true), AsciiArt.GREEN + 0 + AsciiArt.RESET, "redLight(count:0, fail:false, colors:true)") - Assert.assertEquals(Utils.redLight(1, false, false), text, + Assert.assertEquals(Utils.redLight(1, false, false), "1", "redLight(count:1, fail:false, colors:false)") } } \ No newline at end of file From fb29ebc536744b54475de0418f5bd9d5a24dd093 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 19 Apr 2017 17:03:41 -0700 Subject: [PATCH 18/37] Added http logging in debug mode. --- kobalt/src/Build.kt | 9 ++++++-- .../plugin/versioneye/VersionEyePlugin.kt | 22 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 84bf08f..11958f8 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,10 +1,14 @@ +import com.beust.kobalt.* import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.autoGitTag import com.beust.kobalt.plugin.publish.bintray -import com.beust.kobalt.profile -import com.beust.kobalt.project import org.apache.maven.model.* +val bs = buildScript { + plugins("net.thauvin.erik:kobalt-maven-local:") + repos(localMaven()) +} + val dev by profile() val kobaltDependency = if (dev) "kobalt" else "kobalt-plugin-api" @@ -36,6 +40,7 @@ val p = project { dependencies { compile("com.beust:$kobaltDependency:") + compile("com.squareup.okhttp3:logging-interceptor:jar:3.6.0") } dependenciesTest { diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt index 5ac6d94..2b48a4b 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt @@ -42,6 +42,7 @@ import com.google.gson.JsonObject import com.google.inject.Inject import com.google.inject.Singleton import okhttp3.* +import okhttp3.logging.HttpLoggingInterceptor import java.io.FileOutputStream import java.nio.file.Files import java.nio.file.Paths @@ -58,7 +59,15 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor log(2, "[HTTP] $message") }) + .apply { level = HttpLoggingInterceptor.Level.BODY }).build() + } // ITaskContributor override fun tasksFor(project: Project, context: KobaltContext): List = taskContributor.dynamicTasks @@ -77,12 +86,13 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor Date: Tue, 25 Apr 2017 05:59:06 -0700 Subject: [PATCH 19/37] Added pom.xml --- pom.xml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..fc3fc64 --- /dev/null +++ b/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + net.thauvin.erik + kobalt-versioneye + 0.4.5 + kobalt-versioneye + VersionEye plug-in for the Kobalt build system. + https://github.com/ethauvin/kobalt-versioneye + + + BSD 3-Clause + https://opensource.org/licenses/BSD-3-Clause + + + + + ethauvin + Erik C. Thauvin + erik@thauvin.net + + + + https://github.com/ethauvin/kobalt-versioneye.git + git@github.com:ethauvin/kobalt-versioneye.git + https://github.com/ethauvin/kobalt-versioneye + + + + com.beust + kobalt-plugin-api + (0,] + + + com.squareup.okhttp3 + logging-interceptor + 3.6.0 + + + org.testng + testng + (0,] + test + + + From 53cff85983c99a70a6496ecd0928d4cbe72a077f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 25 Apr 2017 09:11:06 -0700 Subject: [PATCH 20/37] Added pom.xml generation. --- .gitignore | 1 + README.md | 48 ++++++++++---- example/kobalt/src/Build.kt | 6 +- example/pom.xml | 43 +++++++++++++ kobalt/src/Build.kt | 30 +++++++-- pom.xml | 2 +- .../erik/kobalt/plugin/versioneye/Utils.kt | 27 +++++++- .../plugin/versioneye/VersionEyePlugin.kt | 64 ++++++++++++------- 8 files changed, 173 insertions(+), 48 deletions(-) create mode 100644 example/pom.xml diff --git a/.gitignore b/.gitignore index fcb0f44..fbd6166 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ **/.idea/tasks.xml **/.idea/workspace.xml *.iws +*.sublime-* .classpath .DS_Store .gradle diff --git a/README.md b/README.md index 98f133e..f33cbf7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # VersionEye plug-in for [Kobalt](http://beust.com/kobalt/home/index.html) -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.org/ethauvin/kobalt-versioneye.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-versioneye) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-versioneye/images/download.svg) ](https://bintray.com/ethauvin/maven/kobalt-versioneye/_latestVersion) +[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.org/ethauvin/kobalt-versioneye.svg?branch=master)](https://travis-ci.org/ethauvin/kobalt-versioneye) [![Dependency Status](https://www.versioneye.com/user/projects/58ff729f6ac171425cd00acf/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/58ff729f6ac171425cd00acf) [![Download](https://api.bintray.com/packages/ethauvin/maven/kobalt-versioneye/images/download.svg) ](https://bintray.com/ethauvin/maven/kobalt-versioneye/_latestVersion) [![VersionEye Logo](src/site/images/VersionEyeLogo.png)](https://www.versioneye.com) @@ -90,16 +90,17 @@ versionEye { The values are: -| Value | Description | Default | -| :----------- | :---------------------------------------------------------------------------------------------- | :---------------------------- | -| `baseUrl` | For VersionEye Enterprise VM to use your own domain, e.g. `https://versioneye.my-company.com/` | `https://www.versioneye.com/` | -| `colors` | To enable (`true`) or disable (`false`) colors in the plug-in output. | `true` | -| `name` | The name of the VersionEye project, if none is specified the Kobalt project name will be used. | *none* | -| `quiet` | To completely disable output from the plug-in. | `false` | -| `org` | The VersionEye organization, if any. | *none* | -| `team` | The VersionEye team, if any. | *none* | -| `verbose` | To enable or disable extra information in the plug-in output. | `true` | -| `visibility` | To set the project's visibility on VersionEye, either `public` or `private` | `public` | +| Value | Description | Default | +| :----------- | :--------------------------------------------------------------------------------------------------------------------- | :---------------------------- | +| `baseUrl` | For VersionEye Enterprise VM to use your own domain, e.g. `https://versioneye.my-company.com/` | `https://www.versioneye.com/` | +| `colors` | To enable (`true`) or disable (`false`) colors in the plug-in output. | `true` | +| `name` | The name of the VersionEye project, if none is specified the Kobalt project name will be used. | *none* | +| `quiet` | To completely disable output from the plug-in. | `false` | +| `org` | The VersionEye organization, if any. | *none* | +| `pom` | Generate a [pom.xml](https://maven.apache.org/pom.html) for the project. See [Private vs. Public](#private-vs-public). | `false` | +| `team` | The VersionEye team, if any. | *none* | +| `verbose` | To enable or disable extra information in the plug-in output. | `true` | +| `visibility` | To set the project's visibility on VersionEye, either `public` or `private` | `public` | Some of the parameters can be controlled temporarily from the command line, as follows: @@ -126,4 +127,27 @@ versionEye { | `Fail.dependenciesCheck` | Will triggered a failure on outdated dependencies. | | `Fail.licensesUnknownCheck` | Will trigger a failure on unknown licenses. | | `Fail.licensesCheck` | Will trigger a failure on licenses whitelist violations. Licenses and components whitelists can be configured on the [VersionEye](https://www.versioneye.com/) website. | -| `Fail.securityCheck` | Will trigger a failure on known security vulnerabilities, on by default. | \ No newline at end of file +| `Fail.securityCheck` | Will trigger a failure on known security vulnerabilities, on by default. | + +## Private vs. Public + +By default, projects created using the VersionEye API are private. If your project is hosted on [GitHub](https://github.com) or [BitBucket](https://bitbucket.org) and would like to make it public on VersionEye. The plug-in can generate a [pom](https://maven.apache.org/pom.html) file compatible with VersionEye, as follows: + +``` +versionEye { + pom = true +... +} +``` + +and to generate the pom file, but **not** create a new project on VersionEye: + +```bash +./kobaltw -Dve.create=false versionEye +``` + +Be sure to commit `pom.xml` on GitHub or BitBucket, and then import your project at: + + * https://www.versioneye.com/projects/new + +Finally, configure your [project key](#global-configuration). \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index db314b4..f7a9d31 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -6,8 +6,8 @@ import net.thauvin.erik.kobalt.plugin.versioneye.* // ./kobaltw versionEye val bs = buildScript { - //plugins(file("../kobaltBuild/libs/kobalt-versioneye-0.4.5.jar")) - plugins("net.thauvin.erik:kobalt-versioneye:") + repos(file("K:/maven/repository")) + plugins("net.thauvin.erik:kobalt-versioneye:0.4.5") } val p = project { @@ -44,8 +44,10 @@ val p = project { // colors = true // name = "" // org = "" + pom = true // quiet = false // team = "" + temp = true // verbose = true // visibility = "public" diff --git a/example/pom.xml b/example/pom.xml new file mode 100644 index 0000000..7b9976b --- /dev/null +++ b/example/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.example + example + 0.1 + example + + + + com.beust + jcommander + 1.47 + + + ch.qos.logback + logback-core + 0.5 + + + ch.qos.logback + logback-classic + 1.1.7 + + + commons-httpclient + commons-httpclient + 3.1 + + + com.beust + kobalt-plugin-api + 0.878 + + + org.testng + testng + (0,] + test + + + diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 11958f8..29e3410 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,12 +1,20 @@ -import com.beust.kobalt.* + +import com.beust.kobalt.buildScript +import com.beust.kobalt.file import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.autoGitTag import com.beust.kobalt.plugin.publish.bintray -import org.apache.maven.model.* +import com.beust.kobalt.profile +import com.beust.kobalt.project +import net.thauvin.erik.kobalt.plugin.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 val bs = buildScript { - plugins("net.thauvin.erik:kobalt-maven-local:") - repos(localMaven()) + repos(file("K:/maven/repository")) + plugins("net.thauvin.erik:kobalt-maven-local:0.5.2", "net.thauvin.erik:kobalt-versioneye:0.4.5") } val dev by profile() @@ -40,7 +48,7 @@ val p = project { dependencies { compile("com.beust:$kobaltDependency:") - compile("com.squareup.okhttp3:logging-interceptor:jar:3.6.0") + compile("com.squareup.okhttp3:logging-interceptor:jar:3.7.0") } dependenciesTest { @@ -48,7 +56,13 @@ val p = project { } assemble { - mavenJars {} + jar { + fatJar = true + } + + mavenJars { + fatJar = true + } } autoGitTag { @@ -61,4 +75,8 @@ val p = project { description = "Release version $version" vcsTag = version } + + versionEye { + pom = true + } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc3fc64..7c862bc 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ com.squareup.okhttp3 logging-interceptor - 3.6.0 + 3.7.0 org.testng diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/Utils.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/Utils.kt index 57a38fa..c8225a4 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/Utils.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/Utils.kt @@ -67,6 +67,27 @@ open class Utils { } + fun red(text: String, colors: Boolean = true): String { + if (!colors) { + return text + } + return AsciiArt.RED + text + AsciiArt.RESET + } + + fun yellow(text: String, colors: Boolean = true): String { + if (!colors) { + return text + } + return AsciiArt.YELLOW + text + AsciiArt.RESET + } + + fun green(text: String, colors: Boolean = true): String { + if (!colors) { + return text + } + return AsciiArt.GREEN + text + AsciiArt.RESET + } + fun redLight(count: Int, fail: Boolean, colors: Boolean): String { return redLight(count.toString(), count, fail, colors) } @@ -75,11 +96,11 @@ open class Utils { fun redLight(text: String, count: Int, fail: Boolean, colors: Boolean): String { if (colors) { if (fail && count > 0) { - return AsciiArt.RED + text + AsciiArt.RESET + return red(text) } else if (count > 0) { - return AsciiArt.YELLOW + text + AsciiArt.RESET + return yellow(text) } else { - return AsciiArt.GREEN + text + AsciiArt.RESET + return green(text) } } return text diff --git a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt index 2b48a4b..115a355 100644 --- a/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt +++ b/src/main/kotlin/net/thauvin/erik/kobalt/plugin/versioneye/VersionEyePlugin.kt @@ -36,13 +36,16 @@ import com.beust.kobalt.TaskResult import com.beust.kobalt.api.* import com.beust.kobalt.api.annotation.Directive import com.beust.kobalt.api.annotation.Task -import com.beust.kobalt.misc.* +import com.beust.kobalt.misc.KobaltLogger +import com.beust.kobalt.misc.log +import com.beust.kobalt.misc.warn import com.google.gson.GsonBuilder import com.google.gson.JsonObject import com.google.inject.Inject import com.google.inject.Singleton import okhttp3.* import okhttp3.logging.HttpLoggingInterceptor +import java.io.File import java.io.FileOutputStream import java.nio.file.Files import java.nio.file.Paths @@ -53,13 +56,14 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor by configActor { private val API_KEY_PROPERTY = "versioneye.apiKey" - private val PROJECT_KEY_PROPERTY = "versioneye.projectKey" private val COLORS_PROPERTY = "ve.colors" - private val VERBOSE_PROPERTY = "ve.verbose" + private val CREATE_PROPERTY = "ve.create" + private val PROJECT_KEY_PROPERTY = "versioneye.projectKey" private val QUIET_PROPERTY = "ve.quiet" + private val VERBOSE_PROPERTY = "ve.verbose" private val debug = System.getProperty("ve.debug", "false").toBoolean() - private val fiddler = System.getProperty("ve.fiddler", "false").toBoolean() + private val proxy = System.getProperty("ve.proxy", "-1").toInt() private val httpClient = if (!debug) { OkHttpClient() @@ -86,13 +90,12 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor - p.store(output, "") + p.store(output, null) } return result @@ -193,15 +210,13 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor = mutableSetOf(Fail.securityCheck) var name = "" var org = "" + var pom = false var quiet = false var team = "" + var temp = false var verbose = true var visibility = "public" From b6443ffb0188725038a9ccc2262eb98cca0f2853 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 25 Apr 2017 09:11:24 -0700 Subject: [PATCH 21/37] Added clean shell script for testing. --- clean.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 clean.sh diff --git a/clean.sh b/clean.sh new file mode 100644 index 0000000..6d6ee30 --- /dev/null +++ b/clean.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +DEBUG=false + +rm="rm -rf" + +if [ "$DEBUG" = true ]; then + rm="echo rm -rf" +fi + +buildkt="kobalt/src/Build.kt" + +name=$(cat $buildkt | grep -m 1 "name = " | cut -d"\"" -f 2) +group=$(cat $buildkt | grep -m 1 "group = " | cut -d"\"" -f 2) +version=$(cat $buildkt | grep -m 1 "version = " | cut -d"\"" -f 2) + +maven="/k/maven/repository/${group//.//}/${name}/${version}" +kobalt="$HOME/.kobalt/cache/${group//.//}/${name}/${version}" + +read -p "Delete version ${version}? " -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + for dir in "$kobalt" "$maven"; do + if [ -d "$dir" ]; then + echo -e "Deleting : \e[32;1m$dir\e[0m" + $rm "$dir" + else + echo -e "Not Found: \e[31;1m$dir\e[0m" + fi + done +fi \ No newline at end of file From 062214c9e05584b367b1cdd432125b8b71615872 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 25 Apr 2017 09:12:25 -0700 Subject: [PATCH 22/37] Kobalt 1.0.76 update. --- .idea/kobalt.xml | 2 +- .idea/misc.xml | 2 +- .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt-versioneye.iml | 45 +++++++++++-------- kobalt/Build.kt.iml | 15 +++++-- kobalt/wrapper/kobalt-wrapper.properties | 2 +- 6 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 07b6593..6676523 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,7 +5,7 @@