From 530c6f50f238384c7b37fd4eb79ff4f164ca77a3 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 31 Jul 2016 13:39:40 -0700 Subject: [PATCH 01/54] Updated screenshot. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 934d9a9..642f31d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ This will instruct the plug-in to create and update your project on VersionEye. Upon running the above command the plug-in will output something like: -[![Example Report](src/site/images/ExampleReport.png)] +![Example Report](src/site/images/ExampleReport.png) The repot is based on the *Traffic Light* concept: From d5d63df08ad1b6ef8ee1e4b010b9b57fe71bbe89 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 1 Aug 2016 11:06:11 -0700 Subject: [PATCH 02/54] Fixed typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 642f31d..e797e47 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Upon running the above command the plug-in will output something like: ![Example Report](src/site/images/ExampleReport.png) -The repot is based on the *Traffic Light* concept: +The report is based on the *Traffic Light* concept: 1. Green items are clear. 2. Yellow items may require some attention. From 3441ff01684fdb0e5ae88f0c24d0e4f50b0036b5 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 1 Aug 2016 14:50:27 -0700 Subject: [PATCH 03/54] Fixed non-color output. --- .../erik/kobalt/plugin/versioneye/Utils.kt | 9 +++++ .../plugin/versioneye/VersionEyePlugin.kt | 38 +++++++++---------- 2 files changed, 27 insertions(+), 20 deletions(-) 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 42d4063..b5b15f1 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 @@ -36,6 +36,15 @@ import com.beust.kobalt.misc.log open class Utils { companion object { + // Non-colors failure + fun alt(failed: Boolean): String { + if (failed) { + return " [FAILED]" + } + + return "" + } + // Match failure option in set fun isFail(failOn: Set, match: Fail): Boolean { return failOn.contains(match) 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 3eabadb..d309fae 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 @@ -231,10 +231,10 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor 0 + val isFailLicense = Utils.isFail(config.failSet, Fail.licensesCheck) && licenses_red > 0 + val isFailUnknown = Utils.isFail(config.failSet, Fail.licensesUnknownCheck) && licenses_unknown > 0 + val isFailSecurity = Utils.isFail(config.failSet, Fail.securityCheck) && sv_count > 0 // Unknown dependencies var unknownDeps = 0 @@ -258,14 +258,14 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor UNKNOWN", unknownDeps, false, config.colors)) + depsInfo.append(Utils.redLight(" - $depName -> UNKNOWN", unknownDeps, false, config.colors)) } else if (dep.get("outdated").asBoolean) { if (depsInfo.isNotEmpty()) { depsInfo.append(lf) } depsInfo.append(Utils.redLight(" - $depName -> " - + curVer.asString, out_number, isFailDeps, config.colors)) + + curVer.asString, out_number, isFailDeps, config.colors) + + Utils.alt(isFailDeps && !config.colors)) } // Parse licenses @@ -297,7 +297,8 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor 1 || config.verbose) - val alt = " [FAILED]" // Log dependencies check results log(1, " Dependencies: " + Utils.redLight(out_number, isFailDeps, config.colors) + " outdated. " + Utils.redLight(unknownDeps, false, config.colors) + " unknown. $dep_number total." - + if (isFailDeps && !config.colors) alt else "") + + Utils.alt(isFailDeps && !config.colors)) Utils.log(depsInfo, verbose) // Log licenses check results log(1, " Licenses: " - + Utils.redLight(licenses_red, isFailLicense, config.colors) - + " whitelist. " + + Utils.redLight(licenses_red, isFailLicense, config.colors) + " whitelist. " + Utils.redLight(licenses_unknown, isFailUnknown, config.colors) + Utils.plural(" unknown", licenses_unknown, "s.", ".") - + if ((isFailLicense || isFailUnknown) && !config.colors) alt else "") + + Utils.alt((isFailLicense || isFailUnknown) && !config.colors)) Utils.log(licensesInfo, verbose) // Log security check results @@ -347,7 +348,7 @@ class VersionEyePlugin @Inject constructor(val configActor: ConfigActor 0 && isFailDeps - || licenses_red > 0 && isFailLicense - || licenses_unknown > 0 && isFailUnknown - || sv_count > 0 && isFailSecurity) { + if (isFailDeps || isFailLicense || isFailUnknown || isFailSecurity) { return TaskResult(false) } } From 5f39b8280e66a11218710b28baa34fc2fb965e83 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 1 Aug 2016 14:54:40 -0700 Subject: [PATCH 04/54] Version 0.4.3 --- .idea/misc.xml | 16 ---------------- example/kobalt/src/Build.kt | 6 +++--- kobalt/src/Build.kt | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index ac7bcb3..f639e0e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -74,20 +74,4 @@ - - - - - 1.8.x - - - - - - - \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 66934be..6e7e81a 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -6,7 +6,7 @@ import net.thauvin.erik.kobalt.plugin.versioneye.* val repos = repos() -//val pl = plugins(file("../kobaltBuild/libs/kobalt-versioneye-0.4.2-beta.jar")) +//val pl = plugins(file("../kobaltBuild/libs/kobalt-versioneye-0.4.3-beta.jar")) val pl = plugins("net.thauvin.erik:kobalt-versioneye:") val p = project { @@ -30,7 +30,7 @@ val p = project { 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") + compile("com.beust:kobalt-plugin-api:0.878") } @@ -58,6 +58,6 @@ val p = project { // verbose = true // visibility = "public" - //failOn(Fail.securityCheck) + //failOn(Fail.licensesUnknownCheck, Fail.licensesCheck, Fail.securityCheck, Fail.dependenciesCheck) } } diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index c55d858..4c40c1d 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -15,7 +15,7 @@ val p = project { name = "kobalt-versioneye" group = "net.thauvin.erik" artifactId = name - version = "0.4.2-beta" + version = "0.4.3-beta" pom = Model().apply { description = "VersionEye plug-in for the Kobalt build system." From 231d22790713624915a8dcb02d55f0e257e310ef Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 1 Aug 2016 15:09:40 -0700 Subject: [PATCH 05/54] Fixed typos. --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e797e47..84a9476 100644 --- a/README.md +++ b/README.md @@ -88,16 +88,16 @@ versionEye { The values are: -| Value | Description | Default | -| :---------- | :---------------------------------------------------------------------------------------------- | :---------------------------- | -| `baseUrl` | For VersionEye Enterprise VM to use their own url, 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 are specified the Kobalt project name will be used. | *none* | -| `quiet` | To completely disable output from the plug-in. | `false` | -| `org` | The VersionEye organisation, if any. | *none* | -| `team` | The VersionEye team, if any. | *none* | -| `vebose` | To enable or disable extra information in the plug-in output. | `true` | -| `visbility` | 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* | +| `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: @@ -123,5 +123,5 @@ 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 licences whitelist violations. Licenses and components whitelists can be configured on the [VersionEye](https://www.versioneye.com/) website. | +| `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 From 1bfa3f8823647fa5e75e3762ad3b774f8d48a340 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 4 Aug 2016 20:54:37 -0700 Subject: [PATCH 06/54] Kobalt 0.889 update. --- .idea/kobalt.xml | 2 +- example/kobalt/wrapper/kobalt-wrapper.jar | Bin 9230 -> 9230 bytes .../kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt/wrapper/kobalt-wrapper.jar | Bin 9230 -> 9230 bytes kobalt/wrapper/kobalt-wrapper.properties | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 017ce32..f0dcbde 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,7 +5,7 @@ \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index d175698..4c0d94b 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -4,5 +4,6 @@ + \ No newline at end of file diff --git a/example/example.iml b/example/example.iml index 19dbd15..70fa9cc 100644 --- a/example/example.iml +++ b/example/example.iml @@ -1,6 +1,484 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 49ba2e3..766bcc1 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -1,10 +1,11 @@ import com.beust.kobalt.* -import com.beust.kobalt.plugin.application.application -import com.beust.kobalt.plugin.packaging.assemble +import com.beust.kobalt.plugin.application.* +import com.beust.kobalt.plugin.packaging.* import net.thauvin.erik.kobalt.plugin.versioneye.* +// ./kobaltw versionEye + val bs = buildScript { - //plugins(file("../kobaltBuild/libs/kobalt-versioneye-0.4.4.jar")) plugins("net.thauvin.erik:kobalt-versioneye:") } @@ -32,8 +33,6 @@ val p = project { compile("com.beust:kobalt-plugin-api:0.878") } - - dependenciesTest { compile("org.testng:testng:") } diff --git a/example/kobalt/wrapper/kobalt-wrapper.properties b/example/kobalt/wrapper/kobalt-wrapper.properties index 91fe49a..1ec9521 100644 --- a/example/kobalt/wrapper/kobalt-wrapper.properties +++ b/example/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.3 \ No newline at end of file +kobalt.version=1.0.5 \ No newline at end of file diff --git a/kobalt-versioneye.iml b/kobalt-versioneye.iml index d61d020..0f2eb63 100644 --- a/kobalt-versioneye.iml +++ b/kobalt-versioneye.iml @@ -5,8 +5,9 @@ - - + + + @@ -20,397 +21,10 @@ - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -426,9 +40,396 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kobalt/Build.kt.iml b/kobalt/Build.kt.iml index f886e23..602ccaf 100644 --- a/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -10,9 +10,18 @@ - + - + + + + + + + + + + diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index 56b00df..463d1ad 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,17 +1,35 @@ +import com.beust.kobalt.buildScript +import com.beust.kobalt.file +import com.beust.kobalt.misc.kobaltLog +import com.beust.kobalt.plugin.application.application import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.bintray import com.beust.kobalt.project +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 +val semver = "0.4.4" + +val bs = buildScript { + val f = java.io.File("kobaltBuild/libs/kobalt-versioneye-$semver.jar") + val p = if (f.exists()) { + kobaltLog(1, " >>> Using: ${f.path}") + file(f.path) + } else { + "net.thauvin.erik:kobalt-versioneye:" + } + plugins(p) +} + val p = project { name = "kobalt-versioneye" group = "net.thauvin.erik" artifactId = name - version = "0.4.4" + version = semver pom = Model().apply { description = "VersionEye plug-in for the Kobalt build system." @@ -57,3 +75,58 @@ val p = project { publish = true } } + +val example = project(p) { + + name = "example" + group = "com.example" + artifactId = name + version = "0.1" + directory = "example" + + sourceDirectories { + path("src/main/kotlin") + } + + sourceDirectoriesTest { + path("src/test/kotlin") + } + + 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) + } +} + diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 91fe49a..1ec9521 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=1.0.3 \ No newline at end of file +kobalt.version=1.0.5 \ No newline at end of file From 3005229f18820577d2a8fb7f47dea5787b0c2568 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 8 Mar 2017 11:20:01 -0800 Subject: [PATCH 17/54] Kobalt 1.0.6 update. --- .idea/kobalt.xml | 2 +- example/example.iml | 4 ++-- example/kobalt/wrapper/kobalt-wrapper.properties | 2 +- kobalt/Build.kt.iml | 8 ++++---- kobalt/src/Build.kt | 14 ++++++++------ kobalt/wrapper/kobalt-wrapper.properties | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.idea/kobalt.xml b/.idea/kobalt.xml index 52b4669..5bc4181 100644 --- a/.idea/kobalt.xml +++ b/.idea/kobalt.xml @@ -5,7 +5,7 @@