Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
G00fY2 committed Jan 2, 2022
2 parents f33db2c + b53af32 commit 10e9907
Show file tree
Hide file tree
Showing 22 changed files with 587 additions and 359 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root = true
root=true

[*.{java,kt,kts}]
charset=utf-8
Expand All @@ -16,5 +16,5 @@ ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^
[*.java]
ij_java_names_count_to_use_import_on_demand=2147483647
ij_java_class_count_to_use_import_on_demand=2147483647
ij_java_layout_static_imports_separately = true
ij_java_imports_layout=*,javax.**,java.**,|,$*
ij_java_layout_static_imports_separately=true
ij_java_imports_layout=*,javax.**,java.**,|,$*
193 changes: 187 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,189 @@
*.iml
# Reference gitignore https://gist.github.com/G00fY2/81c0aa67943cca021e915840bf73ee1b

# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle
/local.properties
.idea/
.gradle/
build/
gradle-app.setting
.gradletasknamecache

# Signing files
.signing/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio
/*/debug/
/*/release/
/*/build/
/*/local.properties
/*/out
/*/*/build
/*/*/production
/*/*/staging
*.ipr
*~
*.swp

# Android Patch
gen-external-apklibs

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
*.iws
.idea/*
!.idea/codeStyles/Project.xml
!.idea/codeStyles/codeStyleConfig.xml
# optional
# !.idea/dictionaries
# !.idea/inspectionProfiles
# !.idea/runConfigurations
# !.idea/runConfigurations.xml

# Keystore files
*.jks
*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# NDK
obj/

# CMake
cmake-build-*/

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

#Crashlytics
crashlytics-build.properties
com_crashlytics_export_strings.xml
crashlytics.properties
fabric.properties

## Plugin-specific files:

# mpeltonen/sbt-idea plugin
.idea_modules/

# Mongo Explorer plugin
.idea/mongoSettings.xml

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Editor-based Rest Client
.idea/httpRequests

## OS specific files:

# General
.DS_Store
/build
/captures
.externalNativeBuild
.DS_Store?
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*
54 changes: 44 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version Compare [![Maven Central](https://img.shields.io/maven-central/v/io.github.g00fy2/versioncompare)](https://search.maven.org/artifact/io.github.g00fy2/versioncompare) [![GitHub Actions](
Version Compare [![GitHub Actions](
https://github.com/g00fy2/version-compare/actions/workflows/build.yml/badge.svg)](https://github.com/G00fY2/version-compare/actions) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=G00fY2_version-compare&metric=coverage)](https://sonarcloud.io/dashboard?id=G00fY2_version-compare)
=====
Lightweight library for Android, Java and Kotlin to compare version strings.
Expand All @@ -7,25 +7,58 @@ This library allows you to easily compare version strings. Versions can but do n

Pure Java (java.util), no dependencies, very small method count.

## Usage
> ⚠️ **With version 1.4.0 this library moved to MavenCentral! As a result the *groupId* had to be changed. If you use the old `com.g00fy2:versioncompare` artifact check out the migration guide in the [release notes](https://github.com/G00fY2/version-compare/releases/tag/1.4.0).**
## Download [![Maven Central](https://img.shields.io/maven-central/v/io.github.g00fy2/versioncompare)](https://search.maven.org/artifact/io.github.g00fy2/versioncompare)

**Gradle:**
```
<details open>
<summary>Gradle</summary>

```kotlin
dependencies {
implementation("io.github.g00fy2:versioncompare:1.4.1")
implementation("io.github.g00fy2:versioncompare:1.5.0")
}
```
**Maven:**
```
</details>
<details>
<summary>Maven</summary>

```xml
<dependency>
<groupId>io.github.g00fy2</groupId>
<artifactId>versioncompare</artifactId>
<version>1.4.1</version>
<version>1.5.0</version>
</dependency>
```
</details>

> ⚠️ Starting with version 1.4.0 this library moved to MavenCentral. As a result the *groupId* had to be changed. If you use the old `com.g00fy2:versioncompare` artifact check out the migration guide in the [release notes](https://github.com/G00fY2/version-compare/releases/tag/1.4.0).
## Usage
To compare two version strings just create a new Version object. Invalid inputs (*null* or non-numeric first char) will by default be handled as `0.0.0`.

<details open>
<summary>Kotlin</summary>

You can use the default [comparison operators](https://kotlinlang.org/docs/operator-overloading.html#comparison-operators) to compare version objects:

```kotlin
var result: Boolean

result = Version("1.2.1") > Version("1.2") // result = true

result = Version("1.0.2-rc2") < Version("1.0.2-rc3") // result = true

result = Version("1.3") == Version("1.3.0") // result = true

result = Version("2.1.0") >= Version("2.0") // result = true

result = Version("2.0.0-beta") >= Version("2.0") // result = false
result = Version("2.0.0-beta").isAtLeast("2.0", /* ignoreSuffix: */ true) // result = true
```
</details>

<details>
<summary>Java</summary>

```java
boolean result;

Expand All @@ -38,6 +71,7 @@ result = new Version("1.3").isEqual("1.3.0"); // result = true
result = new Version("2.0.0-beta").isAtLeast("2.0"); // result = false
result = new Version("2.0.0-beta").isAtLeast("2.0", /* ignoreSuffix: */ true); // result = true
```
</details>

### For more detailed usage, check out the [documentation](https://g00fy2.github.io/version-compare/io/github/g00fy2/versioncompare/Version.html).

Expand Down Expand Up @@ -90,7 +124,7 @@ suffix compare logic ||
## Sample App
![Image](https://raw.githubusercontent.com/G00fY2/version-compare/gh-pages/images/version_compare_sampleapp_framed.png)

**Try out the sample app to compare your version inputs: [Download APK](https://github.com/G00fY2/version-compare/releases/download/1.4.1/version-compare-1.4.1-sample.apk)**
**Try out the sample app to compare your version inputs: [Download APK](https://github.com/G00fY2/version-compare/releases/download/1.5.0/version-compare-1.5.0-sample.apk)**

## License
Copyright (C) 2021 Thomas Wirth
Expand Down
26 changes: 8 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("com.android.application") version "4.1.3" apply false
kotlin("android") version "1.4.32" apply false
id("org.sonarqube") version "3.1.1"
id("com.android.application") version "7.0.4" apply false
kotlin("android") version "1.6.10" apply false
id("org.sonarqube") version "3.3"
}

subprojects {
apply(plugin = "org.sonarqube")

sonarqube {
if (name == "sample") {
isSkipProject = true
} else {
properties {
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco/test/jacocoTestReport.xml")
}
}
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
if (name == "sample") {
sonarqube.isSkipProject = true
} else {
sonarqube.properties {
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco/test/jacocoTestReport.xml")
}
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 10e9907

Please sign in to comment.