From e2291dca3ac16ceb8c21908f818a0cad9d1ee00a Mon Sep 17 00:00:00 2001 From: bvn13 Date: Thu, 29 Sep 2022 19:36:32 +0300 Subject: [PATCH 1/3] Update for next development version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d7f397..812e383 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ GpxAndroidSdk me.bvn13.sdk.android.gpx - 1.2 + 1.3-SNAPSHOT jar From f4ef4beb6b545154a797b45fbcb12af428627b88 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Thu, 29 Sep 2022 20:42:18 +0300 Subject: [PATCH 2/3] fixed line formatting at trkpt --- check-publication.sh | 27 +++++++ .../me/bvn13/sdk/android/gpx/GpxWriter.kt | 2 +- .../me/bvn13/sdk/android/gpx/GpxWriterTest.kt | 74 +++++++++++++++++++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100755 check-publication.sh diff --git a/check-publication.sh b/check-publication.sh new file mode 100755 index 0000000..adf3557 --- /dev/null +++ b/check-publication.sh @@ -0,0 +1,27 @@ +read -p "version to check > " version +echo "entered version = $version" +url="https://repo1.maven.org/maven2/me/bvn13/sdk/android/gpx/GpxAndroidSdk/${version}/" +echo "checking $url" + +check(){ + echo $(curl -sL -w "%{http_code}\\n" "$url" -o /dev/null) +} + +count=0 +until [ $count -gt 1000 ] || [ "$(check)" == "200" ] +do + code=$(check) + echo "try $count - response $code" + ping -c 2 127.0.0.1 > /dev/null + count=$((count+1)) +done + +code=$(check) +if [ "$code" == "200" ] +then + echo "$code is 200" + notify-send -a MAVEN -t 500 'GpxAndroidSdk' "version $version is published" +else + echo "$code is not 200" + notify-send -a MAVEN -t 500 -u critical 'GpxAndroidSdk' "failed to publish $version version" +fi \ No newline at end of file diff --git a/src/main/kotlin/me/bvn13/sdk/android/gpx/GpxWriter.kt b/src/main/kotlin/me/bvn13/sdk/android/gpx/GpxWriter.kt index 67cc664..38095a1 100644 --- a/src/main/kotlin/me/bvn13/sdk/android/gpx/GpxWriter.kt +++ b/src/main/kotlin/me/bvn13/sdk/android/gpx/GpxWriter.kt @@ -195,7 +195,7 @@ fun TrksegType.toXmlString() = """ """.trim().removeEmptyStrings() -fun List.toXmlString(nodeName: String?) = this.joinToString(prefix = "\n", postfix = "", separator = "") { +fun List.toXmlString(nodeName: String?) = this.joinToString(prefix = "\n", postfix = "", separator = "\n") { it.toXmlString(nodeName) } diff --git a/src/test/kotlin/me/bvn13/sdk/android/gpx/GpxWriterTest.kt b/src/test/kotlin/me/bvn13/sdk/android/gpx/GpxWriterTest.kt index ce1807e..21a683f 100644 --- a/src/test/kotlin/me/bvn13/sdk/android/gpx/GpxWriterTest.kt +++ b/src/test/kotlin/me/bvn13/sdk/android/gpx/GpxWriterTest.kt @@ -277,6 +277,49 @@ class GpxWriterTest { trkseg = listOf( TrksegType( listOf( + WptType( + lat = 14.64736838389662, + lon = 7.93212890625, + ele = 10.toDouble(), + time = OffsetDateTime.now(clock), + magvar = 3.toDouble(), + geoidheight = 45.toDouble(), + name = "test point 1", + cmt = "comment 1", + desc = "description of point 1", + link = listOf( + LinkType( + href = "http://link-to.site.href", + text = "text", + type = "hyperlink" + ), + LinkType( + href = "http://link2-to.site.href", + text = "text2", + type = "hyperlink2" + ) + ), + src = "source 1", + sym = "sym 1", + type = "type 1", + fix = FixType.DGPS, + sat = 1, + hdop = 55.toDouble(), + vdop = 66.toDouble(), + pdop = 77.toDouble(), + ageofgpsdata = 44, + dgpsid = 88, + extensions = listOf( + ExtensionType( + "extension1", + parameters = mapOf(Pair("first", "second"), Pair("third", "fours")) + ), + ExtensionType( + "extension2", + parameters = mapOf(Pair("aa", "bb"), Pair("cc", "dd")) + ) + ) + ), WptType( lat = 14.64736838389662, lon = 7.93212890625, @@ -460,6 +503,37 @@ class GpxWriterTest { + + 10.0 + + 3.0 + 45.0 + test point 1 + comment 1 + description of point 1 + source 1 + + text + hyperlink + + + text2 + hyperlink2 + + sym 1 + type 1 + dgps + 1 + 55.0 + 66.0 + 77.0 + 44 + 88 + + + + + From 1c72f6f8ffa248853f7cfd5e9d61efe9142c8007 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Thu, 29 Sep 2022 20:42:32 +0300 Subject: [PATCH 3/3] Update versions for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 812e383..6254e0b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ GpxAndroidSdk me.bvn13.sdk.android.gpx - 1.3-SNAPSHOT + 1.3 jar