From fee58724ff99ee82ba0c2d0950ddcd35058ced34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JUAN=20CASTA=C3=91EDA?= Date: Fri, 1 Sep 2023 14:51:05 +0200 Subject: [PATCH] Added version --- Makefile | 8 ++++++++ lib/build.gradle.kts | 6 +++++- lib/src/test/java/com/jimdo/jcountry/JCountryTest.java | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c96bc01..2b88125 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ target_data_directory := lib/src/main/resources/ target_po_directory := lib/src/main/resources/iso_3166/ target_po_639_directory := lib/src/main/resources/iso_639/ +ARTIFACT_VERSION=$(shell git tag --sort=committerdate | grep -E '[0-9]' | tail -1 | cut -b 2-7) + .PHONY: clone-iso-codes clone-iso-codes: git clone https://github.com/sailfishos-mirror/iso-codes.git @@ -28,3 +30,9 @@ delete-po-and-mo: .PHONY: get-latest-iso-files get-latest-iso-files: clone-iso-codes transpile-translations delete-po-and-mo + +.PHONY: publish +publish: + @echo "[make]Publishing version $(ARTIFACT_VERSION)" + ARTIFACT_VERSION=$(ARTIFACT_VERSION) ./gradlew testVersion + ARTIFACT_VERSION=$(ARTIFACT_VERSION) ./gradlew publish \ No newline at end of file diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index a92a60c..d63c9c5 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -7,7 +7,7 @@ * This project uses @Incubating APIs which are subject to change. */ group = "com.jimdo" - +version = System.getenv("ARTIFACT_VERSION") + ".0.0" plugins { // Apply the java-library plugin for API and implementation separation. `java-library` @@ -32,6 +32,10 @@ tasks.withType { } } +tasks.register("testVersion") { + println("The package version is: " + version) +} + ////////////////////////////////////////// // Publish and signature configuration. // ////////////////////////////////////////// diff --git a/lib/src/test/java/com/jimdo/jcountry/JCountryTest.java b/lib/src/test/java/com/jimdo/jcountry/JCountryTest.java index 74b05ba..40d404d 100644 --- a/lib/src/test/java/com/jimdo/jcountry/JCountryTest.java +++ b/lib/src/test/java/com/jimdo/jcountry/JCountryTest.java @@ -59,7 +59,6 @@ void testJCountryReadsTranslations() { languages.forEach( it -> { Optional bundle = countryDB.getCountriesTranslations(new Locale(it)); - System.out.println(it); assertTrue(!bundle.isEmpty()); }); } @@ -115,7 +114,6 @@ void testJCountryLanguagesReadsTranslations() { languages.forEach( it -> { Optional bundle = languageDB.getLanguagesTranslations(new Locale(it)); - System.out.println(it); assertTrue(!bundle.isEmpty(), it + " translation"); }); }