Skip to content

Commit

Permalink
Merge branch 'release-2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Schwengler committed Feb 26, 2018
2 parents 4338b87 + f4a447a commit dbcf74a
Show file tree
Hide file tree
Showing 590 changed files with 15,790 additions and 23,496 deletions.
147 changes: 147 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#!groovy

pipeline {
agent none

environment {
ANDROID_SDK_ROOT = "/home/catroid/android-sdk-tools"
ANDROID_SDK_HOME = "/home/catroid"
ANDROID_EMULATOR_IMAGE = "system-images;android-24;default;x86_64"

// modulename
GRADLE_PROJECT_MODULE_NAME = "Paintroid"

// APK build output locations
APK_LOCATION_DEBUG = "${env.GRADLE_PROJECT_MODULE_NAME}/build/outputs/apk/Paintroid-debug.apk"

// share.catrob.at
CATROBAT_SHARE_UPLOAD_BRANCH = "develop"
CATROBAT_SHARE_APK_NAME = "org.catrobat.paintroid_debug_${env.CATROBAT_SHARE_UPLOAD_BRANCH}_latest.apk"

// set to any value to debug jenkins_android* scripts
ANDROID_EMULATOR_HELPER_DEBUG = ""
// Needed for compatibiliby to current Jenkins-wide Envs
// Can be removed, once all builds are migrated to Pipeline
ANDROID_HOME = ""
ANDROID_SDK_LOCATION = ""
ANDROID_NDK = ""
}

options {
timeout(time: 1, unit: 'HOURS')
timestamps()
}

stages {
stage('Setup Android SDK') {
steps {
// Install Android SDK on all possible Android SDK slaves
lock('update-android-sdk') {
script {
onAllAndroidSdkSlaves {
checkout scm
sh "jenkins_android_sdk_installer -g ${WORKSPACE}/${env.GRADLE_PROJECT_MODULE_NAME}/build.gradle -s '${ANDROID_EMULATOR_IMAGE}'"
}
}
}
}
}

stage('Run Tests') {
parallel {
stage('Static Analysis') {
agent {
label 'NoDevice'
}

steps {
checkout scm

sh "./gradlew pmd checkstyle lint"

pmd canComputeNew: false, canRunOnFailed: true, defaultEncoding: '', healthy: '', pattern: "${env.GRADLE_PROJECT_MODULE_NAME}/build/reports/pmd.xml", unHealthy: '', unstableTotalAll: '0'
checkstyle canComputeNew: false, canRunOnFailed: true, defaultEncoding: '', healthy: '', pattern: "${env.GRADLE_PROJECT_MODULE_NAME}/build/reports/checkstyle.xml", unHealthy: '', unstableTotalAll: '0'
androidLint canComputeNew: false, canRunOnFailed: true, defaultEncoding: '', healthy: '', pattern: "${env.GRADLE_PROJECT_MODULE_NAME}/build/reports/lint*.xml", unHealthy: '', unstableTotalAll: '0'
}
}

stage('Unit and Device tests') {
agent {
label 'Emulator'
}

steps {
checkout scm

wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
// create emulator
sh """
jenkins_android_emulator_helper -C \
-P 'hw.ramSize:800' -P 'vm.heapSize:128' \
-i '${ANDROID_EMULATOR_IMAGE}' \
-s xhdpi
"""
// start emulator
sh "jenkins_android_emulator_helper -S -r 768x1280 -l en_US -c '-no-boot-anim -noaudio -qemu -m 800 -enable-kvm'"
// wait for emulator startup
sh "jenkins_android_emulator_helper -W"
// Run Unit and device tests
sh "jenkins_android_cmd_wrapper -I ./gradlew adbDisableAnimationsGlobally connectedDebugAndroidTest -Pjenkins"
// stop emulator
sh "jenkins_android_emulator_helper -K"
}
}

post {
always {
junit '**/*TEST*.xml'

// kill emulator
sh "jenkins_android_emulator_helper -K"
}
}
}

stage('Build APK') {
agent {
label 'NoDevice'
}

steps {
checkout scm

sh "./gradlew assembleDebug"
stash name: "debug-apk", includes: "${env.APK_LOCATION_DEBUG}"
archiveArtifacts "${env.APK_LOCATION_DEBUG}"
}
}
}
}

stage('Upload to share') {
agent {
label 'NoDevice'
}

when {
branch "${env.CATROBAT_SHARE_UPLOAD_BRANCH}"
}

steps {
unstash "debug-apk"
script {
uploadFileToShare "${env.APK_LOCATION_DEBUG}", "${env.CATROBAT_SHARE_APK_NAME}"
}
}
}
}

post {
always {
// Send notifications with standalone=false
script {
sendNotifications false
}
}
}
}
11 changes: 0 additions & 11 deletions Paintroid/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

57 changes: 0 additions & 57 deletions Paintroid/.settings/org.eclipse.jdt.ui.prefs

This file was deleted.

73 changes: 38 additions & 35 deletions Paintroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@
*/

apply plugin: 'com.android.application'
apply from: 'adb_tasks.gradle'
apply plugin: 'jacoco-android'
apply plugin: 'checkstyle'
apply plugin: 'pmd'

apply from: 'gradle/adb_tasks.gradle'
apply from: 'gradle/code_quality_tasks.gradle'

def appId = 'org.catrobat.paintroid'
def appName = '@string/app_name'

check.dependsOn 'checkstyle'
check.dependsOn 'pmd'

// When -Pindependent was provided on the gradle command the APP name is changed.
// This allows to have multiple Paintroid versions installed in parallel for testing purposes.
// Furthermore these installations do not interfere with the actual Paintroid app.
Expand All @@ -34,33 +42,23 @@ if (project.hasProperty('independent')) {

android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
buildToolsVersion '25.0.3'

defaultConfig {
applicationId appId
minSdkVersion 17
targetSdkVersion 22
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 20
versionName "2.0.0"
testInstrumentationRunner "org.catrobat.paintroid.test.utils.CustomAndroidJUnitRunner"
versionCode 21
versionName "2.0.1"
manifestPlaceholders += [appName: appName]
externalNativeBuild {
cmake {
cppFlags "-fexceptions"
}
}
externalNativeBuild.cmake.cppFlags "-fexceptions"
}

sourceSets {
main {
java {
srcDir 'src/main/java'
}

resources {
srcDir 'src/main/res'
}

java.srcDir 'src/main/java'
resources.srcDir 'src/main/res'
}

androidTest {
Expand All @@ -78,23 +76,22 @@ android {
}
}

externalNativeBuild {
cmake {
path 'CMakeLists.txt'
}
}
externalNativeBuild.cmake.path 'CMakeLists.txt'

lintOptions {
// specific ignores should be defined via lint.xml file, all general ignores should be added here
lintConfig file('config/lint.xml')
// CommitPrefEdits should be reviewed, if using apply instead of commit is working with our tests
// RtlSymmetry/RtlHardcoded should be reviewed
// GradleDynamicVersion ignored - e.g. according to sdkmanager:gradle-plugin it should be imported this way
// IconMissingDensityFolder - currently no xxxhdpi icons available
// TODO ticket for HandlerLeak
// TODO don't know if WrongRegion warning is a false-positive one
ignore 'ContentDescription', 'InvalidPackage', 'ValidFragment', 'GradleDependency',
'ClickableViewAccessibility', 'UnusedAttribute', 'CommitPrefEdits', 'OldTargetApi',
'GradleDynamicVersion', 'HandlerLeak', 'IconMissingDensityFolder',
'RtlSymmetry', 'GradleDynamicVersion', 'RtlHardcoded', 'HandlerLeak', 'IconMissingDensityFolder',
'WrongRegion', 'RelativeOverlap', 'IconColors', 'MissingTranslation', 'ExtraTranslation',
'GradleCompatible', 'WifiManagerLeak', 'ApplySharedPref', 'ObsoleteSdkInt',
'GradleCompatible', 'WifiManagerLeak', 'ApplySharedPref', 'DefaultLocale', 'ObsoleteSdkInt',
'StaticFieldLeak' , 'AppCompatResource'

textReport true
Expand All @@ -107,24 +104,30 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.jaredrummler:material-spinner:1.1.0'
compile 'com.getkeepsafe.taptargetview:taptargetview:1.9.1'
compile 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'

androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test:rules:1.0.1'

androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:3.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.1'

androidTestCompile 'com.android.support.test:runner:1.0.0'
androidTestCompile 'com.android.support.test:rules:1.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'

androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.0'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:3.0.0'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.0'
pmd(
'net.sourceforge.pmd:pmd-core:5.8.1',
'net.sourceforge.pmd:pmd-java:5.8.1'
)

checkstyle 'com.puppycrawl.tools:checkstyle:7.6'
}

tasks.whenTaskAdded { task ->
if(task.name.startsWith('assembleDebugAndroidTest')) {
if (!project.hasProperty('jenkins') && task.name.startsWith('assembleDebugAndroidTest')) {
verifyAnimationScalePermissionGranted.shouldRunAfter adbGrantAnimationScalePermission

task.dependsOn adbGrantAnimationScalePermission
Expand Down
Loading

0 comments on commit dbcf74a

Please sign in to comment.