Skip to content

Commit

Permalink
- remove config field from gradle; (#324)
Browse files Browse the repository at this point in the history
- update readme build section;
  • Loading branch information
MykhailoNester authored Aug 30, 2022
1 parent a310fe1 commit 074cff8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,26 @@ android-app
|___dgc-certlogic-android
```

- To build project - it's required to add config json file to application assets folder. Structure of the file should be similar to:
'app/src/acc/assets/verifier-context.jsonc' or 'app/src/tst/assets/verifier-context.jsonc', depending on chosen flavor.
After related file has been added - it's name should be passed via gradle properties:
gradlew -PCONFIG_FILE_NAME="config.json"

#### Android Studio based build
Project flavours:
- tstBloomDebug
- tstBloomRelease
- tstHashDebug
- tstHashRelease
- accBloomDebug
- accBloomRelease
- accHashDebug
- accHashRelease

tst/acc prefix corresponds to app configuration. JSON files in application assets folders:
'app/src/acc/assets/verifier-context.jsonc' or 'app/src/tst/assets/verifier-context.jsonc'
These files are required for the DCC module. To make this functionality work you need to provide your own endpoints.

Bloom - BloomFilter implementation for DCC revocation check.
Hash - alternate method of DCC revocation check.

Flavors can be changed directly in android studio:

<img src="/docs/resources/flavors.png" width="200" />

This project uses the Gradle build system. To build this project, use the `gradlew build` command or use "Run" in Android Studio.

Expand Down
4 changes: 0 additions & 4 deletions branches/dcc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"

// It's required to provide config json files, and path to it.
// Examples based on different flavors could be found here: 'app/src/acc/assets/verifier-context.jsonc' or 'app/src/tst/assets/verifier-context.jsonc'
buildConfigField "String", "CONFIG_FILE_NAME", "\"$CONFIG_FILE_NAME\""

buildConfigField "int", "VERSION_CODE", "$versionCode"
buildConfigField "String", "VERSION_NAME", "\"$versionName\""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package dgca.verifier.app.android.dcc.data.local

import android.content.Context
import com.android.app.dcc.BuildConfig
import com.fasterxml.jackson.databind.ObjectMapper
import dagger.hilt.android.qualifiers.ApplicationContext
import dgca.verifier.app.android.dcc.data.Config
Expand Down Expand Up @@ -76,7 +75,7 @@ class LocalConfigDataSource @Inject constructor(
}

private fun defaultConfig(): Config =
context.assets.open(BuildConfig.CONFIG_FILE_NAME).bufferedReader().use {
context.assets.open("verifier-context.jsonc").bufferedReader().use {
objectMapper.readValue(it.readText(), Config::class.java)
}
}
Binary file added docs/resources/flavors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 074cff8

Please sign in to comment.