Skip to content

Commit

Permalink
Merge pull request #7 from iodigital-com/ci-fix
Browse files Browse the repository at this point in the history
Fix project used during execution
  • Loading branch information
crysxd authored Oct 28, 2024
2 parents 48d2727 + 9bf6f67 commit b3f6751
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gradle/config.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Jun 19 09:51:18 CEST 2024
java.home=/Applications/Android Studio Preview.app/Contents/jbr/Contents/Home
#Mon Oct 28 13:03:52 CET 2024
java.home=/Users/christian.wurthner/Library/Java/JavaVirtualMachines/jbr-17.0.9/Contents/Home
4 changes: 3 additions & 1 deletion gradle-bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ val buildNumber = (project.findProperty("AzureBuildNumber") ?: "debug")
group = "com.iodigital.gradlebom"
version = "1.0.$buildNumber"

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

@Suppress("UnstableApiUsage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ abstract class GenericGenerateModuleBomTask : AbstractGenerateBomTask() {

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

private val projectPath = project.path

@Input
@Option(option = "configuration", description = "The configuration to create a bom for. Run \"./gradlew dependencies\" to get a list.")
abstract fun getConfiguration(): Property<String>

override fun createdNestedGradleCommand(): String {
val configuration = getConfiguration().get()
val command = "${project.path.removeSuffix(":")}:dependencies"
val command = "${projectPath.removeSuffix(":")}:dependencies"
return "./gradlew $command --configuration $configuration --no-daemon"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ open class SpecificGenerateModuleBomTask @Inject constructor(
private val configName: String,
) : AbstractGenerateBomTask() {

private val projectPath = project.path

override fun getDescription() = "Creates a CycloneDX BOM for configuration $configName"

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

0 comments on commit b3f6751

Please sign in to comment.