Merge branch 'release/1.3'

This commit is contained in:
bvn13 2022-09-29 20:42:54 +03:00
commit 4c7e3339e1
4 changed files with 103 additions and 2 deletions

27
check-publication.sh Executable file
View File

@ -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

View File

@ -6,7 +6,7 @@
<artifactId>GpxAndroidSdk</artifactId>
<groupId>me.bvn13.sdk.android.gpx</groupId>
<version>1.2</version>
<version>1.3</version>
<packaging>jar</packaging>

View File

@ -195,7 +195,7 @@ fun TrksegType.toXmlString() = """
</trkseg>
""".trim().removeEmptyStrings()
fun List<WptType>.toXmlString(nodeName: String?) = this.joinToString(prefix = "\n", postfix = "", separator = "") {
fun List<WptType>.toXmlString(nodeName: String?) = this.joinToString(prefix = "\n", postfix = "", separator = "\n") {
it.toXmlString(nodeName)
}

View File

@ -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 {
<extension2 aa="bb" cc="dd"></extension2>
</extensions>
</trkpt>
<trkpt lat="14.64736838389662" lon="7.93212890625">
<ele>10.0</ele>
<time>2022-09-24T15:04:00+03:00</time>
<magvar>3.0</magvar>
<geoidheight>45.0</geoidheight>
<name>test point 1</name>
<cmt>comment 1</cmt>
<desc>description of point 1</desc>
<src>source 1</src>
<link href="http://link-to.site.href">
<text>text</text>
<type>hyperlink</type>
</link>
<link href="http://link2-to.site.href">
<text>text2</text>
<type>hyperlink2</type>
</link>
<sym>sym 1</sym>
<type>type 1</type>
<fix>dgps</fix>
<sat>1</sat>
<hdop>55.0</hdop>
<vdop>66.0</vdop>
<pdop>77.0</pdop>
<ageofgpsdata>44</ageofgpsdata>
<dgpsid>88</dgpsid>
<extensions>
<extension1 first="second" third="fours"></extension1>
<extension2 aa="bb" cc="dd"></extension2>
</extensions>
</trkpt>
</trkseg>
</trk>
</gpx>