diff --git a/Jenkinsfile b/Jenkinsfile index 9777286..0053233 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,8 +78,8 @@ deployBranches.each { deployBranch -> gitMerge(workingBranch, deployBranch) } - // Go back to working branch for validation - sh("git checkout ${workingBranch}") + // Go back to working branch for validation + sh("git checkout ${lazyConfig['branch']}") fastLane('android', 'test') }, on: 'android', @@ -108,7 +108,7 @@ // Ask version if release flag and set and we are in the branch to fork release from input = [ message: 'Version string', - parameters: [string(defaultValue: '', description: 'Version string to be release (no build number)', name: 'VERSION')] + parameters: [string(defaultValue: '', description: 'Version string to be release NEXT (no build number)', name: 'VERSION')] ] tasks = [ run: { @@ -121,6 +121,12 @@ } gitAuth('bot-ci-dgm', { + // Refresh latest changelogs before releasing + sh("git checkout ${workingBranch}") + fastChangeLogs(nextVersion.number, 'android') + gitCommit("Provide changelogs for version ${currentVersion.number}", 'fastlane/metadata/android') + gitPush(remote, workingBranch) + // Refresh each deploy branches with changes from the working branch deployBranches.each { deployBranch -> gitMerge(workingBranch, deployBranch) @@ -132,13 +138,11 @@ gitTag("${currentVersion.string}-${currentVersion.number}", remote) // Refresh latest changelogs and bump version in working branch before deploying - fastChangeLogs(nextVersion.number, 'android') androidVersion(nextVersion) - gitCommit("Provide changelogs for version ${nextVersion.number}", 'fastlane/metadata/android') gitCommit("Update version to ${nextVersion.string}-${nextVersion.number}", 'app/build.gradle') - // Publish working branch with latest changelogs and next version - gitPush(remote, workingBranch) + // Publish working branch with latest changelogs and next version + gitPush(remote, workingBranch) }) }, on: 'android', @@ -181,20 +185,20 @@ } lazyStage { - name = 'beta_crash' - onlyif = (! deployBranches.contains(lazyConfig['branch']) && lazyConfig['branch'] != workingBranch && lazyConfig.env.RELEASE ) - input = 'Promote to Crashlytics Beta users?' - tasks = [ - pre: { - unarchive(mapping:["${buildDir}/" : '.']) - }, - run: { - if ( !lazyConfig.env.DRYRUN ) { - fastLane('android', 'beta_crash', "fl_branch:\"${lazyConfig['branch']}\"") - } - }, - on: 'android', - ] + name = 'beta_crash' + onlyif = (! deployBranches.contains(lazyConfig['branch']) && lazyConfig['branch'] != workingBranch && lazyConfig.env.RELEASE ) + input = 'Promote to Crashlytics Beta users?' + tasks = [ + pre: { + unarchive(mapping:["${buildDir}/" : '.']) + }, + run: { + if ( !lazyConfig.env.DRYRUN ) { + fastLane('android', 'beta_crash', "fl_branch:\"${lazyConfig['branch']}\"") + } + }, + on: 'android', + ] } /* lazyStage { diff --git a/app/build.gradle b/app/build.gradle index 785cd90..c362f2b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,6 +33,11 @@ compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + defaultConfig { applicationId "nl.digital_me.dummyandroidapp" minSdkVersion 14 @@ -40,12 +45,14 @@ versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 70 versionName project.hasProperty('versionName') ? project.property('versionName') : "0.0.5" multiDexEnabled true + + buildConfigField "boolean", "CRASHLYTICS", "true" } dexOptions { maxProcessCount 1 threadCount 4 - javaMaxHeapSize "2048m" + javaMaxHeapSize "512m" preDexLibraries false } @@ -56,9 +63,9 @@ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-glide.pro', 'proguard-fresco.pro', 'proguard-rules.pro' debuggable false } - debug { - minifyEnabled false + minifyEnabled true + useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-glide.pro', 'proguard-fresco.pro', 'proguard-rules.pro' debuggable true } @@ -66,10 +73,11 @@ flavorDimensions "env" - productFlavors { // May need to match branch name, passed by Jenkins PL as environment variable named LAZY_BRANCH + productFlavors { // May need to match branch name, passed by Jenkins PL as environment variable named BRANCH_NAME systemtest { resValue "string", "app_name", "DummyAnd STst" - applicationIdSuffix ".stst" + //applicationIdSuffix ".stst" + applicationIdSuffix ".dev2" // manifestPlaceholders = [errorBaseUrl : "https://systemtest-card.testonly.digital-me.nl/card", // cardNodeBaseUrl: "https://systemtest-card.testonly.digital-me.nl/card", // userNodeBaseUrl: "https://systemtest-user.testonly.digital-me.nl/user"] @@ -131,7 +139,8 @@ dependencies { //compile fileTree(dir: 'libs', include: ['*.jar']) testImplementation "junit:junit:$rootProject.junitVersion" + testImplementation "org.mockito:mockito-core:2.19.0" implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.android.support:design:${rootProject.ext.supportLibVersion}" - implementation 'com.android.support:multidex:1.0.3' + implementation 'androidx.multidex:multidex:2.0.0' } diff --git a/fastlane/Appfile b/fastlane/Appfile index 71a6a93..43d0af8 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1,2 +1 @@ json_key_file "~/GoogleAPICredentials.json" -package_name "nl.digital_me.dummyandroidapp" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d448d16..b8a0437 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -11,7 +11,7 @@ # This is the minimum version number required. # Update this, if you use features of a newer version -fastlane_version "2.62.1" +fastlane_version "2.107.0" default_platform :android @@ -121,7 +121,16 @@ desc "Runs all the tests" lane :test do |options| - gradle(task: "test") + gradle( + task: "test", + build_type: 'Release', + flavor: "production", + ) + gradle( + task: "test", + build_type: 'Release', + flavor: "acceptance", + ) end desc "Build the apk" diff --git a/fastlane/metadata/android/en-US/changelogs/70.txt b/fastlane/metadata/android/en-US/changelogs/70.txt deleted file mode 100644 index 098b6f7..0000000 --- a/fastlane/metadata/android/en-US/changelogs/70.txt +++ /dev/null @@ -1,3 +0,0 @@ -- Nothing visible -- Backports from Dappre -- Improves PL \ No newline at end of file diff --git a/fastlane/metadata/android/nl-NL/changelogs/70.txt b/fastlane/metadata/android/nl-NL/changelogs/70.txt deleted file mode 100644 index 2ebc369..0000000 --- a/fastlane/metadata/android/nl-NL/changelogs/70.txt +++ /dev/null @@ -1,3 +0,0 @@ -- Niets zichtbaar -- Backports van Dappre -- Verbeterd PL \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 59b0015..e18d862 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -org.gradle.jvmargs=-XX:NewSize=24m -XX:MaxNewSize=48m -XX:OldSize=32m -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=128m -XX:CompressedClassSpaceSize=32m -XX:ReservedCodeCacheSize=28m -Xms128m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant +org.gradle.jvmargs=-XX:NewSize=24m -XX:MaxNewSize=48m -XX:OldSize=32m -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=128m -XX:CompressedClassSpaceSize=32m -XX:ReservedCodeCacheSize=28m -Xms128m -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit