Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to version 1.2.0 #122

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Changelog Generation

on:
release:
types: [published, released]
types: [published]
workflow_dispatch:

jobs:
Expand All @@ -16,6 +16,7 @@ jobs:
- uses: rhysd/changelog-from-release/action@v3
with:
file: CHANGELOG.md
pull_request: true
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_summary_template: 'update changelog for %s changes'
args: -l 2
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Continuous Integration
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run local unit tests
run: bash ./gradlew test --stacktrace

build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run lint check
run: bash ./gradlew lint

- name: Upload lint result
uses: actions/upload-artifact@v4
with:
name: lint-results-debug
path: app/build/reports/lint-results-debug.html

- name: Build the app
run: bash ./gradlew build --stacktrace

- name: Build debug apk
run: bash ./gradlew assembleDebug

- name: Upload debug apk
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: app/build/outputs/apk/debug/*.apk
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ local.properties
.Trashes
ehthumbs.db
Thumbs.db

# Documents
*.pdf
*.doc
*.docx
*.odt

# APKs
*.apk
/pfa.properties
/.idea/
/app/release
58 changes: 37 additions & 21 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'

android {
compileSdkVersion 33

defaultConfig {
applicationId "privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist"
minSdkVersion 17
targetSdkVersion 33
versionCode 8
versionName "1.1"
minSdkVersion 19
compileSdk 34
targetSdkVersion 34
versionCode 9
versionName "1.2.0-rc1"
multiDexEnabled true

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
Expand All @@ -21,8 +23,16 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

kotlin {
jvmToolchain {17}
}

testOptions {
Expand Down Expand Up @@ -53,10 +63,14 @@ android {
]
}
}
lint {
lintConfig = file("lint.xml")
}
namespace 'privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist'
}

android.applicationVariants.all { variant ->
variant.outputs.all {
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
def appName = "pfa-shopping-list"
outputFileName = appName + "-${variant.name}-v${variant.versionName}.apk"
}
Expand All @@ -65,19 +79,21 @@ android.applicationVariants.all { variant ->
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// android
androidTestImplementation 'androidx.annotation:annotation:1.0.0'

implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.cardview:cardview:1.0.0'

// tests
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:2.7.6'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test:rules:1.6.1'
androidTestImplementation 'androidx.test:core:1.6.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
testImplementation 'pl.pragmatists:JUnitParams:0.3.6'
// dependency injection
implementation 'com.squareup.dagger:dagger:1.2.5'
Expand All @@ -96,17 +112,17 @@ dependencies {
// image zoom
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'

implementation 'androidx.sqlite:sqlite:2.3.0'
implementation 'androidx.sqlite:sqlite-ktx:2.3.0'
implementation 'androidx.sqlite:sqlite:2.4.0'
implementation 'androidx.sqlite:sqlite-ktx:2.4.0'

// Backup API
implementation project(':backup-api')
def work_version = '2.7.1'
def work_version = '2.9.0'
implementation "androidx.work:work-runtime:$work_version"
implementation "androidx.work:work-runtime-ktx:$work_version"
androidTestImplementation "androidx.work:work-testing:$work_version"

implementation 'androidx.core:core-ktx:1.7.20'
implementation "androidx.core:core-ktx:$kotlin_version"

// Multi-Dex
def multidex_version = "2.0.1"
Expand Down
11 changes: 11 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable the NotificationPermission check for glide -->
<issue id="NotificationPermission">
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>

<!-- Set the severity of missing translations to warning instead of error -->
<issue id="MissingTranslation" severity="warning" />
<issue id="MissingQuantity" severity="warning" />
</lint>
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist;

import android.support.test.runner.AndroidJUnit4;
import android.test.AndroidTestCase;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;

import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.framework.persistence.DB;

/**
Expand All @@ -11,24 +15,22 @@
* Created: 31.05.16 creation date
*/
@RunWith(AndroidJUnit4.class)
abstract public class AbstractDatabaseTest extends AndroidTestCase
{
abstract public class AbstractDatabaseTest {

protected void setUp() throws Exception
{
super.setUp();
@Before
public void setUp() throws Exception {
// delete database before each test
getContext().deleteDatabase(DB.TEST.getDbName());
InstrumentationRegistry.getInstrumentation().getContext().deleteDatabase(DB.TEST.getDbName());
setupBeforeEachTest();
}

protected void tearDown() throws Exception
{
super.tearDown();
@After
public void tearDown() throws Exception {
cleanAfterEachTest();
}

abstract protected void setupBeforeEachTest();

protected void cleanAfterEachTest(){}
protected void cleanAfterEachTest() {
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist;

import android.app.Application;
import android.test.ApplicationTestCase;
import static org.junit.Assert.assertEquals;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.Test;
import org.junit.runner.RunWith;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application>
{
public ApplicationTest()
{
super(Application.class);
@RunWith(AndroidJUnit4.class)
public class ApplicationTest {
@Test
public void useApplicationContext() {
assertEquals("privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist", ApplicationProvider.getApplicationContext().getPackageName());
}

@Test
public void useContext() {
assertEquals("privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.test", InstrumentationRegistry.getInstrumentation().getContext().getPackageName());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist

import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.ui.main.MainActivity

@RunWith(AndroidJUnit4::class)
class MainActivityBasicTest {
@get: Rule
var mActivityRule = ActivityScenarioRule(MainActivity::class.java)

@Test
fun launchActivity() {
}

@Test
fun openDrawer() {
onView(withContentDescription(R.string.navigation_drawer_open)).perform(click())
}
}
Loading