-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[maintenance] migration to kts (#13)
- Loading branch information
1 parent
63d9b97
commit e339306
Showing
12 changed files
with
222 additions
and
184 deletions.
There are no files selected for viewing
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,56 @@ | ||
import io.gitlab.arturbosch.detekt.Detekt | ||
import io.gitlab.arturbosch.detekt.extensions.DetektExtension | ||
import org.jlleitschuh.gradle.ktlint.KtlintExtension | ||
import pl.beavercoding.viewbindingdelegate.buildsrc.detektPlugins | ||
|
||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
classpath(Libs.androidGradlePlugin) | ||
classpath(Libs.Kotlin.gradlePlugin) | ||
classpath(Libs.Androidx.Navigation.safeArgsPlugin) | ||
classpath(Libs.Ktlint.ktlintGradlePlugin) | ||
classpath(Libs.Detekt.detektGradlePlugin) | ||
} | ||
} | ||
|
||
allprojects { | ||
apply(plugin = Libs.Ktlint.ktlintPlugin) | ||
apply(plugin = Libs.Detekt.detektPlugin) | ||
|
||
dependencies { | ||
detektPlugins(Libs.Detekt.detektFormatting) | ||
} | ||
|
||
configure<KtlintExtension> { | ||
debug.set(true) | ||
} | ||
|
||
configure<DetektExtension> { | ||
debug = true | ||
allRules = false | ||
parallel = true | ||
config.setFrom(files("$rootDir/config/detekt.yml")) | ||
buildUponDefaultConfig = true | ||
ignoredBuildTypes = listOf("release") | ||
} | ||
} | ||
|
||
tasks.withType<Detekt>().configureEach { | ||
reports { | ||
html.required.set(true) | ||
xml.required.set(false) | ||
txt.required.set(false) | ||
sarif.required.set(false) | ||
md.required.set(false) | ||
} | ||
} | ||
|
||
tasks.register("clean", Delete::class) { | ||
delete(rootProject.buildDir) | ||
} |
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
15 changes: 15 additions & 0 deletions
15
...dSrc/src/main/kotlin/pl/beavercoding/viewbindingdelegate/buildsrc/DependencyHandlerExt.kt
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,15 @@ | ||
package pl.beavercoding.viewbindingdelegate.buildsrc | ||
|
||
import org.gradle.api.artifacts.Dependency | ||
import org.gradle.api.artifacts.ProjectDependency | ||
import org.gradle.api.artifacts.dsl.DependencyHandler | ||
import org.gradle.kotlin.dsl.DependencyHandlerScope | ||
|
||
fun DependencyHandler.implementation(dependency: Dependency) { | ||
add("implementation", dependency) | ||
} | ||
|
||
// https://github.com/detekt/detekt/issues/6555 | ||
fun DependencyHandlerScope.detektPlugins(dependencyNotation: Any) { | ||
add("detektPlugins", dependencyNotation) | ||
} |
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,68 @@ | ||
import pl.beavercoding.viewbindingdelegate.buildsrc.Config | ||
|
||
plugins { | ||
id("com.android.application") | ||
id("kotlin-android") | ||
id("kotlin-kapt") | ||
id("androidx.navigation.safeargs.kotlin") | ||
} | ||
|
||
android { | ||
namespace = "pl.beavercoding.viewbindingdelegate" | ||
compileSdk = Config.compileSdk | ||
|
||
defaultConfig { | ||
applicationId = "pl.beavercoding.viewbindingdelegate" | ||
minSdk = Config.minSdk | ||
targetSdk = Config.targetSdk | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = Config.testInstrumentationRunner | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = true | ||
isShrinkResources = true | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = Libs.java | ||
targetCompatibility = Libs.java | ||
} | ||
kotlinOptions { | ||
jvmTarget = Libs.java.toString() | ||
} | ||
buildFeatures { | ||
viewBinding = true | ||
dataBinding = true | ||
} | ||
} | ||
|
||
dependencies { | ||
viewBinder() | ||
|
||
// core | ||
implementation(Libs.Androidx.core) | ||
implementation(Libs.Androidx.appcompat) | ||
|
||
// views | ||
implementation(Libs.Google.material) | ||
implementation(Libs.Androidx.constraintLayout) | ||
implementation(Libs.Androidx.recyclerView) | ||
|
||
// navigation | ||
implementation(Libs.Androidx.Navigation.ui) | ||
implementation(Libs.Androidx.Navigation.fragment) | ||
|
||
// leakcanary | ||
debugImplementation(Libs.CanaryLeak.android) | ||
androidTestImplementation(Libs.CanaryLeak.androidTests) | ||
|
||
// tests | ||
testImplementation(Libs.junit) | ||
androidTestImplementation(Libs.Androidx.Test.junitExt) | ||
androidTestImplementation(Libs.Androidx.Test.espresso) | ||
} |
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,19 @@ | ||
rootProject.name = "ViewBindingDelegate" | ||
|
||
pluginManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
dependencyResolutionManagement { | ||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
include(":sample") | ||
include(":view-binder") |
Oops, something went wrong.