Skip to content

Commit

Permalink
Update Project to use Gradle 8.4, AGP 8.2.0, and uses version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
muhrifqii committed Jan 1, 2024
1 parent 0d985e1 commit 998c4ed
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 110 deletions.
17 changes: 6 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
plugins {
id 'com.android.application' version "${agp_version}" apply false
id 'com.android.library' version "${agp_version}" apply false
id 'org.jetbrains.kotlin.android' version "${kotlin_version}" apply false
id "io.gitlab.arturbosch.detekt" version "1.20.0-RC2"
id "com.diffplug.spotless" version "6.4.1" apply false
alias libs.plugins.android.library apply false
alias libs.plugins.android.application apply false
alias libs.plugins.kotlin.android apply false
alias libs.plugins.detekt
alias libs.plugins.spotless apply false
}
apply from: 'root-reportings.gradle'

task clean(type: Delete) {
delete rootProject.buildDir
}

detekt {
toolVersion = "1.19.0"
buildUponDefaultConfig = true
config = files("$projectDir/detekt.yml")
parallel = true
Expand All @@ -26,5 +21,5 @@ detekt {
}

dependencies {
detektPlugins('io.gitlab.arturbosch.detekt:detekt-formatting:1.20.0-RC2')
detektPlugins(libs.detekt.formatting)
}
30 changes: 16 additions & 14 deletions fuel/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
alias libs.plugins.android.library
alias libs.plugins.kotlin.android
}
apply from: '../reportings.gradle'

group 'com.github.muhrifqii.ParseRSS'

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

android {
compileSdkVersion compilesdk_version as int
namespace 'com.github.muhrifqii.ParseRSS'
compileSdk compilesdk_version as int
//noinspection GradleDependency
buildToolsVersion buildtools_version
defaultConfig {
minSdkVersion minsdk_version
targetSdkVersion targetsdk_version
versionCode project_version_code as int
versionName project_version
}
buildTypes {
release {
Expand All @@ -24,14 +28,12 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':parserss')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

implementation 'com.github.kittinunf.fuel:fuel:2.3.1'
implementation libs.fuel

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'org.mockito:mockito-core:4.4.0'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation libs.junit
testImplementation libs.robolectric
testImplementation libs.mockito.core
testImplementation libs.truth
}
2 changes: 0 additions & 2 deletions fuel/src/main/AndroidManifest.xml

This file was deleted.

3 changes: 0 additions & 3 deletions fuel/src/main/res/values/strings.xml

This file was deleted.

30 changes: 4 additions & 26 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=false
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Declare versions
agp_version=7.0.2
kotlin_version=1.6.10
compilesdk_version=31
buildtools_version=30.0.2
minsdk_version=14
targetsdk_version=31
project_version=0.6.0
project_version_code=600
compilesdk_version=34
minsdk_version=16
project_version=0.7.0
project_version_code=700
46 changes: 46 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[versions]
agp = "8.2.0"
appcompat = "1.6.1"
constraintlayout = "2.1.4"
core-ktx = "1.12.0"
detekt = "1.20.0-RC2"
espresso-core = "3.5.1"
fuel = "2.3.1"
junit = "4.13.2"
kotlin = "1.9.21"
kotlinx-coroutines-core = "1.7.3"
material = "1.11.0"
mockito-core = "5.3.1"
ktlint = "1.0.1"
ktor = "2.3.7"
retrofit = "2.9.0"
robolectric = "4.7.3"
runner = "1.5.2"
spotless = "6.23.3"
truth = "1.1.3"

[libraries]
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso-core" }
fuel = { module = "com.github.kittinunf.fuel:fuel", version.ref = "fuel" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
material = { module = "com.google.android.material:material", version.ref = "material" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito-core" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
runner = { module = "androidx.test:runner", version.ref = "runner" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
android-lint = { id = "com.android.lint", version.ref = "agp" }
android-test = { id = "com.android.test", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
32 changes: 17 additions & 15 deletions parserss/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
alias libs.plugins.android.library
alias libs.plugins.kotlin.android
}
apply from: '../reportings.gradle'

group 'com.github.muhrifqii.ParseRSS'

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

android {
compileSdkVersion compilesdk_version as int
compileSdk compilesdk_version as int
namespace 'com.github.muhrifqii.ParseRSS'
//noinspection GradleDependency
buildToolsVersion buildtools_version
defaultConfig {
minSdkVersion minsdk_version
targetSdkVersion targetsdk_version
versionCode project_version_code as int
versionName project_version
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'org.mockito:mockito-core:4.4.0'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
testImplementation libs.junit
testImplementation libs.robolectric
testImplementation libs.mockito.core
testImplementation libs.truth
testImplementation libs.kotlinx.coroutines.core
}
2 changes: 0 additions & 2 deletions parserss/src/main/AndroidManifest.xml

This file was deleted.

31 changes: 17 additions & 14 deletions retrofit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
alias libs.plugins.android.library
alias libs.plugins.kotlin.android
}
apply from: '../reportings.gradle'

group 'com.github.muhrifqii.ParseRSS'

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

android {
compileSdkVersion compilesdk_version as int
namespace 'com.github.muhrifqii.ParseRSS'
compileSdk compilesdk_version as int
//noinspection GradleDependency
buildToolsVersion buildtools_version
defaultConfig {
minSdkVersion minsdk_version
targetSdkVersion targetsdk_version
versionCode project_version_code as int
versionName project_version
}
buildTypes {
release {
Expand All @@ -23,14 +28,12 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':parserss')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation libs.retrofit

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'org.mockito:mockito-core:4.4.0'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation libs.junit
testImplementation libs.robolectric
testImplementation libs.mockito.core
testImplementation libs.truth
}
2 changes: 0 additions & 2 deletions retrofit/src/main/AndroidManifest.xml

This file was deleted.

8 changes: 4 additions & 4 deletions root-reportings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apply plugin: 'jacoco'

jacoco {
toolVersion '0.8.7'
}
//jacoco {
// toolVersion '0.8.7'
//}

tasks.withType(Test) {
tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
}

Expand Down
38 changes: 23 additions & 15 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
alias libs.plugins.android.application
alias libs.plugins.kotlin.android
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

android {
compileSdkVersion compilesdk_version as int
compileSdk compilesdk_version as int
namespace 'com.github.muhrifqii.parserss.sample'
//noinspection GradleDependency
buildToolsVersion buildtools_version
defaultConfig {
applicationId "com.github.muhrifqii.parserss.sample"
minSdkVersion minsdk_version
targetSdkVersion targetsdk_version
versionCode project_version_code as int
versionName project_version
multiDexEnabled true
}
buildTypes {
release {
Expand All @@ -21,20 +29,20 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.android.material:material:1.5.0'
implementation libs.appcompat
implementation libs.core.ktx
implementation libs.constraintlayout
implementation libs.material

implementation libs.fuel

implementation 'com.github.kittinunf.fuel:fuel:2.3.1'
implementation "androidx.multidex:multidex:2.0.1"

implementation project(':parserss')
implementation project(':fuel')
implementation project(':retrofit')

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation libs.junit
androidTestImplementation libs.runner
androidTestImplementation libs.espresso.core
}
2 changes: 1 addition & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="com.github.muhrifqii.parserss.sample">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<application
Expand Down

0 comments on commit 998c4ed

Please sign in to comment.