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 2294dbb + 997059b commit 666cfd8
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 33 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
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Occtax-mobile

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

GeoNature Android mobile application for Occtax module.

Installation documentation (French) : https://github.com/PnX-SI/gn_mobile_occtax/blob/master/docs/installation-fr.md

## Launcher icons

| Name | Flavor | Launcher icon |
| -------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
| Default | _generic_ | ![PNX](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/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_occtax/develop/occtax/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_occtax/develop/occtax/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_occtax/develop/occtax/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_occtax/develop/occtax/src/pnv/res/mipmap-xhdpi/ic_launcher.png) |

## Settings

Example:
Expand Down
51 changes: 30 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,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 @@ -46,32 +46,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'
}
}
2 changes: 1 addition & 1 deletion gn_mobile_core
2 changes: 1 addition & 1 deletion gn_mobile_maps
13 changes: 10 additions & 3 deletions occtax/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

version = "0.3.5"
version = "1.0.0"

android {
compileSdkVersion 29
Expand All @@ -23,13 +23,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 occtax/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Sun Jul 19 16:09:07 CEST 2020
VERSION_CODE=1940
#Sun Jul 26 15:45:18 CEST 2020
VERSION_CODE=1950

0 comments on commit 666cfd8

Please sign in to comment.