From 29fb166756b66f64cb488e8945fd98761fcbad8f Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Tue, 4 Sep 2018 19:45:01 -0500 Subject: [PATCH] Fix jenkinsfile --- .gitignore | 1 + Jenkinsfile | 29 ++++++++------ app/build.gradle | 40 +++++++++++-------- .../simplemarkdown/MainActivityTests.java | 2 +- .../view/activity/AutosaveTest.java | 6 +-- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- keystore.properties.sample | 4 ++ 8 files changed, 50 insertions(+), 38 deletions(-) create mode 100644 keystore.properties.sample diff --git a/.gitignore b/.gitignore index 6bc1386..e2f5000 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ app/samsung *~ *.log app/acra.properties +keystore.properties diff --git a/Jenkinsfile b/Jenkinsfile index afb32f4..ee6a3c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,12 +3,22 @@ pipeline { stages { stage('Config') { steps { - withCredentials([file( - credentialsId: '23ecf53c-2fc9-41ed-abfa-0b32d60d688f', - variable : 'ACRA_PROPERTIES_FILE' - )]) { + configFileProvider([ + configFile( + fileId: 'ce0fea29-ab06-4921-8ff9-11b09ec8705b', + variable: 'ACRA_PROPERTIES_FILE' + ) + ]) { sh 'cp "$ACRA_PROPERTIES_FILE" app/acra.properties' } + configFileProvider([ + configFile( + fileId: '9f7d74a1-0971-41b7-8984-ac875ad6301f', + variable: 'KEYSTORE_PROPERTIES' + ) + ]) { + sh 'cp "$KEYSTORE_PROPERTIES" keystore.properties' + } } } stage('Build') { @@ -16,15 +26,10 @@ pipeline { sh './gradlew assembleRelease test' } } - stage('Sign & Archive') { + stage('Archive') { steps { - [ - $class : 'SignApksBuilder', - apksToSign: 'app/build/outputs/apk/*/release/*.apk', - keyAlias : 'simplemarkdown', - keyStoreId: '44651a2a-1e46-4708-80ab-d8befc6e94f0' - ] - archiveArtifacts 'app/build/outputs/mapping' + archiveArtifacts 'app/build/outputs/apk/*/release/*.apk' + archiveArtifacts 'app/build/outputs/mapping/**' } } stage('Report') { diff --git a/app/build.gradle b/app/build.gradle index 4aa98fd..2a06d20 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,8 +1,12 @@ apply plugin: 'com.android.application' -Properties acra = new Properties() +def acra = new Properties() acra.load(new FileInputStream("app/acra.properties")) +def keystorePropertiesFile = rootProject.file("keystore.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1' @@ -24,17 +28,26 @@ android { applicationId "com.wbrawner.simplemarkdown" minSdkVersion 19 targetSdkVersion 28 - versionCode 15 - versionName "0.5.0" + versionCode 16 + versionName "0.6.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" buildConfigField "String", "ACRA_URL", "\"${acra.getProperty("url")}\"" buildConfigField "String", "ACRA_USER", "\"${acra.getProperty("user")}\"" buildConfigField "String", "ACRA_PASS", "\"${acra.getProperty("pass")}\"" } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.release } } flavorDimensions "platform" @@ -61,36 +74,29 @@ ext { } dependencies { - - annotationProcessor 'com.google.dagger:dagger-compiler:2.11' + annotationProcessor 'com.google.dagger:dagger-compiler:2.16' annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0' - testImplementation 'junit:junit:4.12' - testImplementation "org.robolectric:robolectric:4.0-alpha-3" - - implementation fileTree(dir: 'libs', include: ['*.jar']) - + testImplementation 'org.robolectric:robolectric:4.1' + implementation fileTree(include: ['*.jar'], dir: 'libs') androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test:rules:1.0.2' androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3' - implementation "com.android.support:appcompat-v7:$support_version" implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation "com.android.support:design:$support_version" implementation "com.android.support:support-v13:$support_version" implementation 'com.commonsware.cwac:anddown:0.3.0' - implementation 'com.google.dagger:dagger:2.11' - implementation 'com.jakewharton:butterknife:8.7.0' + implementation 'com.google.dagger:dagger:2.16' + implementation 'com.jakewharton:butterknife:8.8.1' implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0' implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' - implementation 'io.reactivex.rxjava2:rxjava:2.2.2' - + implementation 'io.reactivex.rxjava2:rxjava:2.2.6' implementation "ch.acra:acra-http:$acraVersion" - samsungImplementation project(":IAP5Helper") } diff --git a/app/src/androidTest/java/com/wbrawner/simplemarkdown/MainActivityTests.java b/app/src/androidTest/java/com/wbrawner/simplemarkdown/MainActivityTests.java index 0f203f8..da36015 100644 --- a/app/src/androidTest/java/com/wbrawner/simplemarkdown/MainActivityTests.java +++ b/app/src/androidTest/java/com/wbrawner/simplemarkdown/MainActivityTests.java @@ -34,7 +34,7 @@ public class MainActivityTests { @Rule public ActivityTestRule mActivityRule = - new ActivityTestRule(MainActivity.class); + new ActivityTestRule<>(MainActivity.class); @Before public void setup() { diff --git a/app/src/androidTest/java/com/wbrawner/simplemarkdown/view/activity/AutosaveTest.java b/app/src/androidTest/java/com/wbrawner/simplemarkdown/view/activity/AutosaveTest.java index 36d6e3b..1b0679d 100644 --- a/app/src/androidTest/java/com/wbrawner/simplemarkdown/view/activity/AutosaveTest.java +++ b/app/src/androidTest/java/com/wbrawner/simplemarkdown/view/activity/AutosaveTest.java @@ -2,12 +2,11 @@ package com.wbrawner.simplemarkdown.view.activity; import android.Manifest; -import android.support.test.espresso.DataInteraction; import android.support.test.espresso.ViewInteraction; +import android.support.test.filters.LargeTest; import android.support.test.rule.ActivityTestRule; import android.support.test.rule.GrantPermissionRule; import android.support.test.runner.AndroidJUnit4; -import android.test.suitebuilder.annotation.LargeTest; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; @@ -22,10 +21,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import static android.support.test.InstrumentationRegistry.getInstrumentation; -import static android.support.test.espresso.Espresso.onData; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static android.support.test.espresso.Espresso.pressBack; import static android.support.test.espresso.action.ViewActions.click; import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; import static android.support.test.espresso.action.ViewActions.replaceText; @@ -36,7 +33,6 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withParent; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.anything; import static org.hamcrest.Matchers.is; @LargeTest diff --git a/build.gradle b/build.gradle index 1a292b3..8553826 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.0' + classpath 'com.android.tools.build:gradle:3.3.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 215146a..7e23517 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Oct 01 17:32:53 CDT 2018 +#Fri Feb 08 21:22:10 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/keystore.properties.sample b/keystore.properties.sample new file mode 100644 index 0000000..c67223a --- /dev/null +++ b/keystore.properties.sample @@ -0,0 +1,4 @@ +storePassword= +keyPassword= +keyAlias= +storeFile= \ No newline at end of file