-
Notifications
You must be signed in to change notification settings - Fork 5
Convert gradle scripts to use kotlin dsl #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DanneD-Wisemen
merged 12 commits into
develop
from
convert-gradle-scripts-to-use-kotlin-dsl
Feb 6, 2025
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
614b642
changed gradle script to kotlin dsl
DanneD-Wisemen e3155d8
removed unused jcenter plugin
DanneD-Wisemen f3f048d
created version library in a toml file
DanneD-Wisemen f5b0958
Merge branch 'develop' into convert-gradle-scripts-to-use-kotlin-dsl
DanneD-Wisemen 9802311
upped compilesdk to 34
DanneD-Wisemen b9f9abe
ANDROID-17 refactored gradle files and update version catalog
DanneD-Wisemen 4844dd8
ANDROID-17 added kapt back to datarow for bindingadapters
DanneD-Wisemen 14a9c6b
Merge branch 'master' into convert-gradle-scripts-to-use-kotlin-dsl
DanneD-Wisemen aa991c0
Merge branch 'develop' into convert-gradle-scripts-to-use-kotlin-dsl
DanneD-Wisemen 1ee0e32
Merge branch 'develop' into convert-gradle-scripts-to-use-kotlin-dsl
DanneD-Wisemen 5c98636
```
DanneD-Wisemen f51e7bf
fixed paging proguard-rules.pro
DanneD-Wisemen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
| buildscript { | ||
| dependencies { | ||
| classpath(libs.gradle) | ||
| classpath(kotlin("gradle-plugin", version = libs.versions.kotlin.get())) | ||
|
|
||
| classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${libs.versions.navigation.get()}") | ||
|
|
||
| // NOTE: Do not place your application dependencies here; they belong | ||
| // in the individual module build.gradle files | ||
| } | ||
| } | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.android.library) apply false | ||
| alias(libs.plugins.kotlin.android) apply false | ||
| alias(libs.plugins.android.application) apply false | ||
| alias(libs.plugins.ksp) apply false | ||
| } | ||
|
|
||
| project.tasks.register("clean", Delete::class) { | ||
| delete(rootProject.buildDir) | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| plugins { | ||
| kotlin("android") | ||
| kotlin("kapt") | ||
| `maven-publish` | ||
|
|
||
| id("com.android.library") | ||
| id("com.google.devtools.ksp") | ||
| } | ||
|
|
||
| android { | ||
| compileSdk = 34 | ||
|
|
||
| defaultConfig { | ||
| minSdk = 21 | ||
|
|
||
| testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
| consumerProguardFiles("consumer-rules.pro") | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = false | ||
| proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
| } | ||
| } | ||
|
|
||
| buildFeatures { | ||
| dataBinding = true | ||
| viewBinding = true | ||
| } | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
|
|
||
| kotlinOptions { | ||
| jvmTarget = "17" | ||
| } | ||
|
|
||
| namespace = "be.appwise.core" | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.startup.runtime) | ||
|
|
||
| testImplementation(libs.mockk) | ||
| testImplementation(libs.junit) | ||
| androidTestImplementation(libs.junit.ext) | ||
| androidTestImplementation(libs.test.runner) | ||
| androidTestImplementation(libs.espresso.core) | ||
| api(libs.core.ktx) | ||
|
|
||
| api(libs.multidex) | ||
|
|
||
| //Kotlin reflect | ||
| api(libs.kotlin.reflect) | ||
|
|
||
| //ViewModel | ||
| api(libs.lifecycle.viewmodel.ktx) | ||
|
|
||
| api(libs.lifecycle.livedata.ktx) | ||
|
|
||
| //AndroidX Support libraries | ||
| api(libs.appcompat) | ||
| api(libs.material) | ||
| api(libs.constraintlayout) | ||
| api(libs.swiperefreshlayout) | ||
|
|
||
| //coroutines | ||
| api(libs.kotlinx.coroutines.core) | ||
| api(libs.kotlinx.coroutines.android) | ||
|
|
||
| // navigation components | ||
| api(libs.navigation.fragment.ktx) | ||
| api(libs.navigation.ui.ktx) | ||
|
|
||
| // gson (https://github.com/google/gson) | ||
| api(libs.gson) | ||
|
|
||
| // logger (https://github.com/orhanobut/logger) | ||
| api(libs.logger) | ||
|
|
||
| // Hawk (https://github.com/orhanobut/hawk) | ||
| api(libs.hawk) | ||
|
|
||
| //open image chooser | ||
| api(libs.easyimage) | ||
|
|
||
| //image loading/caching | ||
| api(libs.glide.glide) | ||
| ksp(libs.glide.compiler) | ||
|
|
||
| //dialogs | ||
| api(libs.material.dialogs.core) | ||
| api(libs.material.dialogs.datetime) | ||
|
|
||
| // Time manipulation for Java 7 | ||
| api(libs.joda.time) | ||
|
|
||
| // https://github.com/Ereza/CustomActivityOnCrash | ||
| implementation(libs.customactivityoncrash) | ||
| } | ||
|
|
||
| val sourceJar: Task by tasks.creating(Jar::class) { | ||
| from(android.sourceSets["main"].java.srcDirs) | ||
| // classifier("sources") | ||
| } | ||
|
|
||
| afterEvaluate { | ||
| publishing { | ||
| publications { | ||
| create<MavenPublication>("release") { | ||
| from(components["release"]) | ||
|
|
||
| groupId = "com.github.appwise-labs" | ||
|
|
||
| artifact(sourceJar) | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an idea to move this to a separate file and include it where it is necessary?
This could also be done with the submodules configuration with a filter on the specific module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this but it could not get it to work. I tried extracting it into an other publish.gradle.kts file and applying it with apply { from(../publish.gradle.kts) } but the publish.gradle.kts gave several errors regarding unresolved references like groupId etc