Skip to content

Commit

Permalink
Merge pull request #236 from cyface-de/release-7.0.0_DAT-857
Browse files Browse the repository at this point in the history
Release 7.0.0 dat 857
  • Loading branch information
hb0 authored Jan 5, 2022
2 parents 3380d23 + 49a6176 commit 168204e
Show file tree
Hide file tree
Showing 137 changed files with 3,620 additions and 4,165 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
# This workflow ensures the building step works
#
# @author Armin Schnabel
# @version 1.0.1
# @version 1.0.2
# @since 5.0.0
name: Gradle Build

on:
push:
branches:
- main
- 'release/**'
- release
pull_request:
branches:
- main
- 'release/**'
- release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'zulu'
java-version: '11'

- name: Create empty truststore file
run: |
# When no truststore is required by the server we create an empty file or else the build fails
mkdir -p synchronization/src/main/res/raw
touch synchronization/src/main/res/raw/truststore.jks
- name: Create local.properties with a read token
- name: Add gradle.properties
run: |
# Use a personal read token to install the Cyface Utils package
echo "github.user=${{ secrets.GITHUB_READ_ACCOUNT }}" > local.properties
echo "github.token=${{ secrets.GITHUB_READ_TOKEN }}" >> local.properties
cp gradle.properties.template gradle.properties
echo "githubUser=${{ secrets.GH_READ_ACCOUNT }}" >> gradle.properties
echo "githubToken=${{ secrets.GH_READ_TOKEN }}" >> gradle.properties
- name: Build with Gradle
run: ./gradlew build
57 changes: 27 additions & 30 deletions .github/workflows/gradle_publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This workflow publishes a new version to the Github Registry.
#
# @author Armin Schnabel
# @version 1.0.0
# @since 5.0.0-beta2
# @version 1.0.1
# @since 5.0.0
name: Gradle Publish

on:
Expand All @@ -15,34 +15,31 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- name: Create empty truststore file
run: |
# When no truststore is required by the server we create an empty file or else the build fails
mkdir -p synchronization/src/main/res/raw
touch synchronization/src/main/res/raw/truststore.jks
- name: Add gradle.properties
run: |
# Use the repository's automatically set up token to pushlish to the registry
cp gradle.properties.template gradle.properties
echo "githubUser=${{ github.actor }}" >> gradle.properties
echo "githubToken=${{ secrets.GITHUB_TOKEN }}" >> gradle.properties
- name: Create local.properties with a repository token
run: |
# Use the repository's automatically set up token to pushlish to the registry
echo "github.user=cyface-de" > local.properties
echo "github.token=${{ secrets.GITHUB_TOKEN }}" >> local.properties
- name: Publish with Gradle
run: ./gradlew publishAll
- name: Publish with Gradle
run: ./gradlew publishAll

# Automatically mark this tag as release on Github
- uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
# Release tags of format `1.2.3-beta1 / -alpha1 / -test1` are considered a pre-release
prerelease: ${{ contains(github.ref, 'test') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Automatically mark this tag as release on Github
- uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
# Release tags of format `1.2.3-beta1 / -alpha1 / -test1` are considered a pre-release
prerelease: ${{ contains(github.ref, 'test') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ synchronization/src/main/res/raw/**/*.jks
synchronization/src/main/res/raw/**/*.cer
synchronization/src/main/res/raw/**/*.pem

# Only version gradle.properties.template
/gradle.properties

# git backup files
*.orig
46 changes: 13 additions & 33 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To use it as a dependency in your app you need to:
. Make sure you are authenticated to the repository:
** You need a Github account with read-access to this Github repository
** Create a https://github.com/settings/tokens[personal access token on Github] with "read:packages" permissions
** Create or adjust a `local.properties` file in the project root containing:
** Create or adjust a `gradle.properties` file in the project root containing:

+
----
Expand All @@ -33,19 +33,17 @@ To use it as a dependency in your app you need to:

+
----
def properties = new Properties()
properties.load(new FileInputStream("local.properties"))
repositories {
// Other maven repositories, e.g.:
jcenter()
google()
mavenCentral()
gradlePluginPortal()
// Repository for this library
maven {
url = uri("https://maven.pkg.github.com/cyface-de/android-backend")
credentials {
username = properties.getProperty("github.user")
password = properties.getProperty("github.token")
username = project.findProperty("github.user")
password = project.findProperty("github.token")
}
}
}
Expand All @@ -55,22 +53,21 @@ To use it as a dependency in your app you need to:
----
dependencies {
# To use the 'movebis' flavour, use: 'datacapturingmovebis'
implementation "de.cyface:datacapturing:$cyfaceBackendVersion"
implementation "de.cyface:datacapturing:$cyfaceAndroidBackendVersion"
# To use the 'movebis' flavour, use: 'synchronizationmovebis'
implementation "de.cyface:synchronization:$cyfaceBackendVersion"
implementation "de.cyface:synchronization:$cyfaceAndroidBackendVersion"
# There is only one 'persistence' flavor
implementation "de.cyface:persistence:$cyfaceBackendVersion"
implementation "de.cyface:persistence:$cyfaceAndroidBackendVersion"
}
----

. Set the `$cyfaceBackendVersion` gradle variable to the https://github.com/cyface-de/android-backend/releases[latest version].
. Set the `$cyfaceAndroidBackendVersion` gradle variable to the https://github.com/cyface-de/android-backend/releases[latest version].

[[api-usage-guide]]
== API Usage Guide

* <<collector-compatibility,Collector Compatibility>>
* <<resource-files,Resource Files>>
** <<truststore,Truststore>>
** <<content-provider-authority,Content Provider Authority>>
* <<service-initialization,Service Initialization>>
** <<implement-ui-listener,Implement UI Listener>>
Expand Down Expand Up @@ -104,23 +101,6 @@ This SDK is compatible with our https://github.com/cyface-de/data-collector/rele

The following steps are required before you can start coding.

[[truststore]]
==== Truststore

Geo location tracks such as those captured by the Cyface Android SDK, should only be transmitted
via a secure HTTPS connection.

If you use a self-signed certificate the SDK requires a truststore containing the key of the server
you are transmitting to.

Since we can not know which public key your server uses, this must be provided by you.
To do so place a truststore containing your key in:

synchronization/src/main/res/raw/truststore.jks

If this (by default empty) file is not replaced, the SDK can only communicate with
servers which are certified by one of its trusted Certification Authorities.

[[content-provider-authority]]
==== Content Provider Authority

Expand Down Expand Up @@ -674,7 +654,7 @@ The `loadTracks()` method returns a chronologically ordered list of ``Track``s.

Each time a measurement is paused and resumed, a new `Track` is started for the same measurement.

A `Track` contains the chronologically ordered ``GeoLocation``s captured.
A `Track` contains the chronologically ordered ``ParcelableGeoLocation``s captured.

You can ether load the raw track or a "cleaned" version of it. See the `DefaultLocationCleaningStrategy` class for details.

Expand Down Expand Up @@ -855,11 +835,11 @@ the https://github.com/cyface-de/android-backend/packages[Github Registry]
. Make sure you are authenticated to the repository:
* You need a Github account with write-access to this Github repository
* Create a https://github.com/settings/tokens[personal access token on Github] with "write:packages" permissions
* Create or adjust a `local.properties` file in the project root containing:
* Copy `gradle.properties.template` to `gradle.properties` and adjust:
+
....
github.user=YOUR_USERNAME
github.token=YOUR_ACCESS_TOKEN
githubUser=YOUR_USERNAME
githubToken=YOUR_ACCESS_TOKEN
....
. Execute the publish command `./gradlew publishAll`

Expand Down
51 changes: 28 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 Cyface GmbH
* Copyright 2017-2021 Cyface GmbH
*
* This file is part of the Cyface SDK for Android.
*
Expand All @@ -21,65 +21,71 @@
*
* @author Armin Schnabel
* @author Klemens Muthmann
* @version 2.7.5
* @version 2.8.0
* @since 1.0.0
*/

buildscript {
ext.gradle_version = "7.0.4"

repositories {
google()
jcenter()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "com.android.tools.build:gradle:$gradle_version"
}
}

ext {
// This libraries version
cyfaceBackendVersion = "6.2.0" // Only increase in release branch. Not merged back to `main`
cyfaceAndroidBackendVersion = "7.0.0"

// Cyface dependencies
cyfaceUtilsVersion = "2.0.1"
cyfaceUtilsVersion = "3.2.2"
cyfaceSerializationVersion = "1.0.2"

// Android SDK versions
minSdkVersion = 21
targetSdkVersion = 30
compileSdkVersion = 30
buildToolsVersion = '30.0.3'

androidxAnnotationVersion = "1.0.0"
androidxAppCompatVersion = "1.2.0"
// Android dependencies
androidxAnnotationVersion = "1.3.0"
androidxAppCompatVersion = "1.3.1" // 1.4.0 leads to an error in `gradle verifyReleaseResources`
localbroadcastmanagerVersion = "1.0.0"

// testing
junitVersion = "1.1.2"
// Other dependencies
googleApiClientVersion = '1.31.5' // transmission protocol

// Testing
junitVersion = "1.1.3"
mockitoVersion = "3.3.3"
hamcrestVersion = "1.3"
rulesVersion = "1.3.0"
robolectricVersion = "4.5.1"
rulesVersion = "1.4.0"
robolectricVersion = "4.6.1"
androidxTestCoreVersion = "1.1.0"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

// Load credentials
def properties = new Properties()
properties.load(new FileInputStream("local.properties"))

allprojects {
repositories {
// Needed to resolve newest support libraries with IntelliJ / Gradle
google()
jcenter()
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://maven.pkg.github.com/cyface-de/android-utils")
// Needed even for public projects: https://github.community/t5/GitHub-API-Development-and/Download-from-Github-Package-Registry-without-authentication/m-p/35255
credentials {
username = properties.getProperty("github.user")
password = properties.getProperty("github.token")
username = project.findProperty("githubUser")
password = project.findProperty("githubToken")
}
}
}
Expand Down Expand Up @@ -110,5 +116,4 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

// The gradle publish tasks is defined in a separate file:
apply from: 'publish.gradle'

Loading

0 comments on commit 168204e

Please sign in to comment.