Commit cbbe269d authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Move archive stuff out of SOURCE_DATE_EPOCH at least.

parent 670e07f8
Loading
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -226,3 +226,32 @@ version of `libtool.m4` and `ltmain.sh`, which fixed this issue independently
in `d41cd173e23`. This aforementioned change was first included in version
9.1.0, meaning that the reproducibility issue remains in GCC versions below
that.

## Gradle

With [Kotlin](https://kotlinlang.org/) (recommended):

```kotlin
tasks.withType<AbstractArchiveTask>().configureEach {
    isPreserveFileTimestamps = false
    isReproducibleFileOrder = true
    dirPermissions {
        unix("rwxr-xr-x")
    }
    filePermissions {
        unix("rw-r--r--")
    }
}
```

The Gradle website also has information on [working with reproducible archives](https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives).

With Groovy:

```groovy
// Normalizes the ZIP and JAR archives
tasks.withType(Zip) {
   preserveFileTimestamps = false
   reproducibleFileOrder = true
}
```
+0 −29
Original line number Diff line number Diff line
@@ -348,23 +348,6 @@ let build_date =

### Java / gradle

With [Kotlin](https://kotlinlang.org/) (recommended):

```kotlin
tasks.withType<AbstractArchiveTask>().configureEach {
    isPreserveFileTimestamps = false
    isReproducibleFileOrder = true
    dirPermissions {
        unix("rwxr-xr-x")
    }
    filePermissions {
        unix("rw-r--r--")
    }
}
```

The Gradle website also has information on [working with reproducible archives](https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives).

Legacy [Groovy](https://groovy-lang.org/) implementation:

```groovy
@@ -464,18 +447,6 @@ Add the following property in the `pom.xml` file:
</properties>
```

### Gradle

Set the following properties for the Zip Task that creates the `.jar` file:

```groovy
// Normalizes the ZIP and JAR archives
tasks.withType(Zip) {
   preserveFileTimestamps = false
   reproducibleFileOrder = true
}
```

### JDK

Builds of OpenJDK version 19 or later [support the following new option](https://bugs.openjdk.org/browse/JDK-8276766) in the `jar` and `jmod` commands: