Skip to content

Commit

Permalink
Merge branch 'release/1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
G00fY2 committed Mar 10, 2019
2 parents 185a5d0 + 5845fba commit 23693ce
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.3'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4'
}
}

Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
}

buildscript {
ext.kotlin_version = '1.3.11'
ext.kotlin_version = '1.3.21'
repositories {
mavenCentral()
}
Expand Down
4 changes: 0 additions & 4 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context="com.g00fy2.versioncomparesample.MainActivity"
tools:ignore="HardcodedText"
>

<LinearLayout
Expand Down Expand Up @@ -43,7 +40,6 @@
android:baselineAligned="false"
android:orientation="horizontal"
android:visibility="gone"
tools:visibility="visible"
>
<LinearLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion versioncompare/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
}

jacoco {
toolVersion = "0.8.2"
toolVersion = "0.8.3"
}

jacocoAndroidUnitTestReport {
Expand Down
2 changes: 1 addition & 1 deletion versioncompare/deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {
issueUrl = 'https://github.com/G00fY2/version-compare/issues'
gitUrl = 'https://github.com/G00fY2/version-compare.git'

libraryVersion = '1.3.0'
libraryVersion = '1.3.1'

developerId = 'g00fy2'
developerName = 'Thomas Wirth'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int compareSuffix(@Nonnull final String suffixA, @Nonnull final String su
return 1;
} else if (qualifierA < qualifierB) {
return -1;
} else if (qualifierA != UNKNOWN && qualifierB != UNKNOWN) {
} else if (qualifierA != UNKNOWN) {
final int suffixVersionA = preReleaseVersion(suffixA, qualifierA);
final int suffixVersionB = preReleaseVersion(suffixB, qualifierB);

Expand All @@ -68,7 +68,7 @@ private static int qualifierToNumber(@Nonnull String suffix) {
if (suffix.contains(RC_STRING)) return RC;
if (suffix.contains(BETA_STRING)) return BETA;
if (suffix.contains(ALPHA_STRING)) {
if (suffix.contains(PRE_STRING)) {
if (suffix.substring(0, suffix.indexOf(ALPHA_STRING)).contains(PRE_STRING)) {
return PRE_ALPHA;
} else {
return ALPHA;
Expand All @@ -84,10 +84,12 @@ private static int preReleaseVersion(@Nonnull final String suffix, final int qua
final int maxStartIndex = Math.min(startIndex + 2, suffix.length());
if (containsNumeric(suffix.substring(startIndex, maxStartIndex))) {
StringBuilder versionNumber = new StringBuilder();
for (int i = startIndex, numIndex = -1; i < suffix.length() && (numIndex == -1 || numIndex + 1 == i); i++) {
if (Character.isDigit(suffix.charAt(i))) {
numIndex = i;
versionNumber.append(suffix.charAt(i));
for (int i = startIndex; i < suffix.length(); i++) {
char c = suffix.charAt(i);
if (Character.isDigit(c)) {
versionNumber.append(c);
} else if (i != startIndex) {
break;
}
}
return safeParseInt(versionNumber.toString());
Expand Down

0 comments on commit 23693ce

Please sign in to comment.