Skip to content

Commit

Permalink
🔖 0.15.3, Add proper semantic version comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvertdw committed Oct 26, 2018
1 parent d98a5e9 commit 8e9f8fd
Show file tree
Hide file tree
Showing 27 changed files with 77 additions and 29 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
Expand Down Expand Up @@ -68,7 +68,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down Expand Up @@ -157,7 +157,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
Expand All @@ -177,7 +177,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "us.ihmc"
version = "0.15.2"
version = "0.15.3"

pluginBundle {
website = "https://github.com/ihmcrobotics/ihmc-build"
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/us/ihmc/build/IHMCSettingsConfigurator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IHMCSettingsConfigurator(val settings: Settings, val logger: Logger, val e
logInfo(logger, "Evaluating " + settings.rootProject.projectDir.toPath().fileName.toString() + " settings.gradle")
ext["org.gradle.workers.max"] = 200

if (settings.gradle.gradleVersion.compareTo("4.8") < 0)
if (Version(settings.gradle.gradleVersion).compareTo(Version("4.8")) < 0)
{
val message = "Please upgrade to Gradle version 4.8 or higher! (Recommended versions: 4.10.2 or later)"
logError(logger, message)
Expand Down
48 changes: 48 additions & 0 deletions src/main/kotlin/us/ihmc/build/Version.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package us.ihmc.build

class Version(private val version: String) : Comparable<Version>
{
init {
if (!version.matches("[0-9]+(\\.[0-9]+)*".toRegex()))
throw IllegalArgumentException("Invalid version format: $version")
}

fun get(): String
{
return this.version
}

override operator fun compareTo(that: Version): Int
{
if (that == null)
return 1
val thisParts = this.get().split("\\.".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
val thatParts = that.get().split("\\.".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
val length = Math.max(thisParts.size, thatParts.size)
for (i in 0 until length)
{
val thisPart = if (i < thisParts.size)
Integer.parseInt(thisParts[i])
else
0
val thatPart = if (i < thatParts.size)
Integer.parseInt(thatParts[i])
else
0
if (thisPart < thatPart)
return -1
if (thisPart > thatPart)
return 1
}
return 0
}

override fun equals(that: Any?): Boolean
{
if (this === that)
return true
if (that == null)
return false
return if (this.javaClass != that.javaClass) false else this.compareTo(that as Version) == 0
}
}
2 changes: 1 addition & 1 deletion src/test/builds/basicProject/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/basicProject/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/dependsOnSnapshot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
classpath "us.ihmc:ihmc-ci-plugin:0.18.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/dependsOnSnapshot/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/emptyBuildGradleProject/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/generateTestSuitesTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
classpath "us.ihmc:ihmc-ci-plugin:0.18.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/generateTestSuitesTest/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/multi-project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
2 changes: 1 addition & 1 deletion src/test/builds/multi-project/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/multi-project/sub-project-one/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/multi-project/sub-project-two/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/oldPublishApiTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/oldPublishApiTest/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/publishApiTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}
apply plugin: "us.ihmc.ihmc-build"
Expand Down
2 changes: 1 addition & 1 deletion src/test/builds/publishApiTest/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "us.ihmc:ihmc-build:0.15.2"
classpath "us.ihmc:ihmc-build:0.15.3"
}
}

Expand Down

0 comments on commit 8e9f8fd

Please sign in to comment.