Skip to content

Commit 628a1d3

Browse files
committed
Fix gradle files
1 parent 8eae975 commit 628a1d3

7 files changed

Lines changed: 94 additions & 57 deletions

File tree

‎app/build.gradle‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
apply plugin: 'com.android.application'
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
}
24

35
android {
6+
namespace 'com.welie.blessedexample'
47
compileSdk 34
8+
59
defaultConfig {
610
applicationId "com.welie.blessedexample"
711
minSdkVersion 21
@@ -10,6 +14,7 @@ android {
1014
versionName "1.0"
1115
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1216
}
17+
1318
buildTypes {
1419
release {
1520
minifyEnabled false
@@ -20,14 +25,16 @@ android {
2025
sourceCompatibility JavaVersion.VERSION_1_8
2126
targetCompatibility JavaVersion.VERSION_1_8
2227
}
23-
namespace 'com.welie.blessedexample'
28+
2429
}
2530

2631
dependencies {
2732
implementation fileTree(include: ['*.jar'], dir: 'libs')
28-
implementation 'androidx.appcompat:appcompat:1.7.0'
29-
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
30-
implementation 'com.jakewharton.timber:timber:5.0.1'
33+
implementation libs.appcompat
34+
implementation libs.constraintlayout
35+
implementation libs.timber
3136
implementation project(':blessed')
32-
testImplementation 'junit:junit:4.13.2'
37+
testImplementation libs.junit
38+
androidTestImplementation libs.ext.junit
39+
androidTestImplementation libs.espresso.core
3340
}

‎blessed/build.gradle‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
apply plugin: 'com.android.library'
2-
apply plugin: 'maven-publish'
1+
plugins {
2+
id 'com.android.library'
3+
id 'maven-publish'
4+
}
35

46
group = 'com.github.weliem'
57

@@ -32,12 +34,12 @@ android {
3234
}
3335

3436
dependencies {
35-
implementation 'com.jakewharton.timber:timber:5.0.1'
36-
implementation 'org.jetbrains:annotations:23.0.0'
37-
testImplementation 'junit:junit:4.13.2'
38-
testImplementation "org.robolectric:robolectric:4.13"
39-
testImplementation "org.mockito:mockito-core:3.8.0"
40-
testImplementation 'androidx.test:core:1.6.1'
37+
implementation libs.timber
38+
implementation libs.annotations
39+
testImplementation libs.junit
40+
testImplementation libs.robolectric
41+
testImplementation libs.mockito.core
42+
testImplementation libs.core
4143
}
4244

4345
afterEvaluate {
@@ -54,8 +56,3 @@ afterEvaluate {
5456
}
5557
}
5658

57-
java {
58-
toolchain {
59-
languageVersion = JavaLanguageVersion.of(17)
60-
}
61-
}

‎build.gradle‎

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
3-
buildscript {
4-
repositories {
5-
google()
6-
mavenCentral()
7-
8-
}
9-
dependencies {
10-
classpath 'com.android.tools.build:gradle:8.1.4'
11-
12-
// NOTE: Do not place your application dependencies here; they belong
13-
// in the individual module build.gradle files
14-
}
15-
}
16-
17-
allprojects {
18-
repositories {
19-
google()
20-
mavenCentral()
21-
}
22-
}
23-
24-
task clean(type: Delete) {
25-
delete rootProject.buildDir
26-
}
2+
plugins {
3+
alias(libs.plugins.android.application) apply false
4+
alias(libs.plugins.android.library) apply false
5+
}

‎gradle.properties‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
android.useAndroidX=true
10-
org.gradle.jvmargs=-Xmx1536m
9+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1110
# When configured, Gradle will run in incubating parallel mode.
12-
# This option should only be used with decoupled projects. More details, visit
13-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
11+
# This option should only be used with decoupled projects. For more details, visit
12+
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
1413
# org.gradle.parallel=true
15-
android.nonTransitiveRClass=true
16-
android.defaults.buildfeatures.buildconfig=true
17-
android.nonFinalResIds=false
18-
14+
# AndroidX package structure to make it clearer which packages are bundled with the
15+
# Android operating system, and which are packaged with your app's APK
16+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
17+
android.useAndroidX=true
18+
# Enables namespacing of each library's R class so that its R class includes only the
19+
# resources declared in the library itself and none from the library's dependencies,
20+
# thereby reducing the size of the R class for that library
21+
android.nonTransitiveRClass=true

‎gradle/libs.versions.toml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[versions]
2+
agp = "8.1.4"
3+
annotations = "20.1.0"
4+
core = "1.5.0"
5+
junit = "4.13.2"
6+
junitVersion = "1.2.1"
7+
espressoCore = "3.6.1"
8+
appcompat = "1.6.1"
9+
material = "1.12.0"
10+
activity = "1.10.1"
11+
constraintlayout = "2.1.4"
12+
mockitoCore = "3.8.0"
13+
robolectric = "4.10.3"
14+
timber = "5.0.1"
15+
16+
[libraries]
17+
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }
18+
core = { module = "androidx.test:core", version.ref = "core" }
19+
junit = { group = "junit", name = "junit", version.ref = "junit" }
20+
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
21+
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
22+
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
23+
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
24+
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
25+
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
26+
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
27+
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
28+
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
29+
30+
[plugins]
31+
android-application = { id = "com.android.application", version.ref = "agp" }
32+
android-library = { id = "com.android.library", version.ref = "agp" }
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
#Sun May 18 19:46:38 CEST 2025
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4-
networkTimeout=10000
5-
validateDistributionUrl=true
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
65
zipStoreBase=GRADLE_USER_HOME
76
zipStorePath=wrapper/dists

‎settings.gradle‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
plugins {
2-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
1+
pluginManagement {
2+
repositories {
3+
google {
4+
content {
5+
includeGroupByRegex("com\\.android.*")
6+
includeGroupByRegex("com\\.google.*")
7+
includeGroupByRegex("androidx.*")
8+
}
9+
}
10+
mavenCentral()
11+
gradlePluginPortal()
12+
}
313
}
14+
15+
dependencyResolutionManagement {
16+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
17+
repositories {
18+
google()
19+
mavenCentral()
20+
}
21+
}
22+
23+
rootProject.name = "blessed-android"
424
include ':app', ':blessed'

0 commit comments

Comments
 (0)