Skip to content

Commit

Permalink
fix: build directory path resolution when using layout.buildDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed May 3, 2024
1 parent 11ea100 commit 1b08a55
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

plugins {
id("org.jetbrains.dokka")
}

buildscript {
repositories {
Expand All @@ -18,3 +23,8 @@ allprojects {
mavenCentral()
}
}

tasks.withType(DokkaMultiModuleTask::class.java) {
outputDirectory.set(rootProject.file("dokka-docs"))
failOnWarning.set(false)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal fun Project.configureSpotless() {
spotlessExtension().run {
kotlin {
target("**/kotlin/**/*.kt")
targetExclude("${layout.buildDirectory}/**/*.kt", "**/test/**/*.kt", "bin/**/*.kt")
targetExclude("${layout.buildDirectory.get()}/**/*.kt", "**/test/**/*.kt", "bin/**/*.kt")
ktlint(libs.versions.ktlint.get())
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private fun Project.createMavenPublicationUsing(sourcesJar: Jar) {
version = props[PropertyTypes.VERSION]

artifact(sourcesJar)
artifact("${project.layout.buildDirectory}/outputs/aar/${project.name}-release.aar")
artifact("${project.layout.buildDirectory.get()}/outputs/aar/${project.name}-release.aar")
from(component)

pom {
Expand Down Expand Up @@ -181,7 +181,6 @@ private fun Project.createDokkaTaskProvider() = tasks.named<DokkaTask>("dokkaHtm
}
}


internal fun Project.configureOptions() {
if (isLibraryModule()) {
println("Applying additional tasks options for dokka and javadoc on ${project.path}")
Expand All @@ -194,7 +193,7 @@ internal fun Project.configureOptions() {
}

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

artifacts {
Expand Down

0 comments on commit 1b08a55

Please sign in to comment.