Fix jenkinsfile

This commit is contained in:
William Brawner 2018-09-04 19:45:01 -05:00 committed by William Brawner
parent 527373d3e2
commit 29fb166756
8 changed files with 50 additions and 38 deletions

1
.gitignore vendored
View file

@ -14,3 +14,4 @@ app/samsung
*~ *~
*.log *.log
app/acra.properties app/acra.properties
keystore.properties

27
Jenkinsfile vendored
View file

@ -3,12 +3,22 @@ pipeline {
stages { stages {
stage('Config') { stage('Config') {
steps { steps {
withCredentials([file( configFileProvider([
credentialsId: '23ecf53c-2fc9-41ed-abfa-0b32d60d688f', configFile(
fileId: 'ce0fea29-ab06-4921-8ff9-11b09ec8705b',
variable: 'ACRA_PROPERTIES_FILE' variable: 'ACRA_PROPERTIES_FILE'
)]) { )
]) {
sh 'cp "$ACRA_PROPERTIES_FILE" app/acra.properties' 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') { stage('Build') {
@ -16,15 +26,10 @@ pipeline {
sh './gradlew assembleRelease test' sh './gradlew assembleRelease test'
} }
} }
stage('Sign & Archive') { stage('Archive') {
steps { steps {
[ archiveArtifacts 'app/build/outputs/apk/*/release/*.apk'
$class : 'SignApksBuilder', archiveArtifacts 'app/build/outputs/mapping/**'
apksToSign: 'app/build/outputs/apk/*/release/*.apk',
keyAlias : 'simplemarkdown',
keyStoreId: '44651a2a-1e46-4708-80ab-d8befc6e94f0'
]
archiveArtifacts 'app/build/outputs/mapping'
} }
} }
stage('Report') { stage('Report') {

View file

@ -1,8 +1,12 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
Properties acra = new Properties() def acra = new Properties()
acra.load(new FileInputStream("app/acra.properties")) acra.load(new FileInputStream("app/acra.properties"))
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android { android {
configurations.all { configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1' resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
@ -24,17 +28,26 @@ android {
applicationId "com.wbrawner.simplemarkdown" applicationId "com.wbrawner.simplemarkdown"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 28
versionCode 15 versionCode 16
versionName "0.5.0" versionName "0.6.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "ACRA_URL", "\"${acra.getProperty("url")}\"" buildConfigField "String", "ACRA_URL", "\"${acra.getProperty("url")}\""
buildConfigField "String", "ACRA_USER", "\"${acra.getProperty("user")}\"" buildConfigField "String", "ACRA_USER", "\"${acra.getProperty("user")}\""
buildConfigField "String", "ACRA_PASS", "\"${acra.getProperty("pass")}\"" buildConfigField "String", "ACRA_PASS", "\"${acra.getProperty("pass")}\""
} }
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
} }
} }
flavorDimensions "platform" flavorDimensions "platform"
@ -61,36 +74,29 @@ ext {
} }
dependencies { dependencies {
annotationProcessor 'com.google.dagger:dagger-compiler:2.16'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation "org.robolectric:robolectric:4.0-alpha-3" testImplementation 'org.robolectric:robolectric:4.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 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:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3' androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
implementation "com.android.support:appcompat-v7:$support_version" implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:design:$support_version" implementation "com.android.support:design:$support_version"
implementation "com.android.support:support-v13:$support_version" implementation "com.android.support:support-v13:$support_version"
implementation 'com.commonsware.cwac:anddown:0.3.0' implementation 'com.commonsware.cwac:anddown:0.3.0'
implementation 'com.google.dagger:dagger:2.11' implementation 'com.google.dagger:dagger:2.16'
implementation 'com.jakewharton:butterknife:8.7.0' implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0' implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0' implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.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" implementation "ch.acra:acra-http:$acraVersion"
samsungImplementation project(":IAP5Helper") samsungImplementation project(":IAP5Helper")
} }

View file

@ -34,7 +34,7 @@ public class MainActivityTests {
@Rule @Rule
public ActivityTestRule<MainActivity> mActivityRule = public ActivityTestRule<MainActivity> mActivityRule =
new ActivityTestRule(MainActivity.class); new ActivityTestRule<>(MainActivity.class);
@Before @Before
public void setup() { public void setup() {

View file

@ -2,12 +2,11 @@ package com.wbrawner.simplemarkdown.view.activity;
import android.Manifest; import android.Manifest;
import android.support.test.espresso.DataInteraction;
import android.support.test.espresso.ViewInteraction; import android.support.test.espresso.ViewInteraction;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule; import android.support.test.rule.ActivityTestRule;
import android.support.test.rule.GrantPermissionRule; import android.support.test.rule.GrantPermissionRule;
import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewParent; import android.view.ViewParent;
@ -22,10 +21,8 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import static android.support.test.InstrumentationRegistry.getInstrumentation; 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.onView;
import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; 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.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.replaceText; 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.withParent;
import static android.support.test.espresso.matcher.ViewMatchers.withText; import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.anything;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
@LargeTest @LargeTest

View file

@ -6,7 +6,7 @@ buildscript {
google() google()
} }
dependencies { 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 // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }

View file

@ -1,6 +1,6 @@
#Mon Oct 01 17:32:53 CDT 2018 #Fri Feb 08 21:22:10 CST 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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

View file

@ -0,0 +1,4 @@
storePassword=
keyPassword=
keyAlias=
storeFile=