From 2d6bffa599b8f4ac0561c84d93e835e9552410dd Mon Sep 17 00:00:00 2001 From: Artem IG Date: Thu, 20 Oct 2022 21:24:49 +0300 Subject: [PATCH 1/2] upd --- README.md | 21 +++++++++++++++++++-- build.gradle.kts | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7a3eebb..206c96d 100644 --- a/README.md +++ b/README.md @@ -24,16 +24,33 @@ builds a local copy of the Maven package. ## Install and run +### Command line + +``` +wget https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar +``` + +Run: + +``` +java -jar mavence.jar +``` + + +### Manually + Just get the latest [mavence.jar](https://github.com/rtmigo/mavence/releases/latest/download/mavence.jar) from the [releases page](https://github.com/rtmigo/mavence/releases). -Run with +Run: ``` -java -jar mavence.jar +java -jar ~/Downloads/mavence.jar ``` + + ## Setting the environment Before publishing, you will need to set the following four environment diff --git a/build.gradle.kts b/build.gradle.kts index 27f8403..65acf41 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0") // testing testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.0") // testing - testImplementation("io.kotest:kotest-assertions-core:5.5.1")// testing + testImplementation("io.kotest:kotest-assertions-core:5.5.1") // testing implementation("com.github.pgreze:kotlin-process:1.4") // running processes implementation("com.github.aballano:mnemonik:2.1.1") // caching function results From d37c3fc55f35a0351cfd799fb8a93731ddd72f30 Mon Sep 17 00:00:00 2001 From: Artem IG Date: Thu, 20 Oct 2022 21:46:06 +0300 Subject: [PATCH 2/2] !!release --- README.md | 2 +- build.gradle.kts | 2 +- src/main/kotlin/Build.kt | 2 +- src/main/kotlin/maven/MavenLocal.kt | 5 +++++ src/main/kotlin/stages/build/Building.kt | 2 +- src/test/python/test_uber.py | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 206c96d..13d819a 100644 --- a/README.md +++ b/README.md @@ -347,7 +347,7 @@ Output: "artifact": "thelib", "version": "0.1.2", "notation": "my.domain:thelib:0.1.2", - "mavenRepo": "file:///home/doe/.m2" + "mavenRepo": "file:///home/doe/.m2/repository" } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 65acf41..35f0f78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "io.github.rtmigo" -version = "0.1.2-SNAPSHOT" +version = "0.1.2" // -SNAPSHOT repositories { mavenCentral() diff --git a/src/main/kotlin/Build.kt b/src/main/kotlin/Build.kt index 792ee79..9a88bdc 100644 --- a/src/main/kotlin/Build.kt +++ b/src/main/kotlin/Build.kt @@ -1,5 +1,5 @@ // DO NOT EDIT. Generated by Gradle task "generateBuildKt" object Build { - const val version = "0.1.1" + const val version = "0.1.2-SNAPSHOT" const val date = "2022-10-20" } \ No newline at end of file diff --git a/src/main/kotlin/maven/MavenLocal.kt b/src/main/kotlin/maven/MavenLocal.kt index 232ab3d..c5aa441 100644 --- a/src/main/kotlin/maven/MavenLocal.kt +++ b/src/main/kotlin/maven/MavenLocal.kt @@ -6,12 +6,17 @@ package maven import org.jsoup.Jsoup +import java.net.URI import java.nio.file.* import kotlin.io.path.* val m2: Path = Paths.get(System.getProperty("user.home") + "/.m2") val m2str = m2.toString() +val mavenLocalUrl: URI by lazy { + URI("file://"+m2.resolve("repository").toString()) +} + data class MetadataLocalXmlFile(val file: Path) { init { diff --git a/src/main/kotlin/stages/build/Building.kt b/src/main/kotlin/stages/build/Building.kt index 9610c08..6a00cbf 100644 --- a/src/main/kotlin/stages/build/Building.kt +++ b/src/main/kotlin/stages/build/Building.kt @@ -49,7 +49,7 @@ suspend fun cmdLocal(ga: GroupArtifact, isFinal: Boolean = false): MavenArtifact version = nota.version.string, artifact = nota.artifact.string, notation = nota.toString(), - mavenRepo = "file://$m2str" + mavenRepo = mavenLocalUrl.toASCIIString() //"file://$m2str" ) )) } diff --git a/src/test/python/test_uber.py b/src/test/python/test_uber.py index acabe63..b3c7629 100644 --- a/src/test/python/test_uber.py +++ b/src/test/python/test_uber.py @@ -21,7 +21,7 @@ def test_build_local(self): self.assertEqual(js["group"], 'io.github.rtmigo') self.assertEqual(js["artifact"], 'libr') self.assertTrue(js["mavenRepo"].startswith('file://')) - self.assertTrue(js["mavenRepo"].endswith('/.m2')) + self.assertTrue(js["mavenRepo"].endswith('/.m2/repository')) self.assertEqual(js["notation"], 'io.github.rtmigo:libr:1.2.3-rc2')