Skip to content

Commit

Permalink
dockerfile update and Jenkinsfile skip gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
goschale committed Jun 10, 2022
1 parent 3275f52 commit fc18641
Show file tree
Hide file tree
Showing 49 changed files with 849 additions and 715 deletions.
18 changes: 11 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pipeline {
stage('Build Debug-APK') {
steps {
sh "./gradlew -Pindependent='#$env.BUILD_NUMBER $env.BRANCH_NAME' assembleDebug"
renameApks("${env.BRANCH_NAME}-${env.BUILD_NUMBER}")
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'
}
Expand All @@ -81,12 +82,13 @@ pipeline {
sh 'rm -rf Catroid; mkdir Catroid'
dir('Catroid') {
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 "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"
}
renameApks("${env.BRANCH_NAME}-${env.BUILD_NUMBER}")
dir('Catroid') {
archiveArtifacts "catroid/src/main/libs/*.aar"
sh "./gradlew assembleCatroidDebug"
archiveArtifacts 'catroid/build/outputs/apk/catroid/debug/catroid-catroid-debug.apk'
}
Expand Down Expand Up @@ -124,7 +126,9 @@ pipeline {

stage('Device Tests') {
steps {
sh './gradlew -PenableCoverage -Pjenkins startEmulator adbDisableAnimationsGlobally createDebugCoverageReport -i'
sh 'echo no | avdmanager create avd --force --name android28 --package 'system-images;android-28;default;x86_64''
sh './home/user/android/sdk/emulator/emulator -no-window -no-boot-anim -noaudio -avd android28'
sh './gradlew -PenableCoverage -Pjenkins -Pemulator=android28 -Pci createDebugCoverageReport -i'
}
post {
always {
Expand Down
1 change: 0 additions & 1 deletion Paintroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ android {
// specific ignores should be defined via lint.xml file
lintConfig file('config/lint.xml')
ignore 'ClickableViewAccessibility', 'StaticFieldLeak', 'GradleDependency', 'OldTargetApi', 'LintBaseline'
baseline file('config/lint-baseline.xml')
textReport true
xmlReport true
htmlReport true
Expand Down
4 changes: 0 additions & 4 deletions Paintroid/config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,4 @@
<property name="onCommentFormat" value="@formatter\:on" />
</module>

<module name="SuppressionFilter">
<property name="file" value="Paintroid/config/checkstyle_suppressions.xml" />
</module>

</module>
24 changes: 0 additions & 24 deletions Paintroid/config/checkstyle_suppressions.xml

This file was deleted.

22 changes: 0 additions & 22 deletions Paintroid/config/lint-baseline.xml

This file was deleted.

13 changes: 13 additions & 0 deletions Paintroid/config/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,17 @@
<issue id="ShowToast">
<ignore path="src/main/java/org/catrobat/paintroid/ui/ToastFactory.java" />
</issue>

<issue id="UnusedResources">
<ignore path="res/drawable/ic_launcher_background.xml" />
</issue>

<issue id="UnusedResources">
<ignore path="res/drawable/ic_launcher_foreground.xml" />
</issue>

<issue id="UnusedResources">
<ignore regexp="res/mipmap*" />
</issue>

</lint>
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-2022 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -43,9 +43,11 @@
import static org.catrobat.paintroid.test.espresso.util.UiInteractions.swipeAccurate;
import static org.catrobat.paintroid.test.espresso.util.UiInteractions.touchAt;
import static org.catrobat.paintroid.test.espresso.util.UiMatcher.withDrawable;
import static org.catrobat.paintroid.test.espresso.util.wrappers.ColorPickerViewInteraction.onColorPickerView;
import static org.catrobat.paintroid.test.espresso.util.wrappers.DrawingSurfaceInteraction.onDrawingSurfaceView;
import static org.catrobat.paintroid.test.espresso.util.wrappers.ToolBarViewInteraction.onToolBarView;
import static org.catrobat.paintroid.test.espresso.util.wrappers.TopBarViewInteraction.onTopBarView;
import static org.catrobat.paintroid.test.utils.TestUtils.selectColorInDialog;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -324,4 +326,44 @@ public void testUndoRedoDoesNotResetLayerVisibility() {

DrawingSurfaceInteraction.onDrawingSurfaceView().checkPixelColor(Color.BLACK, BitmapLocationProvider.HALFWAY_LEFT_MIDDLE);
}

@Test
public void testChangeColorUndoRedo() {
selectColorInDialog(0);
selectColorInDialog(1);
selectColorInDialog(2);

onTopBarView().performUndo();
onTopBarView().performUndo();
onTopBarView().performUndo();
onColorPickerView()
.performOpenColorPicker();
onColorPickerView().checkCurrentViewColor(Color.BLACK);
onColorPickerView()
.onNegativeButton()
.perform(click());
onTopBarView().performRedo();
onTopBarView().performRedo();
onTopBarView().performRedo();

onDrawingSurfaceView().perform(swipeAccurate(DrawingSurfaceLocationProvider.HALFWAY_TOP_MIDDLE, DrawingSurfaceLocationProvider.HALFWAY_RIGHT_MIDDLE));

DrawingSurfaceInteraction.onDrawingSurfaceView().checkPixelColor(Color.parseColor("#FF078707"), BitmapLocationProvider.HALFWAY_TOP_MIDDLE);

onTopBarView().performUndo();
onTopBarView().performUndo();
onTopBarView().performUndo();

onDrawingSurfaceView().perform(swipeAccurate(DrawingSurfaceLocationProvider.HALFWAY_BOTTOM_MIDDLE, DrawingSurfaceLocationProvider.HALFWAY_LEFT_MIDDLE));

DrawingSurfaceInteraction.onDrawingSurfaceView().checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_MIDDLE);

onTopBarView().performUndo();
onTopBarView().performUndo();
onTopBarView().performRedo();

onDrawingSurfaceView().perform(swipeAccurate(DrawingSurfaceLocationProvider.HALFWAY_TOP_MIDDLE, DrawingSurfaceLocationProvider.HALFWAY_RIGHT_MIDDLE));

DrawingSurfaceInteraction.onDrawingSurfaceView().checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_TOP_MIDDLE);
}
}
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-2022 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -44,6 +44,7 @@
import static org.catrobat.paintroid.test.espresso.util.wrappers.ToolBarViewInteraction.onToolBarView;
import static org.catrobat.paintroid.test.espresso.util.wrappers.ToolPropertiesInteraction.onToolProperties;
import static org.catrobat.paintroid.test.espresso.util.wrappers.TopBarViewInteraction.onTopBarView;
import static org.catrobat.paintroid.test.utils.TestUtils.selectColorInDialog;
import static org.hamcrest.Matchers.allOf;

import static androidx.test.espresso.Espresso.onView;
Expand Down Expand Up @@ -485,4 +486,113 @@ public void testUndoWithDrawingConnectedLines() {

onTopBarView().performClickCheckmark();
}

@Test
public void testColorChangesInConnectedLineMode() {
onToolProperties().setColor(Color.BLACK);

onDrawingSurfaceView()
.perform(touchAt(DrawingSurfaceLocationProvider.HALFWAY_LEFT_MIDDLE));

onDrawingSurfaceView()
.perform(touchAt(DrawingSurfaceLocationProvider.HALFWAY_RIGHT_MIDDLE));

onTopBarView().performClickPlus();

onDrawingSurfaceView()
.perform(swipe(DrawingSurfaceLocationProvider.HALFWAY_TOP_LEFT, DrawingSurfaceLocationProvider.HALFWAY_BOTTOM_RIGHT));

selectColorInDialog(0);

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

selectColorInDialog(1);

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF00B4F1"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onTopBarView().performUndo();

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onTopBarView().performRedo();

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF00B4F1"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onTopBarView().performUndo();
onTopBarView().performUndo();
onTopBarView().performUndo();

onDrawingSurfaceView()
.checkPixelColor(Color.TRANSPARENT, BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onTopBarView().performUndo();

onDrawingSurfaceView()
.checkPixelColor(Color.TRANSPARENT, BitmapLocationProvider.MIDDLE);

onTopBarView().performRedo();
onTopBarView().performRedo();
onTopBarView().performRedo();
onTopBarView().performRedo();

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onTopBarView().performClickCheckmark();
}

@Test
public void testColorChangesAndQuittingConnectedLineMode() {
onToolProperties().setColor(Color.BLACK);

onDrawingSurfaceView()
.perform(touchAt(DrawingSurfaceLocationProvider.HALFWAY_LEFT_MIDDLE));

onDrawingSurfaceView()
.perform(touchAt(DrawingSurfaceLocationProvider.HALFWAY_RIGHT_MIDDLE));

onTopBarView().performClickPlus();

onDrawingSurfaceView()
.perform(swipe(DrawingSurfaceLocationProvider.HALFWAY_TOP_LEFT, DrawingSurfaceLocationProvider.HALFWAY_BOTTOM_RIGHT));

selectColorInDialog(0);

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

selectColorInDialog(1);

selectColorInDialog(2);

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF078707"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onTopBarView().performUndo();
onTopBarView().performUndo();

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF00B4F1"), BitmapLocationProvider.HALFWAY_BOTTOM_RIGHT);

onDrawingSurfaceView()
.perform(touchAt(DrawingSurfaceLocationProvider.HALFWAY_BOTTOM_LEFT));

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_LEFT);

onDrawingSurfaceView()
.checkPixelColor(Color.TRANSPARENT, BitmapLocationProvider.HALFWAY_BOTTOM_MIDDLE);

onDrawingSurfaceView()
.perform(touchAt(DrawingSurfaceLocationProvider.HALFWAY_BOTTOM_RIGHT));

onDrawingSurfaceView()
.checkPixelColor(Color.parseColor("#FF0074CD"), BitmapLocationProvider.HALFWAY_BOTTOM_MIDDLE);

onTopBarView().performClickCheckmark();
}
}
Loading

0 comments on commit fc18641

Please sign in to comment.