Skip to content

Commit

Permalink
Merge pull request #1048 from Catrobat/release-v2.8.0
Browse files Browse the repository at this point in the history
Release v2.8.0
  • Loading branch information
wslany authored Mar 17, 2022
2 parents 163ae50 + 9c5f6f3 commit ca8ba23
Show file tree
Hide file tree
Showing 174 changed files with 6,198 additions and 3,824 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ __pycache__
fastlane/*
!fastlane/Appfile
!fastlane/Fastfile
!fastlane/Screengrabfile
!fastlane/staticContent/
Gemfile
Gemfile.lock
18 changes: 17 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pipeline {
parameters {
string name: 'DEBUG_LABEL', defaultValue: '', description: 'For debugging when entered will be used as label to decide on which slaves the jobs will run.'
booleanParam name: 'BUILD_WITH_CATROID', defaultValue: false, description: 'When checked then the current Paintroid build will be built with the current develop branch of Catroid'
string name: 'CATROID_BRANCH', defaultValue: 'develop', description: 'The branch which to build catroid with, when BUILD_WITH_CATROID is checked.'
}

agent {
Expand Down Expand Up @@ -74,12 +75,19 @@ pipeline {
params.BUILD_WITH_CATROID
}
}

steps {
sh './gradlew publishToMavenLocal -Psnapshot'
sh 'rm -rf Catroid; mkdir Catroid'
dir('Catroid') {
git branch: 'develop', url: 'https://github.com/Catrobat/Catroid.git'
sh "./gradlew -PpaintroidLocal assembleCatroidDebug"
git branch: params.CATROID_BRANCH, url: 'https://github.com/Catrobat/Catroid.git'
sh 'rm -f catroid/src/main/libs/*.aar'
sh 'mv -f ../colorpicker/build/outputs/aar/colorpicker-debug.aar catroid/src/main/libs/colorpicker-LOCAL.aar'
sh 'mv -f ../Paintroid/build/outputs/aar/Paintroid-debug.aar catroid/src/main/libs/Paintroid-LOCAL.aar'

archiveArtifacts 'catroid/src/main/libs/colorpicker-LOCAL.aar'
archiveArtifacts 'catroid/src/main/libs/Paintroid-LOCAL.aar'
sh "./gradlew assembleCatroidDebug"
archiveArtifacts 'catroid/build/outputs/apk/catroid/debug/catroid-catroid-debug.apk'
}
}
Expand Down Expand Up @@ -116,7 +124,7 @@ pipeline {

stage('Device Tests') {
steps {
sh './gradlew -PenableCoverage -Pjenkins startEmulator adbDisableAnimationsGlobally createDebugCoverageReport'
sh './gradlew -PenableCoverage -Pjenkins startEmulator adbDisableAnimationsGlobally createDebugCoverageReport -i'
}
post {
always {
Expand Down
112 changes: 112 additions & 0 deletions Jenkinsfile.screenshots
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!groovy
def useDebugLabelParameter(defaultLabel){
return env.DEBUG_LABEL?.trim() ? env.DEBUG_LABEL : defaultLabel
}

pipeline {
environment {
BRANCH_NAME = 'Marketing_Screenshots'
}

parameters {
booleanParam name: 'UPLOAD_SCREENSHOTS', defaultValue: false, description: 'When selected the created screenshots will be uploaded to google play alpha.'
}

agent {
dockerfile {
filename 'Dockerfile.jenkins'
// 'docker build' would normally copy the whole build-dir to the container, changing the
// docker build directory avoids that overhead
dir 'docker'
// Pass the uid and the gid of the current user (jenkins-user) to the Dockerfile, so a
// corresponding user can be added. This is needed to provide the jenkins user inside
// the container for the ssh-agent to work.
// Another way would be to simply map the passwd file, but would spoil additional information
// Also hand in the group id of kvm to allow using /dev/kvm.
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg KVM_GROUP_ID=$(getent group kvm | cut -d: -f3)'
// Ensure that each executor has its own gradle cache to not affect other builds
// that run concurrently.
args '--device /dev/kvm:/dev/kvm -m=6.5G'
label useDebugLabelParameter('LimitedEmulator')
}
}

options {
timeout(time: 2, unit: 'HOURS')
timestamps()
buildDiscarder(logRotator(numToKeepStr: '30'))
}

triggers {
issueCommentTrigger('.*(test this please|please test this).*')
}

stages {
stage('Build Debug-APK') {
steps {
sh "./gradlew -Pindependent='#$env.BUILD_NUMBER $env.BRANCH_NAME' assembleDebug"
archiveArtifacts 'app/build/outputs/apk/debug/paintroid-debug*.apk'
plot csvFileName: 'dexcount.csv', csvSeries: [[displayTableFlag: false, exclusionValues: '', file: 'Paintroid/build/outputs/dexcount/*.csv', inclusionFlag: 'OFF', url: '']], group: 'APK Stats', numBuilds: '180', style: 'line', title: 'dexcount'
}
}

stage('Build Test-APK') {
steps {
sh "./gradlew -Pindependent='#$env.BUILD_NUMBER $env.BRANCH_NAME' assembleAndroidTest"
archiveArtifacts 'Paintroid/build/outputs/apk/androidTest/debug/*.apk'
plot csvFileName: 'dexcount.csv', csvSeries: [[displayTableFlag: false, exclusionValues: '', file: 'Paintroid/build/outputs/dexcount/*.csv', inclusionFlag: 'OFF', url: '']], group: 'APK Stats', numBuilds: '180', style: 'line', title: 'dexcount'
}
}

stage('Start emulator') {
steps {
sh './gradlew startEmulator'
}
}

stage('Take sreenshots') {
steps {
sh "fastlane screengrab"
}
post {
success {
zip zipFile: 'metadata.zip', archive: false, dir: 'fastlane/metadata'
archiveArtifacts artifacts: 'metadata.zip', fingerprint: true
}
}
}

stage('Review') {
//agent none
options {
timeout(time: 6, unit: 'HOURS')
}
steps {
script {
env.APPROVE_DEPLOY = input message: 'User input required',
parameters: [choice(name: 'Deploy', choices: 'no\nyes',
description: 'Please review the Screenshots! Do you want to deploy this to Google Play?')]
}
}
}

stage('Upload sreenshots to googlePlay') {
when {
allOf {
environment name: 'UPLOAD_SCREENSHOTS', value: 'true'
environment name: 'APPROVE_DEPLOY', value: 'yes'
}
}
steps {
sh 'fastlane android upload_Screenshots_Paintroid'
}
}
}

post {
always {
// clean workspace
deleteDir()
}
}
}
10 changes: 10 additions & 0 deletions Paintroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ android {

testOptions {
unitTests.returnDefaultValues = true
animationsDisabled = true
}

packagingOptions {
exclude "META-INF/AL2.0"
exclude "META-INF/LGPL2.1"
}
}

Expand All @@ -122,17 +128,21 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'com.esotericsoftware:kryo:5.1.1'
implementation 'id.zelory:compressor:2.1.1'

debugImplementation 'androidx.multidex:multidex:2.0.0'

implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.jraska:falcon:2.2.0'

testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.18.3'

androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'org.mockito:mockito-android:2.18.3'
androidTestImplementation 'tools.fastlane:screengrab:2.1.0'

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Paintroid: An image manipulation application for Android.
* Copyright (C) 2010-2015 The Catrobat Team
* Copyright (C) 2010-2021 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -24,9 +24,15 @@

import org.catrobat.paintroid.MainActivity;
import org.catrobat.paintroid.R;
import org.catrobat.paintroid.UserPreferences;
import org.catrobat.paintroid.command.CommandFactory;
import org.catrobat.paintroid.command.CommandManager;
import org.catrobat.paintroid.contract.MainActivityContracts;
import org.catrobat.paintroid.controller.ToolController;
import org.catrobat.paintroid.presenter.MainActivityPresenter;
import org.catrobat.paintroid.test.utils.ScreenshotOnFailRule;
import org.catrobat.paintroid.tools.Workspace;
import org.catrobat.paintroid.ui.Perspective;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -50,10 +56,39 @@
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@SuppressWarnings("PMD.UnusedPrivateField")
public class MainActivityIntegrationTest {

@Mock
private MainActivityContracts.MainView view;
@Mock
private MainActivityContracts.Model model;
@Mock
private MainActivityContracts.Navigator navigator;
@Mock
private MainActivityContracts.Interactor interactor;
@Mock
private MainActivityContracts.TopBarViewHolder topBarViewHolder;
@Mock
private MainActivityContracts.DrawerLayoutViewHolder drawerLayoutViewHolder;
@Mock
private Workspace workspace;
@Mock
private Perspective perspective;
@Mock
private ToolController toolController;
@Mock
private CommandFactory commandFactory;
@Mock
private CommandManager commandManager;
@Mock
private MainActivityContracts.BottomBarViewHolder bottomBarViewHolder;
@Mock
private MainActivityContracts.BottomNavigationViewHolder bottomNavigationViewHolder;
@Mock
private UserPreferences sharedPreferences;
@Mock
private Context context;

@InjectMocks
private MainActivityPresenter presenter;
Expand Down
Loading

0 comments on commit ca8ba23

Please sign in to comment.