Skip to content

Commit

Permalink
Trying to fix the build
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Dec 3, 2023
1 parent 2e506ba commit bcb7b47
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import java.time.Duration

/**
* In addition to releasing the library on Maven Central, we also release a SAS library along with some macros.
* Since the release is triggered on GitHub via the creation of a release, the SAS zip distribution has to be
* manually created before and added to the release:
*
* gradlew clean createDistribution
*/

plugins {
id 'java-library'
id 'checkstyle'
Expand Down Expand Up @@ -54,6 +62,12 @@ java {
withSourcesJar()
}

// I have absolutely no idea why I need to do this; it appears the test task depends on the created JAR file; I know it depends
// on the source code, but I can't figure out why it depends on the created archive itself. I found this workaround online...
tasks.named("test") {
dependsOn(tasks.named("jar"))
}

// customize the manifest
jar {
manifest {
Expand Down Expand Up @@ -81,6 +95,8 @@ sonarqube {
property "sonar.host.url", "https://sonarcloud.io"
property 'sonar.exclusions', '**/lab/*'
property 'sonar.coverage.exclusions', '**/lab/*'
property 'sonar.exclusions', '**/sas/*'
property 'sonar.coverage.exclusions', '**/sas/*'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SasGzipOutputStream extends DeflaterOutputStream {
/**
* CRC-32 of uncompressed data.
*/
protected CRC32 crc = new CRC32();
protected CRC32 _crc = new CRC32();

/**
* GZIP header magic number.
Expand All @@ -43,7 +43,7 @@ public class SasGzipOutputStream extends DeflaterOutputStream {
public SasGzipOutputStream(OutputStream out) throws IOException {
super(out, new Deflater(Deflater.BEST_SPEED, true), 65536, false);
writeHeader();
crc.reset();
_crc.reset();
}

/**
Expand All @@ -57,7 +57,7 @@ public SasGzipOutputStream(OutputStream out) throws IOException {
@Override
public synchronized void write(byte[] buf, int off, int len) throws IOException {
super.write(buf, off, len);
crc.update(buf, off, len);
_crc.update(buf, off, len);
}

/**
Expand Down Expand Up @@ -119,7 +119,7 @@ private void writeHeader() throws IOException {
* offset.
*/
private void writeTrailer(byte[] buf, int offset) {
writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data
writeInt((int)_crc.getValue(), buf, offset); // CRC-32 of uncompr. data
writeInt(def.getTotalIn(), buf, offset + 4); // Number of uncompr. bytes
}

Expand Down

0 comments on commit bcb7b47

Please sign in to comment.