1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 */
1919
20- apply plugin : ' com.android.library'
21- apply plugin : ' com.hiya.jacoco-android'
22- apply plugin : ' com.getkeepsafe.dexcount'
23- apply plugin : ' kotlin-android'
24- apply plugin : ' org.catrobat.gradle.androidemulators'
25- apply plugin : ' maven-publish'
20+ plugins {
21+ id " com.android.library"
22+ id " jacoco"
23+ id " com.getkeepsafe.dexcount"
24+ id " org.jetbrains.kotlin.android"
25+ id " org.catrobat.gradle.androidemulators"
26+ id " maven-publish"
27+ }
2628
27- apply from : ' gradle/adb_tasks.gradle'
28- apply from : ' gradle/code_quality_tasks.gradle'
29+ apply from : " gradle/adb_tasks.gradle"
30+ apply from : " gradle/code_quality_tasks.gradle"
2931
3032emulators {
31- install project. hasProperty(' installSdk' )
32-
33- dependencies {
34- sdk()
35- }
33+ install project. hasProperty(" installSdk" )
34+ dependencies { sdk() }
3635
37- emulator ' android28' , {
36+ emulator " android28" , {
3837 avd {
39- systemImage = ' system-images;android-28;default;x86_64'
38+ systemImage = " system-images;android-28;default;x86_64"
4039 sdcardSizeMb = 1024
41- hardwareProperties + = [' hw.ramSize' : 4096 , ' vm.heapSize' : 1024 ]
42- screenDensity = ' xhdpi'
40+ hardwareProperties + = [" hw.ramSize" : 4096 , " vm.heapSize" : 1024 ]
41+ screenDensity = " xhdpi"
4342 }
44-
4543 parameters {
46- resolution = ' 768x1280'
47- language = ' en '
48- country = ' US '
44+ resolution = " 768x1280"
45+ language = " en "
46+ country = " US "
4947 }
5048 }
5149}
@@ -54,54 +52,50 @@ jacoco {
5452 toolVersion = " 0.8.7"
5553}
5654
57- jacocoAndroidUnitTestReport {
58- csv. enabled false
59- html. enabled true
60- xml. enabled true
61- destination project. getBuildDir(). getPath() + " /reports/jacoco/jacocoTestDebugUnitTestReport"
62- }
63-
6455android {
65- compileSdkVersion rootProject. ext. androidCompileSdkVersion
56+ namespace " org.catrobat.paintroid"
57+
58+ // New AGP DSL
59+ compileSdk = rootProject. ext. androidCompileSdkVersion
6660
6761 defaultConfig {
68- minSdkVersion rootProject. ext. androidMinSdkVersion
69- targetSdkVersion rootProject. ext. androidTargetSdkVersion
70- testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner'
71- versionCode rootProject. ext. androidVersionCode
72- versionName rootProject. ext. androidVersionName
62+ minSdk = rootProject. ext. androidMinSdkVersion
63+ targetSdk = rootProject. ext. androidTargetSdkVersion
64+ testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
65+ }
66+
67+ buildFeatures {
68+ buildConfig = true
7369 }
7470
7571 compileOptions {
76- sourceCompatibility JavaVersion . VERSION_11
77- targetCompatibility JavaVersion . VERSION_11
72+ sourceCompatibility = JavaVersion . VERSION_17
73+ targetCompatibility = JavaVersion . VERSION_17
7874 }
75+ kotlinOptions { jvmTarget = " 17" }
7976
8077 buildTypes {
8178 release {
82- minifyEnabled false
83- proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
84- }
85- signedRelease {
79+ minifyEnabled = false
80+ proguardFiles(
81+ getDefaultProguardFile(" proguard-android.txt" ),
82+ " proguard-rules.pro"
83+ )
8684 }
85+ create(" signedRelease" )
8786 debug {
88- testCoverageEnabled = project. hasProperty(' enableCoverage' )
89- // Multidex is required as espresso and mockito/bytebuddy are adding more functions
90- // than should be allowed by law.
91- // See https://github.com/mockito/mockito/issues/1112
92- multiDexEnabled true
9387 }
9488 }
9589
96- lintOptions {
97- // specific ignores should be defined via lint.xml file
98- lintConfig file( ' config/lint.xml ' )
99- ignore ' ClickableViewAccessibility ' , ' StaticFieldLeak ' , ' GradleDependency' , ' OldTargetApi' , ' LintBaseline'
100- textReport true
101- xmlReport true
102- htmlReport true
103- xmlOutput file(" build/reports/lint-report.xml" )
104- htmlOutput file(" build/reports/lint-report.html" )
90+ lint {
91+ lintConfig file( " config/ lint.xml" )
92+ disable " ClickableViewAccessibility " , " StaticFieldLeak " ,
93+ " GradleDependency" , " OldTargetApi" , " LintBaseline"
94+ textReport = true
95+ xmlReport = true
96+ htmlReport = true
97+ xmlOutput = file(" build/reports/lint-report.xml" )
98+ htmlOutput = file(" build/reports/lint-report.html" )
10599 }
106100
107101 testOptions {
@@ -111,54 +105,51 @@ android {
111105
112106 packagingOptions {
113107 resources {
114- excludes + = [' META-INF/AL2.0' , ' META-INF/LGPL2.1' , " **/attach_hotspot_windows.dll" ]
115- merges + = [' META-INF/licenses/ASM' ]
108+ excludes + = [" META-INF/AL2.0" , " META-INF/LGPL2.1" , " **/attach_hotspot_windows.dll" ]
109+ merges + = [" META-INF/licenses/ASM" ]
116110 }
117111 }
118112}
119113
120114dependencies {
121- implementation ' androidx.appcompat:appcompat:1.0.0'
122- implementation ' com.google.android.material:material:1.2.1'
123- implementation project(' :colorpicker' )
115+ implementation " androidx.appcompat:appcompat:1.0.0"
116+ implementation " com.google.android.material:material:1.2.1"
117+ implementation project(" :colorpicker" )
124118
125- implementation ' androidx.core:core-ktx:1.3.2'
119+ implementation " androidx.core:core-ktx:1.3.2"
126120 implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
127- implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
128- implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
129- implementation ' androidx.exifinterface:exifinterface:1.3.2'
130- implementation ' com.esotericsoftware:kryo:5.5.0'
131- implementation ' id.zelory:compressor:2.1.1'
132- implementation ' androidx.constraintlayout:constraintlayout:2.1.4'
133-
134- debugImplementation ' androidx.multidex:multidex:2.0.0'
135-
136- implementation ' com.nostra13.universalimageloader:universal-image-loader:1.9.5'
137- implementation ' com.jraska:falcon:2.2.0'
138-
139- testImplementation ' junit:junit:4.12'
140- testImplementation ' org.mockito:mockito-core:2.18.3'
141- testImplementation ' com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
142-
143- androidTestImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3'
144- androidTestImplementation ' androidx.test.ext:junit:1.1.3'
145- androidTestImplementation ' androidx.test:rules:1.1.1'
146- androidTestImplementation ' org.mockito:mockito-android:3.6.28'
147- androidTestImplementation ' tools.fastlane:screengrab:2.1.0'
148- androidTestImplementation ' com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
149-
150- androidTestImplementation ' androidx.test.espresso:espresso-core:3.5.1'
151- androidTestImplementation ' androidx.test.espresso:espresso-contrib:3.1.0'
152- androidTestImplementation ' androidx.test.espresso:espresso-intents:3.1.0'
121+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8"
122+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8"
123+ implementation " androidx.exifinterface:exifinterface:1.3.2"
124+ implementation " com.esotericsoftware:kryo:5.5.0"
125+ implementation " id.zelory:compressor:2.1.1"
126+ implementation " androidx.constraintlayout:constraintlayout:2.1.4"
127+ implementation ' androidx.test:monitor:1.8.0'
128+
129+ debugImplementation " androidx.multidex:multidex:2.0.0"
130+
131+ implementation " com.nostra13.universalimageloader:universal-image-loader:1.9.5"
132+ implementation " com.jraska:falcon:2.2.0"
133+
134+ testImplementation " junit:junit:4.12"
135+ testImplementation " org.mockito:mockito-core:2.18.3"
136+ testImplementation " com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
137+
138+ androidTestImplementation " org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3"
139+ androidTestImplementation " androidx.test.ext:junit:1.1.3"
140+ androidTestImplementation " androidx.test:rules:1.1.1"
141+ androidTestImplementation " org.mockito:mockito-android:3.6.28"
142+ androidTestImplementation " tools.fastlane:screengrab:2.1.0"
143+ androidTestImplementation " com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
144+
145+ androidTestImplementation " androidx.test.espresso:espresso-core:3.5.1"
146+ androidTestImplementation " androidx.test.espresso:espresso-contrib:3.1.0"
147+ androidTestImplementation " androidx.test.espresso:espresso-intents:3.1.0"
153148 androidTestImplementation " androidx.test.uiautomator:uiautomator:2.2.0"
154149 testImplementation " androidx.test:core-ktx:1.4.0"
155- implementation ' com.android.support.test.espresso:espresso-idling-resource:3.1.0'
156- }
157150
158- tasks. withType(Javadoc ). all {
159- enabled = false
151+ implementation " androidx.test.espresso:espresso-idling-resource:3.5.1"
160152}
161153
162- if (project. hasProperty(' jenkins' )) {
163- android. dexOptions. preDexLibraries = false
164- }
154+ tasks. withType(Javadoc ). configureEach { enabled = false }
155+
0 commit comments