Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/checkstyle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ inputs:
runs:
using: 'composite'
steps:
- name: Detekt
shell: bash
run: |
set -euo pipefail
./gradlew detekt --stacktrace ${{ inputs.gradle-args }}
# - name: Detekt
# shell: bash
# run: |
# set -euo pipefail
# ./gradlew detekt --stacktrace ${{ inputs.gradle-args }}

- name: Upload Detekt reports
id: upload_reports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import extension.versions

plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.devtools.ksp")
id("kotlin-parcelize")
}
Expand Down Expand Up @@ -78,12 +77,14 @@ android {
excludes.add("META-INF/*.kotlin_module")
}
}
}

project.kotlin {
jvmToolchain(jdkVersion = libs.versions.jdk.asInt())
}
kotlin {
jvmToolchain(jdkVersion = libs.versions.jdk.asInt())
}

kotlinOptions {
jvmTarget = libs.versions.jdk.toString()
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdk.asInt()))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import extension.versions

plugins {
id("com.android.library")
id("kotlin-android")
id("com.google.devtools.ksp")
id("kotlin-parcelize")
}
Expand All @@ -19,7 +18,11 @@ android {

defaultConfig {
minSdk = libs.versions.minSdk
targetSdk = libs.versions.targetSdk // needed for instrumental tests
}

testOptions {
// used for instrumental tests
targetSdk = libs.versions.targetSdk
}

buildTypes {
Expand All @@ -40,12 +43,14 @@ android {
// excludes.add("META-INF/*.kotlin_module")
}
}
}

project.kotlin {
jvmToolchain(jdkVersion = libs.versions.jdk.asInt())
}
kotlin {
jvmToolchain(jdkVersion = libs.versions.jdk.asInt())
}

kotlinOptions {
jvmTarget = libs.versions.jdk.toString()
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdk.asInt()))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import task.DownloadGradleDependencies

plugins {
id("nl.neotech.plugin.rootcoverage")
id("io.gitlab.arturbosch.detekt")
// id("dev.detekt")
}

// Detekt info ->
Expand All @@ -12,16 +12,16 @@ plugins {
// ./gradlew detektBaseline - Similar to detekt, but creates a code smell baseline. Further detekt runs will
// only feature new smells not in this list.
// More info -> https://detekt.dev/docs/gettingstarted/gradle/
detekt {
// version found will be used. Override to stay on the same version.
config = files("/config/detekt/detekt.yml")
// Builds the AST in parallel. Rules are always executed in parallel. Can lead to speedups in larger projects.
parallel = true
// Android: Don't create tasks for the specified build types (e.g. "release")
ignoredBuildTypes = listOf("release")
// Specify the base path for file paths in the formatted reports.
basePath = rootProject.projectDir.toString()
}
//detekt {
// // version found will be used. Override to stay on the same version.
// config = files("/config/detekt/detekt.yml")
// // Builds the AST in parallel. Rules are always executed in parallel. Can lead to speedups in larger projects.
// parallel = true
// // Android: Don't create tasks for the specified build types (e.g. "release")
// ignoredBuildTypes = listOf("release")
// // Specify the base path for file paths in the formatted reports.
// basePath = rootProject.projectDir.toString()
//}

rootCoverage {
// The default build variant for every module
Expand Down Expand Up @@ -64,14 +64,14 @@ rootCoverage {
}

subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
// apply(plugin = "dev.detekt")
// https://docs.gradle.org/current/userguide/project_report_plugin.html#sec:project_reports_tasks
apply(plugin = "project-report")

dependencies {
// This rule set provides wrappers for rules implemented by ktlint - https://ktlint.github.io/.
// https://detekt.dev/docs/rules/formatting/dawd
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
// detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
}
}

Expand Down
37 changes: 18 additions & 19 deletions build-logic/convention/src/main/kotlin/extension/CommonExtension.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package extension

import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.jetbrains.kotlin.gradle.plugin.KaptExtension
Expand All @@ -23,24 +22,24 @@ internal fun Project.getSigningConfigProperties(buildType: String): Properties {
}


fun CommonExtension<*, *, *, *, *, *>.roomSetup(
project: Project
) {
val schemasPath = "${project.projectDir}/schemas"
defaultConfig {
project.kapt {
arguments {
arg("room.schemaLocation", schemasPath)
}
}
}
sourceSets {
// Adds exported schema location as test app assets.
getByName("debug")
.assets
.srcDirs(project.files(schemasPath))
}
}
//fun CommonExtension<*, *, *, *, *, *>.roomSetup(
// project: Project
//) {
// val schemasPath = "${project.projectDir}/schemas"
// defaultConfig {
// project.kapt {
// arguments {
// arg("room.schemaLocation", schemasPath)
// }
// }
// }
// sourceSets {
// // Adds exported schema location as test app assets.
// getByName("debug")
// .assets
// .srcDirs(project.files(schemasPath))
// }
//}

private fun Project.kapt(configure: KaptExtension.() -> Unit): Unit =
(this as ExtensionAware).extensions.configure("kapt", configure)
11 changes: 8 additions & 3 deletions build-logic/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Gradle properties are not passed to included builds https://github.com/gradle/gradle/issues/2534
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
#org.gradle.parallel=true
#org.gradle.caching=true
#org.gradle.configureondemand=true

# Volver a activar cuando se actualice gradle o kotlin
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.configuration-cache=false
Loading