-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from RajashekarRaju/gradle
Update Gradle, dependencies, use version catalog and BOMs
- Loading branch information
Showing
12 changed files
with
498 additions
and
369 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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,131 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
plugins { | ||
alias(libs.plugins.com.android.application) | ||
alias(libs.plugins.org.jetbrains.kotlin.android) | ||
alias(libs.plugins.org.jetbrains.kotlin.kapt) | ||
alias(libs.plugins.com.google.dagger.hilt.android) | ||
} | ||
|
||
android { | ||
compileSdk = 33 | ||
|
||
defaultConfig { | ||
applicationId = "com.developersbreach.composeactors" | ||
minSdk = 24 | ||
targetSdk = 33 | ||
versionCode = 3 | ||
versionName = "0.3.0" | ||
|
||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
|
||
// signingConfig signingConfigs.debug | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
testInstrumentationRunnerArguments["clearPackageData"] = "true" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = true | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
debug { | ||
isMinifyEnabled = false | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
// To mark experimental features api | ||
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn" | ||
} | ||
|
||
buildFeatures { | ||
buildConfig = true | ||
compose = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get() | ||
} | ||
|
||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
namespace = "com.developersbreach.composeactors" | ||
|
||
testOptions { | ||
unitTests.isIncludeAndroidResources = true | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(platform(libs.androidx.compose.bom)) | ||
implementation(platform(libs.kotlin.bom)) | ||
|
||
implementation(libs.androidx.core.core.ktx) | ||
implementation(libs.androidx.appcompat) | ||
implementation(libs.com.google.android.material) | ||
implementation(libs.androidx.compose.ui) | ||
implementation(libs.androidx.compose.material) | ||
implementation(libs.androidx.compose.ui.ui.tooling.preview) | ||
implementation(libs.androidx.compose.ui.ui.tooling) | ||
implementation(libs.androidx.activity.activity.compose) | ||
|
||
// Observe state and livedata | ||
implementation(libs.androidx.compose.runtime.runtime.livedata) | ||
implementation(libs.androidx.lifecycle.lifecycle.runtime.ktx) | ||
|
||
// Constraint Layout | ||
implementation(libs.androidx.constraintlayout.constraintlayout.compose) | ||
|
||
// Navigation | ||
implementation(libs.androidx.navigation.navigation.compose) | ||
|
||
// Timber for logging | ||
implementation(libs.com.jakewharton.timber) | ||
|
||
// Coil for image loading | ||
implementation(libs.io.coil.kt.coil.compose) | ||
|
||
// Palette | ||
implementation(libs.androidx.palette.palette.ktx) | ||
|
||
// Room | ||
implementation(libs.androidx.room.room.runtime) | ||
implementation(libs.androidx.room.room.ktx) | ||
kapt(libs.androidx.room.room.compiler) | ||
|
||
// hilt | ||
implementation(libs.com.google.dagger.hilt.android) | ||
implementation(libs.androidx.hilt.hilt.navigation.compose) | ||
kapt(libs.com.google.dagger.hilt.android.compiler) | ||
|
||
// Paging | ||
implementation(libs.androidx.paging.paging.compose) | ||
implementation(libs.androidx.paging.paging.runtime.ktx) | ||
|
||
testImplementation(libs.androidx.compose.ui.ui.test.junit4) | ||
testImplementation(libs.io.mockk) | ||
|
||
androidTestImplementation(libs.androidx.test.ext.junit.ktx) | ||
androidTestImplementation(libs.androidx.compose.ui.ui.test.junit4) | ||
|
||
debugImplementation(libs.androidx.compose.ui.ui.test.manifest) | ||
} | ||
|
||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).configureEach { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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,39 @@ | ||
plugins { | ||
alias(libs.plugins.com.android.application) apply false | ||
alias(libs.plugins.org.jetbrains.kotlin.android) apply false | ||
alias(libs.plugins.org.jetbrains.kotlin.kapt) apply false | ||
alias(libs.plugins.com.google.dagger.hilt.android) apply false | ||
alias(libs.plugins.com.diffplug.spotless) | ||
alias(libs.plugins.com.github.ben.manes.versions) | ||
alias(libs.plugins.nl.littlerobots.version.catalog.update) | ||
} | ||
|
||
spotless { | ||
// optional: limit format enforcement to just the files changed by this feature branch | ||
//ratchetFrom 'origin/master' | ||
|
||
kotlin { | ||
// spotless:off and spotless:on | ||
// toggleOffOn() | ||
|
||
target("**/*.kt") | ||
targetExclude("$buildDir/**/*.kt") | ||
targetExclude("bin/**/*.kt") | ||
ktlint("0.48.1") | ||
ktfmt() | ||
} | ||
|
||
// Disabling warnings and error messages | ||
// enforceCheck false | ||
} | ||
|
||
tasks.withType(com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask::class) { | ||
fun isStable(version: String): Boolean { | ||
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } | ||
val regex = "^[0-9,.v-]+(-r)?$".toRegex() | ||
return stableKeyword || regex.matches(version) | ||
} | ||
gradleReleaseChannel = "current" | ||
revision = "release" | ||
rejectVersionIf { !isStable(candidate.version) } | ||
} |
Oops, something went wrong.