This is an automated email from the ASF dual-hosted git repository.
bernardobotella pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-analytics.git
The following commit(s) were added to refs/heads/trunk by this push:
new b69a4ac8 CASSANALYTICS-105: Fix gradle generated artifacts (#156)
b69a4ac8 is described below
commit b69a4ac80b4a2c57e358ab99f5d33a8fab5c69c2
Author: Bernardo Botella <[email protected]>
AuthorDate: Fri Nov 14 13:30:17 2025 -0800
CASSANALYTICS-105: Fix gradle generated artifacts (#156)
Patch by Bernardo Botella; reviewed by Doug Rohrer for CASSANALYTICS-105
---
CHANGES.txt | 1 +
build.gradle | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index 1ea15c25..0f2bab39 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
0.2.0
-----
+ * Generated distribution artifacts fix (CASSANALYTICS-105)
* Fix SSTable descriptor mismatch preventing newly produced SSTables from
being uploaded (CASSANALYTICS-98)
* Expose SidecarCdc builders and interfaces (CASSANALYTICS-94)
* Fix bulk reader node availability comparator ordering (CASSANALYTICS-99)
diff --git a/build.gradle b/build.gradle
index c5839ac2..d9fe3462 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,6 +28,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'distribution'
+ id 'signing'
// Release Audit Tool (RAT) plugin for checking project licenses
id("org.nosphere.apache.rat") version "0.8.1"
@@ -257,10 +258,21 @@ distributions {
main {
distributionBaseName = 'apache-cassandra-analytics'
contents {
- from 'LICENSE.txt'
+ from('.') {
+ include 'LICENSE.txt'
+ include 'NOTICE.txt'
+ include 'CHANGES.txt'
+ }
+
+ // Include all project JARs in lib/ directory
+ into('lib') {
+ from subprojects.collect { it.tasks.withType(Jar) }
+ }
+
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
}
+
// Packages the sources as a tarball for distribution
sources {
distributionBaseName = 'apache-cassandra-analytics'
@@ -268,7 +280,11 @@ distributions {
contents {
from '.'
include '**/*.*'
- exclude '**.gradle/**'
+ include 'scripts/mvnw'
+ include 'gradlew'
+ include 'build.gradle'
+ exclude '**/.gradle/**'
+ exclude 'gradle/wrapper/gradle-wrapper.jar'
exclude '**.idea/**'
exclude 'bin/**'
exclude 'dependencies/**'
@@ -338,3 +354,65 @@ ext {
&& project.gradle.startParameter.taskNames.any {
it.contains("upload") })
}
+
+signing {
+ required { shouldSign }
+ if (shouldSign) {
+ useGpgCmd()
+ }
+ sign distZip
+ sign distTar
+ sign sourcesDistTar
+ sign sourcesDistZip
+}
+
+// Generate SHA-256 and SHA-512 checksums for distribution artifacts
+// Required for Apache releases
+tasks.register('generateDistributionChecksums') {
+ description = 'Generates SHA-256 and SHA-512 checksums for distribution
artifacts'
+ group = 'distribution'
+
+ dependsOn distTar, distZip, sourcesDistTar, sourcesDistZip
+
+ doLast {
+ println "Generating checksums for distribution archives..."
+ [distTar, distZip, sourcesDistTar, sourcesDistZip].each { task ->
+ def archive = task.archiveFile.get().asFile
+
+ if (archive.exists()) {
+ // Generate SHA-256 checksum
+ def sha256File = new File("${archive}.sha256")
+ def sha256 = java.security.MessageDigest.getInstance("SHA-256")
+ archive.withInputStream { is ->
+ def buffer = new byte[8192]
+ int read
+ while ((read = is.read(buffer)) != -1) {
+ sha256.update(buffer, 0, read)
+ }
+ }
+ sha256File.text = sha256.digest().encodeHex().toString() + "
" + archive.name
+
+ // Generate SHA-512 checksum
+ def sha512File = new File("${archive}.sha512")
+ def sha512 = java.security.MessageDigest.getInstance("SHA-512")
+ archive.withInputStream { is ->
+ def buffer = new byte[8192]
+ int read
+ while ((read = is.read(buffer)) != -1) {
+ sha512.update(buffer, 0, read)
+ }
+ }
+ sha512File.text = sha512.digest().encodeHex().toString() + "
" + archive.name
+ } else {
+ println " ✗ Archive not found: ${archive.absolutePath}"
+ }
+ }
+ }
+}
+
+distTar.finalizedBy generateDistributionChecksums
+distZip.finalizedBy generateDistributionChecksums
+sourcesDistTar.finalizedBy generateDistributionChecksums
+sourcesDistZip.finalizedBy generateDistributionChecksums
+assembleDist.finalizedBy generateDistributionChecksums
+assembleSourcesDist.finalizedBy generateDistributionChecksums
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]