Skip to content

Commit

Permalink
chore: Fix buildDir for javadocJar task
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
- A new Gradle plugin(VssProcessorPlugin) was introduced to improve
the input (VSS files) handling of the VSS KSP generation. This plugin
is now mandatory if the VssProcessor KSP module is used in the
project.
  • Loading branch information
Chrylo committed Feb 15, 2024
1 parent 6b5c34a commit 49729c4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 3 additions & 1 deletion vss-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ publish {

tasks.register("javadocJar", Jar::class) {
dependsOn("dokkaHtml")
from("${layout.buildDirectory}/dokka/html")

val buildDir = layout.buildDirectory.asFile.get()
from("$buildDir/dokka/html")
archiveClassifier.set("javadoc")
}

Expand Down
4 changes: 2 additions & 2 deletions vss-processor-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ gradlePlugin {
create("VssProcessorPlugin") {
id = "org.eclipse.kuksa.vss-processor-plugin"
implementationClass = "org.eclipse.kuksa.vssprocessor.plugin.VssProcessorPlugin"
displayName = "Vss Processor Plugin"
tags.set(listOf("KUKSA", "Vehicle Signal Specification", "VSS", "android", "kotlin"))
displayName = "VSS Processor Plugin"
tags.set(listOf("KUKSA", "Vehicle Signal Specification", "VSS", "Android", "Kotlin"))
description = "Vehicle Signal Specification (VSS) Plugin of the KUKSA SDK. This is used in combination " +
"with the KSP processor component 'KUKSA VSS Processor'. The plugin is configured to provide " +
"VSS Files to KSP processor. This is mandatory to use the 'KUKSA VSS Processor' component."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ import org.gradle.api.file.FileType
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Property
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.IgnoreEmptyDirectories
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.*
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.register
import org.gradle.work.ChangeType
import org.gradle.work.Incremental
import org.gradle.work.InputChanges
Expand Down Expand Up @@ -66,7 +69,7 @@ class VssProcessorPlugin : Plugin<Project> {
val vssDir = "${rootDir}${fileSeparator}$VSS_FOLDER_NAME"

val provideVssDefinitionTask =
project.tasks.register<ProvideVssDefinitionTask>(PROVIDE_VSS_DEFINITION_TASK) {
project.tasks.register<ProvideVssDefinitionTask>(PROVIDE_VSS_DEFINITION_TASK_NAME) {
val searchPath = extension.searchPath.get().ifEmpty { vssDir }
val vssDefinitionFilePath = StringBuilder(buildDirPath)
.append(fileSeparator)
Expand All @@ -80,9 +83,7 @@ class VssProcessorPlugin : Plugin<Project> {
val searchDir = file(searchPath)
if (!searchDir.exists()) {
throw FileNotFoundException(
"Directory $searchPath for VSS files not found! Consider creating the default folder" +
" ($VSS_FOLDER_NAME) inside your project root or use the plugin" +
" configuration:searchPath option.",
"Directory '$searchPath' for VSS files not found! Please create the folder."
)
}

Expand All @@ -99,7 +100,7 @@ class VssProcessorPlugin : Plugin<Project> {
companion object {
private const val KSP_INPUT_BUILD_DIRECTORY = "kspInput"
private const val EXTENSION_NAME = "vssProcessor"
private const val PROVIDE_VSS_DEFINITION_TASK = "provideVssDefinition"
private const val PROVIDE_VSS_DEFINITION_TASK_NAME = "provideVssDefinition"
private const val VSS_FOLDER_NAME = "vss"
}
}
Expand All @@ -111,6 +112,7 @@ class VssProcessorPlugin : Plugin<Project> {
@CacheableTask
private abstract class ProvideVssDefinitionTask : DefaultTask() {
@get:Incremental
@get:IgnoreEmptyDirectories
@get:PathSensitive(PathSensitivity.NAME_ONLY)
@get:InputDirectory
abstract val inputDir: DirectoryProperty
Expand All @@ -126,7 +128,7 @@ private abstract class ProvideVssDefinitionTask : DefaultTask() {
val file = change.file
val extension = file.extension
if (!validVssExtension.contains(extension)) {
logger.warn("Found incompatible file VSS file: ${file.name} - Consider removing it")
logger.warn("Found incompatible VSS file: ${file.name} - Consider removing it")
return@forEach
}

Expand Down

0 comments on commit 49729c4

Please sign in to comment.