Skip to content

Commit 9bf6f67

Browse files
author
Christian Würthner
committed
Fix project used during execution
1 parent e48d42d commit 9bf6f67

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.gradle/config.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Wed Jun 19 09:51:18 CEST 2024
2-
java.home=/Applications/Android Studio Preview.app/Contents/jbr/Contents/Home
1+
#Mon Oct 28 13:03:52 CET 2024
2+
java.home=/Users/christian.wurthner/Library/Java/JavaVirtualMachines/jbr-17.0.9/Contents/Home

gradle-bom/build.gradle.kts

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ val buildNumber = (project.findProperty("AzureBuildNumber") ?: "debug")
2525
group = "com.iodigital.gradlebom"
2626
version = "1.0.$buildNumber"
2727

28-
File(System.getenv("GITHUB_OUTPUT")).appendText("build_version=$version")
28+
System.getenv("GITHUB_OUTPUT")?.takeUnless { it.isBlank() }?.let { path ->
29+
File(path).appendText("build_version=$version")
30+
}
2931
println("##vso[build.updatebuildnumber]name=${version},code=${buildNumber},buildId=${buildNumber}")
3032

3133
@Suppress("UnstableApiUsage")

gradle-bom/src/main/java/com/iodigital/gradlebom/tasks/GenericGenerateModuleBomTask.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ abstract class GenericGenerateModuleBomTask : AbstractGenerateBomTask() {
88

99
override fun getDescription() = "Creates a CycloneDX BOM"
1010

11+
private val projectPath = project.path
12+
1113
@Input
1214
@Option(option = "configuration", description = "The configuration to create a bom for. Run \"./gradlew dependencies\" to get a list.")
1315
abstract fun getConfiguration(): Property<String>
1416

1517
override fun createdNestedGradleCommand(): String {
1618
val configuration = getConfiguration().get()
17-
val command = "${project.path.removeSuffix(":")}:dependencies"
19+
val command = "${projectPath.removeSuffix(":")}:dependencies"
1820
return "./gradlew $command --configuration $configuration --no-daemon"
1921
}
2022
}

gradle-bom/src/main/java/com/iodigital/gradlebom/tasks/SpecificGenerateModuleBomTask.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ open class SpecificGenerateModuleBomTask @Inject constructor(
66
private val configName: String,
77
) : AbstractGenerateBomTask() {
88

9+
private val projectPath = project.path
10+
911
override fun getDescription() = "Creates a CycloneDX BOM for configuration $configName"
1012

1113
override fun createdNestedGradleCommand(): String {
12-
val command = "${project.path.removeSuffix(":")}:dependencies"
14+
val command = "${projectPath.removeSuffix(":")}:dependencies"
1315
return "./gradlew $command --configuration ${configName}RuntimeClasspath --no-daemon"
1416
}
1517
}

0 commit comments

Comments
 (0)