Skip to content

How to build this project

Uatschitchun edited this page Oct 4, 2021 · 6 revisions

Get the source

Submodules are used (previously also LFS), clone and update submodules.

Run the following command to get all submodules:

git submodule init && git submodule update

Android Studio

To build with Android Studio:

  1. Download Android studio here:

    http://developer.android.com/sdk/installing/studio.html

  2. When Android Studio is started

    • choose import project and pick the build.gradle file inside the runnerup folder or
    • fork the github repo and import from github into Android studio
  3. If Android Studio asks about what gradle to use, choose "gradle wrapper".

  4. Let Android Studio sync the project

  5. Press on the play button and the project should compile and deploy to your device!

Free version

RunnerUp uses a few external libraries like Google Play Services and ANT+. The F-Droid version is not allowed to include those libraries, so the app deletes the libs when building. See the F-Droid build script too: https://gitlab.com/fdroid/fdroiddata/tree/master/metadata

org.runnerup.free

It's needed to add org.runnerup.free=true to gradle.properties file

The Download of Mapbox will fail without proper key. Setting this property in gradle.properties builds without Mapbox

Required keys

Even if the source is open (except the external libraries), the client secrets to access services are not open but private to the builder. This especially applies to the Play release key, only available for the maintainer. Some other keys can be added manually.

Mapbox

RunnerUp uses a free account, that may run out of quota.

The route or path of an activity or workout is displayed via the Mapbox Map SDK. You will need a mapbox account and an access token to build the app with a map view included. Choose as scope of the token styles:read and fonts:read (should be enough). Create the file mapbox.properties in the root of your project and put there your token you've created for runnerup:

mapboxAccessToken="<token>"

See also the build configuration file app/build.gradle where the mapbox.properties file is read.

RunAlyze

By default, upload to RunAlyze is possible to the testing server. To update to the live server, contact the RunAlyze team to get a client secret/id. This is likely only granted if you are doing a permanent fork of the application. Add the following to runalyze.properties

CLIENT_ID="<your id>"
CLIENT_SECRET="<your secret>"

DropBox

Register an app at https://www.dropbox.com/developers/apps/

Add the id/secret to dropbox.properties similar as for RunAlyze.

Publish

Checks

Travis builds run builds with Lint and a few tests, should be OK.

Check the ProGuard configuration for errors. R8 is enabled by default but there are not

./gradlew app:minifyLatestReleaseWithProguard

A cleanup for MapBox may be needed.

Release builds

To create the GitHub release:

./gradlew app:assembleLatestRelease

Create release

To create the app bundle for Google Play:

./gradlew app:bundleLatestRelease

F-Droid releases are built when creating a tag for a release. Buildserver output almost realtime: https://f-droid.org/wiki/index.php?title=Special:RecentChanges&days=30&from=&hidebots=0&hideanons=1&hideliu=1&limit=500

Latest build

Clone this wiki locally