Skip to content

Commit 5bc1a5d

Browse files
committed
Update build files
Restructure and use version catalog as in current best practice examples
1 parent f039a4e commit 5bc1a5d

File tree

6 files changed

+131
-67
lines changed

6 files changed

+131
-67
lines changed

app/build.gradle

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
apply plugin: 'com.android.application'
2-
apply plugin: 'de.mobilej.unmock'
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
}
34

45
// Place actual signing configuration in "keystore.properties"
56
// "keystore.properties" is in .gitignore and will not be checked into repo
@@ -11,6 +12,8 @@ def keystoreProperties = new Properties()
1112
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
1213

1314
android {
15+
namespace 'de.stephanlindauer.criticalmaps'
16+
1417
signingConfigs {
1518
releaseConfig {
1619
keyAlias keystoreProperties['keyAlias']
@@ -20,7 +23,9 @@ android {
2023
}
2124
}
2225

23-
compileSdk 36
26+
compileSdk {
27+
version = release(36)
28+
}
2429

2530
defaultConfig {
2631
applicationId "de.stephanlindauer.criticalmaps"
@@ -69,37 +74,34 @@ android {
6974
lint {
7075
warning 'MissingTranslation', 'StringFormatInvalid', 'NewApi', 'InvalidPackage'
7176
}
72-
73-
namespace 'de.stephanlindauer.criticalmaps'
7477
}
7578

7679
dependencies {
77-
implementation 'com.squareup:otto:1.3.8'
78-
implementation 'org.maplibre.gl:android-sdk:12.0.1'
79-
implementation 'com.squareup.picasso:picasso:2.8'
80-
implementation 'androidx.core:core:1.17.0'
81-
implementation 'androidx.appcompat:appcompat:1.7.1'
82-
implementation 'androidx.annotation:annotation:1.9.1'
83-
implementation 'com.google.android.material:material:1.13.0'
84-
implementation 'androidx.exifinterface:exifinterface:1.4.1'
85-
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
86-
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
87-
implementation 'com.jakewharton.timber:timber:5.0.1'
88-
implementation 'com.squareup.okhttp3:okhttp:5.3.0'
89-
implementation 'info.metadude.android:typed-preferences:2.1.0'
90-
91-
implementation "com.google.dagger:dagger:$dagger_version"
92-
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
93-
94-
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
95-
96-
testImplementation 'junit:junit:4.13.2'
97-
testImplementation 'com.google.truth:truth:1.4.5'
98-
testImplementation 'org.mockito:mockito-core:5.20.0'
99-
100-
androidTestImplementation 'androidx.test:core:1.7.0'
101-
androidTestImplementation 'androidx.test:runner:1.7.0'
102-
androidTestImplementation 'androidx.test:rules:1.7.0'
103-
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
104-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
80+
implementation libs.otto
81+
implementation libs.maplibre
82+
implementation libs.picasso
83+
implementation libs.timber
84+
implementation libs.okhttp
85+
implementation libs.typed.preferences
86+
implementation libs.material
87+
implementation libs.androidx.core
88+
implementation libs.androidx.appcompat
89+
implementation libs.androidx.annotation
90+
implementation libs.androidx.exifinterface
91+
implementation libs.androidx.constraintlayout
92+
93+
implementation libs.dagger
94+
annotationProcessor libs.dagger.compiler
95+
96+
debugImplementation libs.leakcanary
97+
98+
testImplementation libs.junit
99+
testImplementation libs.com.google.truth
100+
testImplementation libs.org.mockito.core
101+
102+
androidTestImplementation libs.androidx.junit
103+
androidTestImplementation libs.androidx.test.core
104+
androidTestImplementation libs.androidx.test.runner
105+
androidTestImplementation libs.androidx.test.rules
106+
androidTestImplementation libs.androidx.espresso.core
105107
}

build.gradle

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
buildscript {
2-
ext {
3-
dagger_version = "2.57.2"
4-
}
5-
6-
repositories {
7-
google()
8-
mavenCentral()
9-
gradlePluginPortal() // unmockplugin
10-
}
11-
12-
dependencies {
13-
classpath 'com.android.tools.build:gradle:8.13.0'
14-
classpath 'com.github.bjoernq:unmockplugin:0.9.0'
15-
}
16-
}
17-
18-
allprojects {
19-
repositories {
20-
google()
21-
mavenCentral()
22-
}
1+
plugins {
2+
alias(libs.plugins.android.application) apply false
233
}

gradle.properties

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
# Project-wide Gradle settings.
2-
32
# IDE (e.g. Android Studio) users:
43
# Gradle settings configured through the IDE *will override*
54
# any settings specified in this file.
6-
75
# For more details on how to configure your build environment visit
86
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
107
# Specifies the JVM arguments used for the daemon process.
118
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14-
android.nonTransitiveRClass=true
15-
android.useAndroidX=true
16-
org.gradle.jvmargs=-Xmx1536M
9+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1710

1811
# When configured, Gradle will run in incubating parallel mode.
19-
# This option should only be used with decoupled projects. More details, visit
20-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
21-
# org.gradle.parallel=true
12+
# This option should only be used with decoupled projects. For more details, visit
13+
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
14+
# org.gradle.parallel=true
15+
16+
# AndroidX package structure to make it clearer which packages are bundled with the
17+
# Android operating system, and which are packaged with your app's APK
18+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
19+
android.useAndroidX=true
20+
21+
# Kotlin code style for this project: "official" or "obsolete":
22+
# kotlin.code.style=official
23+
24+
# Enables namespacing of each library's R class so that its R class includes only the
25+
# resources declared in the library itself and none from the library's dependencies,
26+
# thereby reducing the size of the R class for that library
27+
android.nonTransitiveRClass=true

gradle/libs.versions.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[versions]
2+
otto = "1.3.8"
3+
mapLibre = "12.0.1"
4+
picasso = "2.8"
5+
timber = "5.0.1"
6+
okhttp = "5.3.0"
7+
typedPreferences = "2.1.0"
8+
material = "1.13.0"
9+
core = "1.17.0"
10+
appcompat = "1.7.1"
11+
annotation = "1.9.1"
12+
exifinterface = "1.4.1"
13+
constraintLayout = "2.2.1"
14+
dagger = "2.57.2"
15+
leakcanary = "2.14"
16+
junit = "4.13.2"
17+
truth = "1.4.5"
18+
mockito = "5.20.0"
19+
junitVersion = "1.3.0"
20+
androidTest = "1.7.0"
21+
espressoCore = "3.7.0"
22+
agp = "8.13.0"
23+
24+
[libraries]
25+
otto = { group = "com.squareup", name = "otto", version.ref = "otto" }
26+
maplibre = { group = "org.maplibre.gl", name = "android-sdk", version.ref = "mapLibre" }
27+
picasso = { group = "com.squareup.picasso", name = "picasso", version.ref = "picasso" }
28+
timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" }
29+
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
30+
typed-preferences = { group = "info.metadude.android", name = "typed-preferences", version.ref = "typedPreferences" }
31+
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
32+
androidx-core = { group = "androidx.core", name = "core", version.ref = "core" }
33+
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
34+
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "annotation" }
35+
androidx-exifinterface = { group = "androidx.exifinterface", name = "exifinterface", version.ref = "exifinterface" }
36+
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintLayout" }
37+
dagger = { group = "com.google.dagger", name = "dagger", version.ref = "dagger" }
38+
dagger-compiler = { group = "com.google.dagger", name = "dagger-compiler", version.ref = "dagger" }
39+
leakcanary = { group = "com.squareup.leakcanary", name = "leakcanary-android", version.ref = "leakcanary" }
40+
junit = { group = "junit", name = "junit", version.ref = "junit" }
41+
com-google-truth = { group = "com.google.truth", name = "truth", version.ref = "truth" }
42+
org-mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
43+
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
44+
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidTest" }
45+
androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidTest" }
46+
androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidTest" }
47+
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
48+
49+
[plugins]
50+
android-application = { id = "com.android.application", version.ref = "agp" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#Sun Nov 08 23:45:32 CET 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
5+
networkTimeout=10000
6+
validateDistributionUrl=true
47
zipStoreBase=GRADLE_USER_HOME
58
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip

settings.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1+
pluginManagement {
2+
repositories {
3+
4+
google {
5+
content {
6+
includeGroupByRegex("com\\.android.*")
7+
includeGroupByRegex("com\\.google.*")
8+
includeGroupByRegex("androidx.*")
9+
}
10+
}
11+
mavenCentral()
12+
gradlePluginPortal()
13+
}
14+
}
15+
16+
dependencyResolutionManagement {
17+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
18+
repositories {
19+
google()
20+
mavenCentral()
21+
}
22+
}
23+
24+
rootProject.name = "criticalmaps-android"
125
include ':app'

0 commit comments

Comments
 (0)