Skip to content

Commit

Permalink
Merge pull request #67 from boschglobal/fix-66
Browse files Browse the repository at this point in the history
fix: VSS Specification Generation fails for specific Folder Structure
  • Loading branch information
SebastianSchildt authored Jan 22, 2024
2 parents bbaa0f0 + e62686a commit 74687b3
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class VssDefinitionProcessor(
private fun loadAssetFile(fileName: String): File? {
val generatedFile = codeGenerator.generatedFile.firstOrNull() ?: return null
val generationPath = generatedFile.absolutePath
val buildPath = generationPath.replaceAfter(BUILD_FOLDER_NAME, "")
val assetsFilePath = "$buildPath/$ASSETS_BUILD_DIRECTORY"
val buildPath = generationPath.replaceAfterLast(buildDir, "")
val assetsFilePath = buildPath + fileSeparator + assetsDir
val assetsFolder = File(assetsFilePath)

return assetsFolder.walk().firstOrNull { it.name == fileName }
Expand Down Expand Up @@ -137,11 +137,13 @@ class VssDefinitionProcessor(
}
}

companion object {
private companion object {
private const val PACKAGE_NAME = "org.eclipse.kuksa.vss"
private const val FILE_NAME_PROCESSOR_POSTFIX = "Processor"
private const val ASSETS_BUILD_DIRECTORY = "intermediates/assets/"
private const val BUILD_FOLDER_NAME = "build/"

private val fileSeparator = File.separator
private val assetsDir = "intermediates" + fileSeparator + "assets" + fileSeparator
private val buildDir = fileSeparator + "build" + fileSeparator
}
}

Expand Down

0 comments on commit 74687b3

Please sign in to comment.