From 69ceb30a2825e02b632fa26a47bd3d37f444a926 Mon Sep 17 00:00:00 2001 From: Jilles van Gurp Date: Mon, 24 Aug 2020 17:57:14 +0200 Subject: [PATCH] use my own website for publishing jars --- .gitignore | 1 + README.md | 26 +++++++++++++++++++++++--- build.gradle.kts | 7 +------ gradle.properties | 2 +- publish.sh | 15 +++++++++++++++ 5 files changed, 41 insertions(+), 10 deletions(-) create mode 100755 publish.sh diff --git a/.gitignore b/.gitignore index bdd100e..2afc3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ test-output build out .kotlintest +localRepo diff --git a/README.md b/README.md index eca4a09..1dd4652 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ![Java CI with Gradle](https://github.com/jillesvangurp/geogeometry/workflows/Java%20CI%20with%20Gradle/badge.svg) -[![](https://jitpack.io/v/jillesvangurp/geogeometry.svg)](https://jitpack.io/#jillesvangurp/geogeometry) # Introduction @@ -57,9 +56,30 @@ with this approach is that details that are too small, are not covered by hashes # Get it -Use the latest jitpack releases: +This is a kotlin multiplatform distribution with packages for `-jvm` and `-js` (currently). Currently, +multiplatform does not work with `jitpack.io` which I use on other projects. Older versions are still +available on [jitpack](https://jitpack.io/#jillesvangurp/geogeometry/v3.1.1). If you are interested, +there's an [open bug for this](https://github.com/jitpack/jitpack.io/issues/3853). -[![](https://jitpack.io/v/jillesvangurp/geogeometry.svg)](https://jitpack.io/#jillesvangurp/geogeometry) +So, as a workaround, I currently distribute jars via my website. To add the repository, add something +like this to your `build.gradle.kts` file: + +```kotlin +repositories { + mavenCentral() + maven { url = uri("https://www.jillesvangurp.com/maven") } +} +``` + +and then add the dependency: + +```kotlin +implementation("com.github.jillesvangurp:geogeometry:3.1.5") +``` + +For older versions of gradle you may have to specify a postfix `-jvm` or `-js`. Supposedly recent versions are smarter about figuring out multiplatform. + +Let me know if you have issues accessing. # Building from source diff --git a/build.gradle.kts b/build.gradle.kts index 86f083d..4d51277 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,3 @@ -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.api.tasks.testing.logging.TestLogEvent - plugins { kotlin("multiplatform") version "1.3.72" id("com.github.ben-manes.versions") version "0.28.0" // gradle dependencyUpdates -Drevision=release @@ -12,8 +9,6 @@ repositories { mavenCentral() maven(url = "https://jitpack.io") } -group = "com.github.jillesvangurp" -version = "0.1-SNAPSHOT" val kotlinVersion = "1.3.72" val slf4jVersion = "1.7.26" @@ -98,7 +93,7 @@ kotlin { publishing { repositories { maven { - url = uri("file://$buildDir/localRepo") + url = uri("file://$projectDir/localRepo") } } } diff --git a/gradle.properties b/gradle.properties index 9b69abd..eb1f4a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=0.0.1-SNAPSHOT +version=0.0.0.1-SNAPSHOT group=com.github.jillesvangurp diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..9767253 --- /dev/null +++ b/publish.sh @@ -0,0 +1,15 @@ +#! /usr/bin/env bash + +die () { + echo >&2 "$@" + exit 1 +} + +[ "$#" -eq 1 ] || die "1 argument required, $# provided" +echo $1 | grep -E -q '^[0-9]+\.[0-9]+(\.[0-9]+)$' || die "Semantic Version argument required, $1 provided" + +export TAG=$1 +echo "publishing $TAG" + +gradle -Pgroup=com.github.jillesvangurp -Pversion=$TAG publish +rsync -azp localrepo/* jillesvangurpcom@ftp.jillesvangurp.com:/srv/home/jillesvangurpcom/domains/jillesvangurp.com/htdocs/www/maven \ No newline at end of file