Skip to content

Commit

Permalink
Merge d37c3fc into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 20, 2022
2 parents c33a1cd + d37c3fc commit 8d5f4fe
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -330,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"
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "io.github.rtmigo"
version = "0.1.2-SNAPSHOT"
version = "0.1.2" // -SNAPSHOT

repositories {
mavenCentral()
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/Build.kt
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 5 additions & 0 deletions src/main/kotlin/maven/MavenLocal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/stages/build/Building.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
))
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/python/test_uber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down

0 comments on commit 8d5f4fe

Please sign in to comment.