Skip to content

Commit 2b08fb3

Browse files
author
Adil Hussain
committed
Upgraded dependencies and moved all version definitions to the "libs.versions.toml" file.
1 parent c18598e commit 2b08fb3

File tree

9 files changed

+68
-61
lines changed

9 files changed

+68
-61
lines changed

build.gradle

Lines changed: 0 additions & 14 deletions
This file was deleted.

build.gradle.kts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2+
3+
plugins {
4+
alias(libs.plugins.android.library) apply false
5+
alias(libs.plugins.benmanes.versions)
6+
alias(libs.plugins.jetbrains.kotlin.android) apply false
7+
}
8+
9+
tasks.wrapper {
10+
gradleVersion = "8.5"
11+
}
12+
13+
// Alter the default behaviour of the "com.github.ben-manes.versions" plugin
14+
tasks.withType<DependencyUpdatesTask> {
15+
rejectVersionIf { isNonStable(candidate.version) }
16+
}
17+
18+
/**
19+
* @param version The version name to evaluate.
20+
* @return true if and only if the given version name represents a non-stable version.
21+
*/
22+
fun isNonStable(version: String): Boolean {
23+
val versionInLowercase = version.lowercase()
24+
25+
return setOf("-alpha", "-beta", "-rc").any { versionInLowercase.contains(it) }
26+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ android.useAndroidX=true
44

55
projectGroupName=com.tazkiyatech
66
projectArtifactName=android-utils
7-
projectVersionName=0.2.6
7+
projectVersionName=1.0.0

gradle/libs.versions.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[versions]
2+
junit5 = "5.10.1"
3+
4+
[libraries]
5+
appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.6.1" }
6+
annotation = { group = "androidx.annotation", name = "annotation", version = "1.7.1" }
7+
hamcrest-core = { group = "org.hamcrest", name = "hamcrest-core", version = "2.2" }
8+
junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit5" }
9+
junit-jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit5" }
10+
junit-jupiter-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit5" }
11+
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version = "1.3.2" }
12+
test-ext-junit = { group = "androidx.test.ext", name = "junit", version = "1.1.5" }
13+
test-runner = { group = "androidx.test", name = "runner", version = "1.5.2" }
14+
test-rules = { group = "androidx.test", name = "rules", version = "1.5.0" }
15+
16+
[plugins]
17+
android-library = { id = "com.android.library", version = "8.2.2" }
18+
benmanes-versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
19+
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version = "1.9.22" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

library/build.gradle

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
apply plugin: 'com.android.library'
2-
apply plugin: 'maven-publish'
3-
apply plugin: 'org.jetbrains.kotlin.android'
4-
apply plugin: 'signing'
1+
plugins {
2+
alias(libs.plugins.android.library)
3+
alias(libs.plugins.jetbrains.kotlin.android)
4+
id("maven-publish")
5+
id("signing")
6+
}
57

68
android {
7-
compileSdk 33
9+
compileSdk 34
810
namespace 'com.tazkiyatech.utils'
911

1012
defaultConfig {
1113
minSdk 19
12-
targetSdk 33
14+
targetSdk 34
1315
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1416
}
1517

@@ -18,7 +20,6 @@ android {
1820
minifyEnabled false
1921
shrinkResources false
2022
}
21-
2223
release {
2324
minifyEnabled false
2425
shrinkResources false
@@ -53,18 +54,18 @@ android {
5354
}
5455

5556
dependencies {
56-
api 'androidx.appcompat:appcompat:1.6.1'
57-
api 'androidx.recyclerview:recyclerview:1.3.2'
58-
implementation 'androidx.annotation:annotation:1.7.0'
59-
60-
testImplementation 'org.hamcrest:hamcrest-core:2.2'
61-
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
62-
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junit5_version"
63-
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5_version"
64-
65-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
66-
androidTestImplementation 'androidx.test:runner:1.5.2'
67-
androidTestImplementation 'androidx.test:rules:1.5.0'
57+
api(libs.appcompat)
58+
api(libs.recyclerview)
59+
implementation(libs.annotation)
60+
61+
testImplementation(libs.hamcrest.core)
62+
testImplementation(libs.junit.jupiter.api)
63+
testImplementation(libs.junit.jupiter.engine)
64+
testImplementation(libs.junit.jupiter.params)
65+
66+
androidTestImplementation(libs.test.ext.junit)
67+
androidTestImplementation(libs.test.runner)
68+
androidTestImplementation(libs.test.rules)
6869
}
6970

7071
afterEvaluate {

library/proguard-debug/proguard-project.pro

Lines changed: 0 additions & 3 deletions
This file was deleted.

library/proguard/proguard-project.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

settings.gradle renamed to settings.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ dependencyResolutionManagement {
1414
}
1515
}
1616

17-
rootProject.name = 'android-utils'
18-
include ':library'
17+
include(":library")

0 commit comments

Comments
 (0)