Skip to content

Commit

Permalink
PAINTROID-221 migrate away from JCenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Tscheppe committed May 25, 2022
1 parent 8abd3d6 commit 934b89a
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 69 deletions.
33 changes: 9 additions & 24 deletions Paintroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

apply plugin: 'com.android.library'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'kotlin-android'
apply plugin: 'org.catrobat.gradle.androidemulators'

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

emulators {
install project.hasProperty('installSdk')

Expand All @@ -42,15 +49,6 @@ emulators {
}
}

apply plugin: 'com.android.library'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: 'com.github.panpf.bintray-publish'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'kotlin-android'

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

jacoco {
toolVersion = "0.8.5"
}
Expand All @@ -74,8 +72,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildTypes {
Expand Down Expand Up @@ -154,19 +152,6 @@ tasks.withType(Javadoc).all {
enabled = false
}

publish {
userOrg = 'catrobat'
repoName = 'Paintroid'
groupId = 'org.catrobat.paintroid'
artifactId = 'paintroid'
publishVersion = rootProject.ext.androidVersionName
licences = ['AGPL-V3']
desc = 'A graphical paint editor library for Android'
website = 'https://github.com/Catrobat/Paintroid'
issueTracker = 'https://jira.catrob.at/browse/PAINTROID'
repository = "${website}.git"
}

if (project.hasProperty('jenkins')) {
android.dexOptions.preDexLibraries = false
}
4 changes: 2 additions & 2 deletions Paintroid/config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ formatting:
active: false
autoCorrect: true
Indentation:
active: true
active: false
autoCorrect: true
indentSize: 4
continuationIndentSize: 4
Expand Down Expand Up @@ -253,7 +253,7 @@ formatting:
active: true
autoCorrect: true
ParameterListWrapping:
active: true
active: false
autoCorrect: true
indentSize: 4
SpacingAroundColon:
Expand Down
4 changes: 2 additions & 2 deletions Paintroid/gradle/adb_tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'org.catrobat.gradle.androidemulators:android-emulators-gradle:1.0.1'
classpath 'com.github.Catrobat:Gradle:v1.6.2'
}
}

Expand Down
4 changes: 2 additions & 2 deletions Paintroid/gradle/code_quality_tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {

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

detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0"
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.20.0"
}

task checkstyle(type: Checkstyle) {
Expand Down Expand Up @@ -70,7 +70,7 @@ task pmd(type: Pmd) {
}

detekt {
toolVersion = "1.14.2"
toolVersion = "1.20.0"
config = files("$rootDir/Paintroid/config/detekt.yml")
input = files("$rootDir/colorpicker/", "$rootDir/Paintroid/")
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package org.catrobat.paintroid
import android.content.ContentResolver
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Build.VERSION
Expand Down Expand Up @@ -679,4 +680,10 @@ class MainActivity : AppCompatActivity(), MainView, CommandListener {
}
}
}

fun getVersionCode(): String = try {
packageManager.getPackageInfo(packageName, 0).versionName
} catch (e: PackageManager.NameNotFoundException) {
""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.core.text.HtmlCompat
import org.catrobat.paintroid.BuildConfig
import org.catrobat.paintroid.MainActivity
import org.catrobat.paintroid.R

class AboutDialog : AppCompatDialogFragment() {
Expand All @@ -51,7 +51,8 @@ class AboutDialog : AppCompatDialogFragment() {
val aboutContentView = view.findViewById<TextView>(R.id.pocketpaint_about_content)
val aboutLicenseView = view.findViewById<TextView>(R.id.pocketpaint_about_license_url)
val aboutCatrobatView = view.findViewById<TextView>(R.id.pocketpaint_about_catrobat_url)
val aboutVersion = getString(R.string.pocketpaint_about_version, BuildConfig.VERSION_NAME)
val activity = requireActivity() as MainActivity
val aboutVersion = getString(R.string.pocketpaint_about_version, activity.getVersionCode())
aboutVersionView.text = aboutVersion
val aboutContent = getString(
R.string.pocketpaint_about_content,
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

signingConfigs {
Expand Down
17 changes: 8 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,23 @@
buildscript {
ext.kotlin_version = '1.4.32'
repositories {
mavenCentral()
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.hiya:jacoco-android:0.2'
classpath 'org.catrobat.gradle.androidemulators:android-emulators-gradle:1.6.2'
classpath 'com.github.Catrobat:Gradle:1.6.2'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:1.0.2'
classpath 'com.github.panpf.bintray-publish:bintray-publish:1.0.0'
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

plugins {
id "io.gitlab.arturbosch.detekt" version "1.14.2"
id "io.gitlab.arturbosch.detekt" version "1.20.0"
}

ext {
Expand All @@ -60,6 +59,6 @@ allprojects {
repositories {
mavenLocal()
google()
jcenter()
mavenCentral()
}
}
20 changes: 3 additions & 17 deletions colorpicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.panpf.bintray-publish'

android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
Expand All @@ -33,12 +32,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_11.toString()
}

buildTypes {
Expand All @@ -51,19 +50,6 @@ android {
}
}

publish {
userOrg = 'catrobat'
repoName = 'Paintroid'
groupId = 'org.catrobat.paintroid'
artifactId = 'colorpicker'
publishVersion = rootProject.ext.androidVersionName
licences = ['AGPL-V3']
desc = 'A simple color picker for Android'
website = 'https://github.com/Catrobat/Paintroid'
issueTracker = 'https://jira.catrob.at/browse/PAINTROID'
repository = "${website}.git"
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
Expand Down
11 changes: 3 additions & 8 deletions docker/Dockerfile.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ FROM debian:buster
# --------------------
# Adapt the paramters below to change the dependencies.
#

# Android SDK 26.1.1
ARG ANDROID_SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"

ARG SDKMANAGER_PACKAGES="build-tools;30.0.3 platforms;android-28 cmake;3.6.4111459 system-images;android-28;default;x86_64 emulator platform-tools"
# Arguments, Environment
# ----------------------
Expand Down Expand Up @@ -44,12 +42,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
# Install Fastlane
RUN wget --no-check-certificate -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
RUN add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

RUN apt-get update && apt-get install -y adoptopenjdk-8-hotspot
RUN apt-get update
RUN apt-get install -y python2
RUN apt-get install -y --no-install-recommends \
openjdk-11-jdk-headless \
rubygems \
ruby-dev \
g++ \
Expand Down Expand Up @@ -103,6 +99,5 @@ RUN if [ ! -z "$SDKMANAGER_PACKAGES" ]; then yes | $_SDKMANAGER $SDKMANAGER_PACK
# We still use it here to ensure that these settings
# are respected, no matter what is configured elsewhere.
ENV _JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"

# Accept SDK licenses
RUN yes | $_SDKMANAGER --licenses
RUN yes | $_SDKMANAGER --licenses
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip

0 comments on commit 934b89a

Please sign in to comment.