Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to gradle 8.3, AnyEscapableString hierarchy #36

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ where you substitute the correct proxies and ports required for your environment

## Changelog

* Next

- patch: Added `listConfigurations`, `allBoms`, and a `...Bom` task for every Gradle configuration set. The `allBoms` and `...Bom` tasks generate JSON CycloneDX SBOMs in `gradleBuild/reports/cyclonedx`.
vinjana marked this conversation as resolved.
Show resolved Hide resolved

* 2.4.1

- Patch: Library update
vinjana marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
85 changes: 64 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@
* Distributed under the MIT License (license terms are at https://www.github.com/theroddywms/Roddy/LICENSE.txt).
*/

import org.cyclonedx.gradle.CycloneDxTask

plugins {
id 'org.ajoberstar.grgit' version '1.7.2'
id 'org.ajoberstar.grgit' version '4.1.1'
id 'org.cyclonedx.bom' version '1.8.2'
id 'maven-publish'
}

apply plugin: 'groovy'
apply plugin: 'maven'

group = "com.github.theroddywms"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}


/*
* Gets the version name from the current Git tag. If the current commit is not tagged,
Expand All @@ -30,44 +38,47 @@ repositories {
}

dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.21'
testCompile 'junit:junit:4.13.1'
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
compile group: 'commons-codec', name: 'commons-codec', version: '1.13'
compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
implementation 'org.codehaus.groovy:groovy-all:2.4.21'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.spockframework:spock-core:1.1-groovy-2.4'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.13'
implementation group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
}

// Fix Java Version
ext.langLevel = 1.8
model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/pom.xml")
}
}

task writePom {
doLast {
pom {
project {
version rootProject.version
inceptionYear '2017'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'RoddyToolLib'
url = "https://www.github.com/theroddywms/RoddyToolLib"
licenses {
license {
name 'MIT License'
url 'https://raw.githubusercontent.com/eilslabs/RoddyToolLib/master/LICENSE'
distribution 'repo'
name = 'MIT License'
url = 'https://raw.githubusercontent.com/eilslabs/RoddyToolLib/master/LICENSE'
}
}
}
}.writeTo("$buildDir/pom.xml")
}
}
}

jar {
version = getVersionName()
manifest {
attributes("Implementation-Vendor": "German Cancer Research Center (DKFZ)")
attributes("Implementation-Title": baseName)
attributes("Implementation-Title": archiveBaseName.get())
attributes 'Implementation-Version': rootProject.version
}

dependsOn writePom
into("META-INF/maven/$project.group/$project.name") {
from generatePomFileForMavenJavaPublication
from "$buildDir/pom.xml"
}
}
Expand All @@ -86,3 +97,35 @@ test {
setShowStandardStreams true
}
}

task listConfigurations {
group = "reporting"
description = "List all configurations, as needed for discerning development and production configurations by the SBOM tasks."
doLast {
configurations.each { Configuration c ->
println c.name
}
}
}

task allBoms() {
// a grouping task to execute the CycloneDxTask for each configuration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could just add this as "description" instead of a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

group = "reporting"
}

rootProject.configurations.each { configuration ->
Gordi marked this conversation as resolved.
Show resolved Hide resolved
String name = configuration.name
task "${name}Bom"(type: CycloneDxTask) {
group = "reporting"
description = "Creates a CycloneDX SBOM for the configuration ${name}."

destination = file("${project.buildDir}/reports/cyclonedx")
outputName = name
includeConfigs = [name]
schemaVersion = "1.5"
outputFormat="json"
includeLicenseText = false
projectType = "application"
}
allBoms.dependsOn tasks.getByName("${name}Bom")
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading