Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Jul 26, 2020
2 parents 4c51ed8 + fada342 commit afe94e4
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.iml
.gradle
/local.properties
/keystore.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
Expand Down
51 changes: 30 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

File getVersionPropertiesFile(moduleName) {
def versionPropsFile = file(moduleName + '/version.properties')
private File loadVersionPropertiesFile(String moduleName) {
def versionPropsFile = file("$moduleName/version.properties")

println("getVersionCode: loading '" + versionPropsFile + "'")
println "reading '${versionPropsFile.name}' for module '$moduleName' ..."

if (!versionPropsFile.exists()) {
versionPropsFile.createNewFile()
Expand All @@ -47,32 +47,41 @@ File getVersionPropertiesFile(moduleName) {
return versionPropsFile
}

Properties readVersionProperties(moduleName) {
Properties versionProps = new Properties()
versionProps.load(new FileInputStream(getVersionPropertiesFile(moduleName)))
@SuppressWarnings("unused")
int updateVersionCode(moduleName) {
File propertiesFile = loadVersionPropertiesFile(moduleName)

if (!versionProps['VERSION_CODE']) {
versionProps['VERSION_CODE'] = "1"
}
Properties versionProperties = new Properties()
versionProperties.load(new FileInputStream(propertiesFile))

return versionProps
}
int versionCode = Integer.parseInt(versionProperties.getProperty('VERSION_CODE', '0').toString()).intValue() + 1

versionProperties['VERSION_CODE'] = versionCode.toString()
versionProperties.store(propertiesFile.newWriter(), null)

int getVersionCode(moduleName) {
Properties versionProps = readVersionProperties(moduleName)
println "version code: $versionCode"

return Integer.parseInt(versionProps['VERSION_CODE'].toString()).intValue()
return versionCode
}

@SuppressWarnings("unused")
int updateVersionCode(moduleName) {
Properties versionProps = readVersionProperties(moduleName)
def versionCode = getVersionCode(moduleName) + 1
def readKeystoreProperties(moduleName) {
def propertiesFile = rootProject.file('keystore.properties')
def configName = 'release'

versionProps['VERSION_CODE'] = versionCode.toString()
versionProps.store(getVersionPropertiesFile(moduleName).newWriter(), null)
println "reading '${propertiesFile.absolutePath}' for module '$moduleName' ..."

println("updateVersionCode: " + versionCode)
Project moduleProject = project.project(moduleName)

return versionCode
if (propertiesFile.exists() && moduleProject.hasProperty("android") && moduleProject.android.signingConfigs.hasProperty(configName)) {
def props = new Properties()
props.load(new FileInputStream(propertiesFile))

moduleProject.android.signingConfigs[configName].storeFile = file(props['STORE_FILE'])
moduleProject.android.signingConfigs[configName].storePassword = props['STORE_PASSWORD']
moduleProject.android.signingConfigs[configName].keyAlias = props['KEY_ALIAS']
moduleProject.android.signingConfigs[configName].keyPassword = props['KEY_PASSWORD']

println 'done'
}
}
4 changes: 2 additions & 2 deletions commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ android {

buildTypes {
debug {
versionNameSuffix "." + getVersionCode(module.name) + "-DEV"
versionNameSuffix ".${defaultConfig.versionCode}-DEV"
}
release {
versionNameSuffix "." + getVersionCode(module.name)
versionNameSuffix ".${defaultConfig.versionCode}"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Expand Down
4 changes: 2 additions & 2 deletions mountpoint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ android {

buildTypes {
debug {
versionNameSuffix "." + getVersionCode(module.name) + "-DEV"
versionNameSuffix ".${defaultConfig.versionCode}-DEV"
}
release {
versionNameSuffix "." + getVersionCode(module.name)
versionNameSuffix ".${defaultConfig.versionCode}"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Expand Down
15 changes: 10 additions & 5 deletions sync/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Sync

![PNC](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pnc/res/mipmap-xxxhdpi/ic_launcher.png)
![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pne/res/mipmap-xxxhdpi/ic_launcher.png)
![PNM](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pnm/res/mipmap-xxxhdpi/ic_launcher.png)
![PNV](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pnv/res/mipmap-xxxhdpi/ic_launcher.png)

Synchronize local database through GeoNature API:

- Users (i.e. Observers)
Expand All @@ -14,6 +9,16 @@ Synchronize local database through GeoNature API:

Synchronize observers inputs from synchronized apps (e.g. "Occtax").

## Launcher icons

| Name | Flavor | Launcher icon |
| -------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
| Default | _generic_ | ![PNX](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/main/res/mipmap-xhdpi/ic_launcher.png) |
| [Parc National des Cévennes](http://www.cevennes-parcnational.fr) | _pnc_ | ![PNC](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pnc/res/mipmap-xhdpi/ic_launcher.png) |
| [Parc National des Écrins](http://www.ecrins-parcnational.fr) | _pne_ | ![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pne/res/mipmap-xhdpi/ic_launcher.png) |
| [Parc National du Mercantour](http://www.mercantour-parcnational.fr) | _pnm_ | ![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pnm/res/mipmap-xhdpi/ic_launcher.png) |
| [Parc National de la Vanoise](http://www.vanoise-parcnational.fr) | _pnv_ | ![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_core/develop/sync/src/pnv/res/mipmap-xhdpi/ic_launcher.png) |

## Settings

Example:
Expand Down
13 changes: 10 additions & 3 deletions sync/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "kotlin-kapt"

version = "0.3.1"
version = "1.0.0"

android {
compileSdkVersion 29
Expand All @@ -28,13 +28,20 @@ android {
archivesBaseName = module.name + "-" + versionName
}

signingConfigs {
release {
readKeystoreProperties(module.name)
}
}

buildTypes {
debug {
versionNameSuffix "." + getVersionCode(module.name) + "-DEV"
versionNameSuffix ".${defaultConfig.versionCode}-DEV"
}

release {
versionNameSuffix "." + getVersionCode(module.name)
signingConfig signingConfigs.release
versionNameSuffix ".${defaultConfig.versionCode}"
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Expand Down
4 changes: 2 additions & 2 deletions sync/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Sun Jul 19 15:53:38 CEST 2020
VERSION_CODE=2370
#Sun Jul 26 15:07:07 CEST 2020
VERSION_CODE=2390
4 changes: 2 additions & 2 deletions viewpager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ android {

buildTypes {
debug {
versionNameSuffix "." + getVersionCode(module.name) + "-DEV"
versionNameSuffix ".${defaultConfig.versionCode}-DEV"
}
release {
versionNameSuffix "." + getVersionCode(module.name)
versionNameSuffix ".${defaultConfig.versionCode}"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Expand Down

0 comments on commit afe94e4

Please sign in to comment.