Skip to content

Commit

Permalink
Split out the third-party dependencies of build-scan-summary into a s…
Browse files Browse the repository at this point in the history
…eparate jar

`lib/develocity` contains the proprietary code

`lib/third-party` contains the third-party open source libraries.
  In this commit, all OSS libraries are contained in a single jar.
  • Loading branch information
jthurne committed May 16, 2024
1 parent fc159ea commit 11d2c87
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ val isDevelopmentRelease = !hasProperty("finalRelease")
val releaseVersion = releaseVersion()
val releaseNotes = releaseNotes()
val distributionVersion = distributionVersion()
val buildScanSummaryVersion = "0.9-2024.1.1-20240503130149"
val buildScanSummaryVersion = "0.9-2024.1.2-20240515173555"

allprojects {
version = releaseVersion.get()
Expand Down Expand Up @@ -133,6 +133,10 @@ val copyGradleScripts by tasks.registering(Copy::class) {
include("build-scan-summary-${buildScanSummaryVersion}.jar")
into("lib/develocity/")
}
from(layout.projectDirectory.dir("components/third-party")) {
include("build-scan-summary-dependencies-${buildScanSummaryVersion}.jar")
into("lib/third-party/")
}
into(layout.buildDirectory.dir("scripts/gradle"))
}

Expand Down Expand Up @@ -177,6 +181,10 @@ val copyMavenScripts by tasks.registering(Copy::class) {
include("build-scan-summary-${buildScanSummaryVersion}.jar")
into("lib/develocity/")
}
from(layout.projectDirectory.dir("components/third-party")) {
include("build-scan-summary-dependencies-${buildScanSummaryVersion}.jar")
into("lib/third-party/")
}
from(mavenComponents) {
into("lib/scripts/maven-libs/")
}
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion components/scripts/lib/build-scan-offline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ read_build_scan_dumps() {
)

echo "Extracting Build Scan data for all builds"
build_scan_data="$(JAVA_HOME="${CLIENT_JAVA_HOME:-$JAVA_HOME}" invoke_java "$BUILD_SCAN_SUMMARY_JAR" "${args[@]}")"
build_scan_data="$(JAVA_HOME="${CLIENT_JAVA_HOME:-$JAVA_HOME}" invoke_java "${BUILD_SCAN_SUMMARY_JAR}:${SCRIPT_DIR}/lib/third-party/*" com.gradle.develocity.scans.summary.Main "${args[@]}")"
build_scan_summary_exit_code="$?"
if [[ $build_scan_summary_exit_code -eq $JVM_VERSION_NOT_SUPPORTED ]]; then
die "ERROR: Java 17+ is required when using --disable-build-scan-publishing. Rerun the script with Java 17+ or set the CLIENT_JAVA_HOME environment variable to a Java 17+ installation." "$UNEXPECTED_ERROR"
Expand Down
2 changes: 1 addition & 1 deletion components/scripts/lib/build-scan-online.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ fetch_build_scan_data() {
args+=( "${run_num},${build_scan_urls[run_num]}" )
done

JAVA_HOME="${CLIENT_JAVA_HOME:-$JAVA_HOME}" invoke_java "${BUILD_SCAN_SUMMARY_JAR}" "${args[@]}"
JAVA_HOME="${CLIENT_JAVA_HOME:-$JAVA_HOME}" invoke_java "${BUILD_SCAN_SUMMARY_JAR}:${SCRIPT_DIR}/lib/third-party/*" com.gradle.develocity.scans.summary.Main "${args[@]}"
}
4 changes: 3 additions & 1 deletion components/scripts/lib/java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
invoke_java() {
local classpath="$1"
shift
local mainClass="$1"
shift

# OS specific support (must be 'true' or 'false').
cygwin=false
Expand Down Expand Up @@ -111,7 +113,7 @@ location of your Java installation."
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- -Dpicocli.ansi=true -jar "$classpath" "$@"
set -- -Dpicocli.ansi=true -cp "$classpath" "$mainClass" "$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1; then
Expand Down
Binary file not shown.

0 comments on commit 11d2c87

Please sign in to comment.