Skip to content

Commit

Permalink
Merge pull request #8 from Commencis/bugfix/cmakelists-wrong-elseif
Browse files Browse the repository at this point in the history
Fix Wrong "elseif" Code Generation instead of "if" in CMakeLists File
  • Loading branch information
burakaygun authored Dec 13, 2024
2 parents d8302f8 + 79361dc commit 8c20f9b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.1.2

### Fixed
- Replace wrong "elseif" with "if" in generated CMakeLists file

# 0.1.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion secretsvaultplugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ configure<DetektExtension> {
}

group = "com.commencis.secretsvaultplugin"
version = "0.1.1"
version = "0.1.2"
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,21 @@ internal abstract class KeepSecretsTask : DefaultTask() {
}
sourceSets.groupBy { getCmakeArgumentName(it) }.forEach { map ->
val (cMakeArgument, sourceSetList) = map
sourceSetList.forEachIndexed { index, sourceSet ->
var isFirstSourceSet = true
for (sourceSet in sourceSetList) {
if (sourceSet == mainSourceSet) {
return@forEachIndexed
continue
}
val fileName = getKotlinSecretsFileName(sourceSet).removeSuffix(KOTLIN_FILE_NAME_SUFFIX)
textBuilder.append(
codeGenerator.getCMakeListsCode(
sourceSet = sourceSet,
mappingFileName = fileName,
cmakeArgumentName = cMakeArgument,
index == 0,
isFirstSourceSet,
)
)
isFirstSourceSet = false
}
if (sourceSetList.count { sourceSet -> sourceSet != mainSourceSet } > 1) {
textBuilder.append("\nendif()\n")
Expand Down

0 comments on commit 8c20f9b

Please sign in to comment.