Skip to content

Commit

Permalink
refactor: resolve buildSrc gradle api sdk warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed May 4, 2024
1 parent 6c3bce6 commit 317bb96
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ allprojects {

tasks {
val clean by registering(Delete::class) {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory.get())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal fun Project.configureSources() {
}

val classesJar by tasks.register("classesJar", Jar::class.java) {
from("${project.buildDir}/intermediates/classes/release")
from("${project.layout.buildDirectory.get()}/intermediates/classes/release")
}

artifacts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ import org.gradle.api.Project

internal fun Project.configureSpotless() {
spotlessExtension().run {
val withLicenseHeader: (String) -> File = { extension ->
rootProject.file("spotless/copyright$extension")
}
val buildDirectory = layout.buildDirectory.get()
kotlin {
target("**/kotlin/**/*.kt")
target("**/*.kt")
targetExclude(
"${buildDir}/**/*.kt",
"${buildDirectory}/**/*.kt",
"**/androidTest/**/*.kt",
"**/test/**/*.kt",
"bin/**/*.kt"
)
ktlint(libs.versions.ktlint.get().toString())
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
ktlint(libs.pintrest.ktlint.get().version)
licenseHeaderFile(
withLicenseHeader(".kt")
)
}
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ gradle-plugins-android-junit5 = "de.mannodermaus.gradle.plugins:android-junit5:1

spek2-spek-dsl-jvm = { module = "org.spekframework.spek2:spek-dsl-jvm", version.ref = "spek2-spek" }
spek2-spek-runner-junit5 = { module = "org.spekframework.spek2:spek-runner-junit5", version.ref = "spek2-spek" }

pintrest-ktlint = { module = "com.pinterest:ktlint", version.ref = "ktlint" }

0 comments on commit 317bb96

Please sign in to comment.