chore: adapt android scripts to use maven central (#307)

The main changes here are two. First, tweak some bits of the POM template
to make sure it's current, including referencing the correct repo. (We were
still referencing probe-engine in there, weirdly enough).

Second, change the android build script to create the same bundle that
mavan would build. What remains to do is uploading manually.

(Because it seems my PGP key is required, I guess this development rules
out automatically generating releases at GitHub. We will see about it
later on and possibly zap the publish-android.sh script.)

Reference issue: https://github.com/ooni/probe/issues/1437.

The release 2021.04.07-180801 has been created by me using this
diff from the v3.9.0 tag. I will update the release notes as soon
as this new release becomes available from Maven Central.
This commit is contained in:
Simone Basso 2021-04-07 20:46:11 +02:00 committed by GitHub
parent 54e590b776
commit 04ea3fca43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 6 deletions

View File

@ -2,13 +2,16 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.ooni</groupId>
<artifactId>oonimkall</artifactId>
<version>@VERSION@</version>
<packaging>aar</packaging>
<name>oonimkall</name>
<description>OONI Probe Engine for Android</description>
<url>https://github.com/ooni/probe-engine</url>
<description>OONI Probe for Android</description>
<url>https://github.com/ooni/probe-cli</url>
<licenses>
<license>
<name>The 3-Clause BSD License</name>
@ -16,18 +19,21 @@
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/ooni/probe-engine</url>
<connection>https://github.com/ooni/probe-engine.git</connection>
</scm>
<developers>
<developer>
<name>Simone Basso</name>
<email>simone@openobservatory.org</email>
<roles>
<role>developer</role>
<role>Core developer</role>
</roles>
<timezone>Europe/Rome</timezone>
</developer>
</developers>
</project>

View File

@ -2,7 +2,7 @@
set -e
if [ -z "$ANDROID_HOME" -o "$1" = "--help" ]; then
echo ""
echo "usage: $0"
echo "usage: $0 [--sign]"
echo ""
echo "Please set ANDROID_HOME. We assume you have installed"
echo "the Android SDK. You can do that on macOS using:"
@ -27,5 +27,16 @@ set -x
export PATH=$(go env GOPATH)/bin:$PATH
go get -u golang.org/x/mobile/cmd/gomobile
gomobile init
output=MOBILE/android/oonimkall.aar
gomobile bind -target=android -o $output -ldflags="-s -w" ./pkg/oonimkall
version=$(date -u +%Y.%m.%d-%H%M%S)
aarfile=MOBILE/android/oonimkall-$version.aar
gomobile bind -target=android -o $aarfile -ldflags="-s -w" ./pkg/oonimkall
pomfile=./MOBILE/android/oonimkall-$version.pom
pomtemplate=./MOBILE/template.pom
cat $pomtemplate|sed "s/@VERSION@/$version/g" > $pomfile
if [ "$1" == "--sign" ]; then
cd ./MOBILE/android
for file in `ls *`; do
gpg -ab -u simone@openobservatory.org $file
done
jar -cvf bundle.jar oonimkall-$version*
fi