antlr3/reproducible-timestamp.patch

13 lines
682 B
Diff

--- antlr3-3.5.3/tool/src/main/java/org/antlr/Tool.java 2023-09-15 17:54:38.044172037 +0200
+++ antlr3-3.5.3/tool/src/main/java/org/antlr/Tool.java 2023-09-15 17:54:49.090915002 +0200
@@ -1052,6 +1052,9 @@
*/
public static String getCurrentTimeStamp() {
GregorianCalendar calendar = new java.util.GregorianCalendar();
+ if (System.getenv("SOURCE_DATE_EPOCH") != null) {
+ calendar.setTimeInMillis(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
+ }
int y = calendar.get(Calendar.YEAR);
int m = calendar.get(Calendar.MONTH) + 1; // zero-based for months
int d = calendar.get(Calendar.DAY_OF_MONTH);