Skip to content

Commit

Permalink
Merge pull request #322 from ZeusWPI/update-master
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
niknetniko authored May 4, 2020
2 parents 9d1fc46 + 47fada6 commit 5bd0f5d
Show file tree
Hide file tree
Showing 430 changed files with 6,520 additions and 5,413 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Android CI

# We run the tests on master, development and for PR's.
on:
push:
branches:
- master
- development
pull_request:

jobs:
build-debug:
name: Test debug
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: debug-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
debug-${{ runner.os }}-gradle-
- name: Test with Gradle
uses: eskatos/gradle-command-action@v1
with:
arguments: testDebug
build-release:
name: Test release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: release-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
release-${{ runner.os }}-gradle-
- name: Test with Gradle
uses: eskatos/gradle-command-action@v1
with:
arguments: testRelease
34 changes: 15 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
language: android
jdk:
- oraclejdk8
sudo: false
dist: trusty
jdk: openjdk11

# See https://stackoverflow.com/a/51644855/1831741 for the Java options
env:
- COMMAND=testDebug
- COMMAND=testRelease

android:
components:
- tools
- build-tools-28.0.3
- android-28

env:
- FLAVOUR=testDebug
- FLAVOUR=testRelease
- build-tools-29.0.2
- android-29
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'

script:
- "./gradlew clean $FLAVOUR --console=plain"

notifications:
email: false

#before_install:
# - yes | sdkmanager "platforms;android-28"
- ./gradlew $COMMAND

# Caching according to the docs at https://docs.travis-ci.com/user/languages/java/#Projects-Using-Gradle
before_cache:
Expand All @@ -30,11 +28,9 @@ cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache

# We only build on these branches and on release tags, which are tagged r[0-9]+.
# We only build on these branches.
branches:
only:
- master
- development
- /^r\d+$/
88 changes: 42 additions & 46 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ apply plugin: 'io.fabric'
def props = loadProperties()

android {
compileSdkVersion 28
compileSdkVersion 29
buildToolsVersion "29.0.2"

// Use resources in robolectric
testOptions.unitTests.includeAndroidResources = true

//noinspection GroovyMissingReturnStatement
defaultConfig {
applicationId "be.ugent.zeus.hydra"
minSdkVersion 16
targetSdkVersion 28
versionCode 21211
versionName "2.12.1"
targetSdkVersion 29
versionCode 21400
versionName "2.14"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -30,7 +32,8 @@ android {
buildConfigField "boolean", "DEBUG_ENABLE_STRICT_MODE", props.getProperty('hydra.debug.strict_mode')
buildConfigField "boolean", "DEBUG_ENABLE_ALL_SPECIALS", props.getProperty('hydra.debug.home.stream.specials')
buildConfigField "boolean", "DEBUG_TRACK_LEAKS", props.getProperty("hydra.debug.leaks")

buildConfigField "boolean", "DEBUG_ENABLE_REPORTING", props.getProperty("hydra.debug.reporting")

// used by Room, to test migrations
javaCompileOptions {
annotationProcessorOptions {
Expand All @@ -44,6 +47,7 @@ android {
test.resources.srcDirs += files("$projectDir/schemas".toString())
}

//noinspection GroovyMissingReturnStatement
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -57,11 +61,12 @@ android {

debug {
multiDexEnabled true
// Disable crashlytics in debug builds
ext.enableCrashlytics = false
// Disable crashlytics in debug builds if necessary.
ext.enableCrashlytics = Boolean.parseBoolean(props.getProperty("hydra.debug.reporting"))
}
}

//noinspection GroovyMissingReturnStatement
testOptions {
unitTests {
includeAndroidResources = true
Expand All @@ -72,6 +77,7 @@ android {
}
}

//noinspection GroovyMissingReturnStatement
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
Expand All @@ -89,77 +95,66 @@ android {
}

dependencies {

implementation 'androidx.multidex:multidex:2.0.1'

implementation 'androidx.core:core:1.1.0'
implementation 'androidx.core:core:1.2.0'
implementation 'androidx.media:media:1.1.0'
implementation 'androidx.fragment:fragment:1.1.0'

implementation 'androidx.fragment:fragment:1.2.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'
testImplementation 'androidx.arch.core:core-testing:2.1.0'

implementation 'androidx.room:room-runtime:2.1.0'
annotationProcessor 'androidx.room:room-compiler:2.1.0'
testImplementation 'androidx.room:room-testing:2.1.0'

// Network stack
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation "androidx.lifecycle:lifecycle-common-java8:2.2.0"
implementation 'androidx.room:room-runtime:2.2.5'
annotationProcessor 'androidx.room:room-compiler:2.2.5'
// Do not upgrade beyond 3.12.x until we require API 21+
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:3.12.5'
implementation 'com.squareup.moshi:moshi:1.8.0'

implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
implementation 'com.squareup.okhttp3:okhttp:3.12.10'
implementation 'com.squareup.moshi:moshi:1.9.2'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.2'
implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'

implementation 'com.heinrichreimersoftware:material-intro:2.0.0'
implementation 'com.jonathanfinerty.once:once:1.3.0'
implementation 'com.github.captain-miao:optroundcardview:1.1.0'
implementation 'blue.aodev:material-values:1.1.1'

implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

if (props.getProperty("hydra.debug.leaks").toBoolean()) {
logger.info("Leak tracking enabled...")
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
}

//Test code
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:3.0.0'

testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:3.2.4'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'androidx.test:rules:1.2.0'
testImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
testImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'

//Enable the normal library for unit tests
testImplementation('org.threeten:threetenbp:1.4.0') {
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'androidx.room:room-testing:2.2.5'
// Enable the normal library for unit tests.
testImplementation('org.threeten:threetenbp:1.4.1') {
exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
}

testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.5'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.9'
//noinspection GradleDependency
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.6'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.12'
testImplementation 'com.github.niknetniko:GetterSetterVerifier:0.0.11'
testImplementation 'com.shazam:shazamcrest:0.11'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation 'org.jeasy:easy-random-core:4.0.0'
testImplementation 'org.jeasy:easy-random-core:4.1.0'
testImplementation 'org.apache.commons:commons-lang3:3.9'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
testImplementation 'commons-validator:commons-validator:1.6'
}

Expand Down Expand Up @@ -204,5 +199,6 @@ def loadProperties() {
tasks.withType(Test) {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
13 changes: 8 additions & 5 deletions app/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
# Any options that are not set in the custom file will be set to these defaults.
##

# Prints the internal priority with which the cards in the home feed
# are sorted.
# Prints the internal priority with which the cards in the home feed are sorted.
hydra.debug.home.stream.priority = false
# Adds an invisible request to the home feed that takes ~10 seconds to complete.
hydra.debug.home.stream.stall = false
# Force add the SKO card.
hydra.debug.home.stream.sko = false
# Add all special event cards, regardless of status
# Add all special event cards, regardless of status.
hydra.debug.home.stream.specials = false
# Enable strict mode in debug builds.
hydra.debug.strict_mode = false
# Enable memory-leak tracking with LeakyCanary
hydra.debug.leaks = false
# Enable memory-leak tracking with LeakyCanary.
hydra.debug.leaks = false
# Allow debug analytics and crash reporting.
# This should only be enabled when testing crash reporting and analytics.
# It will cause analytics and crashes from debug build to show up in Firebase.
hydra.debug.reporting = false
82 changes: 82 additions & 0 deletions app/schemas/be.ugent.zeus.hydra.common.database.Database/16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"formatVersion": 1,
"database": {
"version": 16,
"identityHash": "0dfdb937cb9a30f505938112bcd0affc",
"entities": [
{
"tableName": "feed_dismissals",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dismissal_date` TEXT NOT NULL, `card_type` INTEGER NOT NULL, `card_identifier` TEXT NOT NULL, PRIMARY KEY(`card_type`, `card_identifier`))",
"fields": [
{
"fieldPath": "dismissalDate",
"columnName": "dismissal_date",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "identifier.cardType",
"columnName": "card_type",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "identifier.identifier",
"columnName": "card_identifier",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"card_type",
"card_identifier"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_feed_dismissals_card_type",
"unique": false,
"columnNames": [
"card_type"
],
"createSql": "CREATE INDEX `index_feed_dismissals_card_type` ON `${TABLE_NAME}` (`card_type`)"
}
],
"foreignKeys": []
},
{
"tableName": "library_favourites",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '0dfdb937cb9a30f505938112bcd0affc')"
]
}
}
Loading

0 comments on commit 5bd0f5d

Please sign in to comment.