Skip to content

Commit

Permalink
Upgraded dependencies and moved all version definitions to the "libs.…
Browse files Browse the repository at this point in the history
…versions.toml" file.
  • Loading branch information
Adil Hussain committed Jan 26, 2024
1 parent c18598e commit 2b08fb3
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 61 deletions.
14 changes: 0 additions & 14 deletions build.gradle

This file was deleted.

26 changes: 26 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask

plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.benmanes.versions)
alias(libs.plugins.jetbrains.kotlin.android) apply false
}

tasks.wrapper {
gradleVersion = "8.5"
}

// Alter the default behaviour of the "com.github.ben-manes.versions" plugin
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf { isNonStable(candidate.version) }
}

/**
* @param version The version name to evaluate.
* @return true if and only if the given version name represents a non-stable version.
*/
fun isNonStable(version: String): Boolean {
val versionInLowercase = version.lowercase()

return setOf("-alpha", "-beta", "-rc").any { versionInLowercase.contains(it) }
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ android.useAndroidX=true

projectGroupName=com.tazkiyatech
projectArtifactName=android-utils
projectVersionName=0.2.6
projectVersionName=1.0.0
19 changes: 19 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[versions]
junit5 = "5.10.1"

[libraries]
appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.6.1" }
annotation = { group = "androidx.annotation", name = "annotation", version = "1.7.1" }
hamcrest-core = { group = "org.hamcrest", name = "hamcrest-core", version = "2.2" }
junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit5" }
junit-jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit5" }
junit-jupiter-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit5" }
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version = "1.3.2" }
test-ext-junit = { group = "androidx.test.ext", name = "junit", version = "1.1.5" }
test-runner = { group = "androidx.test", name = "runner", version = "1.5.2" }
test-rules = { group = "androidx.test", name = "rules", version = "1.5.0" }

[plugins]
android-library = { id = "com.android.library", version = "8.2.2" }
benmanes-versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version = "1.9.22" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
39 changes: 20 additions & 19 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'signing'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
id("maven-publish")
id("signing")
}

android {
compileSdk 33
compileSdk 34
namespace 'com.tazkiyatech.utils'

defaultConfig {
minSdk 19
targetSdk 33
targetSdk 34
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

Expand All @@ -18,7 +20,6 @@ android {
minifyEnabled false
shrinkResources false
}

release {
minifyEnabled false
shrinkResources false
Expand Down Expand Up @@ -53,18 +54,18 @@ android {
}

dependencies {
api 'androidx.appcompat:appcompat:1.6.1'
api 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.annotation:annotation:1.7.0'

testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junit5_version"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5_version"

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
api(libs.appcompat)
api(libs.recyclerview)
implementation(libs.annotation)

testImplementation(libs.hamcrest.core)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.engine)
testImplementation(libs.junit.jupiter.params)

androidTestImplementation(libs.test.ext.junit)
androidTestImplementation(libs.test.runner)
androidTestImplementation(libs.test.rules)
}

afterEvaluate {
Expand Down
3 changes: 0 additions & 3 deletions library/proguard-debug/proguard-project.pro

This file was deleted.

21 changes: 0 additions & 21 deletions library/proguard/proguard-project.pro

This file was deleted.

3 changes: 1 addition & 2 deletions settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ dependencyResolutionManagement {
}
}

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

0 comments on commit 2b08fb3

Please sign in to comment.