--- groovy-core-GROOVY_1_8_9/gradle/assemble.gradle 2023-09-14 17:55:59.522896097 +0200 +++ groovy-core-GROOVY_1_8_9/gradle/assemble.gradle 2023-09-14 21:03:58.849056055 +0200 @@ -45,6 +45,10 @@ binaryJarsMetaInf = { Date buildTime = new Date() + def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH") + if (sourceDateEpoch != null) { + buildTime = new Date(1000 * Long.parseLong(sourceDateEpoch)) + } from "$projectDir/LICENSE.txt" from("$projectDir/src/main/META-INF/groovy-release-info.properties") { filter {String line -> --- groovy-core-GROOVY_1_8_9/src/examples/transforms/global/CompiledAtASTTransformation.groovy 2023-09-14 17:55:59.532896167 +0200 +++ groovy-core-GROOVY_1_8_9/src/examples/transforms/global/CompiledAtASTTransformation.groovy 2023-09-14 21:31:24.853487358 +0200 @@ -16,7 +16,7 @@ @GroovyASTTransformation(phase=CompilePhase.CONVERSION) public class CompiledAtASTTransformation implements ASTTransformation { - private final static compileTime = new Date().toString() + private final static compileTime = (System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()).toString() public void visit(ASTNode[] astNodes, SourceUnit sourceUnit) { --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/classgen/Verifier.java 2023-09-15 00:14:26.176051747 +0200 +++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/classgen/Verifier.java 2023-09-15 01:27:52.518115209 +0200 @@ -432,13 +432,13 @@ ClassHelper.long_TYPE, //"", node, - new ConstantExpression(System.currentTimeMillis())); + new ConstantExpression((System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()).getTime())); // alternatively, FieldNode timeTagField = SourceUnit.createFieldNode("public static final long __timeStamp = " + System.currentTimeMillis() + "L"); timeTagField.setSynthetic(true); node.addField(timeTagField); timeTagField = new FieldNode( - Verifier.__TIMESTAMP__ + String.valueOf(System.currentTimeMillis()), + Verifier.__TIMESTAMP__ + String.valueOf((System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()).getTime()), ACC_PUBLIC | ACC_STATIC | ACC_SYNTHETIC, ClassHelper.long_TYPE, //"", @@ -1051,12 +1051,12 @@ } protected void addCovariantMethods(ClassNode classNode) { - Map methodsToAdd = new HashMap(); - Map genericsSpec = new HashMap(); + Map methodsToAdd = new TreeMap(); + Map genericsSpec = new TreeMap(); // unimplemented abstract methods from interfaces - Map abstractMethods = new HashMap(); - Map allInterfaceMethods = new HashMap(); + Map abstractMethods = new TreeMap(); + Map allInterfaceMethods = new TreeMap(); ClassNode[] interfaces = classNode.getInterfaces(); for (ClassNode iface : interfaces) { Map ifaceMethodsMap = iface.getDeclaredMethodsMap(); @@ -1086,7 +1086,7 @@ addCovariantMethods(classNode, declaredMethods, abstractMethods, methodsToAdd, genericsSpec); - Map declaredMethodsMap = new HashMap(); + Map declaredMethodsMap = new TreeMap(); if (methodsToAdd.size() > 0) { for (MethodNode mn : declaredMethods) { declaredMethodsMap.put(mn.getTypeDescriptor(), mn); @@ -1336,7 +1336,7 @@ } private Map createGenericsSpec(ClassNode current, Map oldSpec) { - Map ret = new HashMap(oldSpec); + Map ret = new TreeMap(oldSpec); // ret contains the type specs, what we now need is the type spec for the // current class. To get that we first apply the type parameters to the // current class and then use the type names of the current class to reset --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html 2023-09-14 17:55:59.569563087 +0200 +++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html 2023-09-14 21:15:34.220475678 +0200 @@ -62,9 +62,8 @@ %> - + ${title} - --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/deprecated-list.html 2023-09-14 17:55:59.569563087 +0200 +++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/deprecated-list.html 2023-09-14 21:14:47.296829350 +0200 @@ -38,9 +38,8 @@ %> - + ${title} - --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/help-doc.html 2023-09-14 17:55:59.569563087 +0200 +++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/help-doc.html 2023-09-14 21:14:32.966733748 +0200 @@ -3,7 +3,7 @@ <% def title = subtitle + (props.windowTitle ? " (${props.windowTitle})" : "") %> - + ${title} --- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/index-all.html 2023-09-14 17:55:59.569563087 +0200 +++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/index-all.html 2023-09-14 21:15:03.270269230 +0200 @@ -16,9 +16,8 @@ %> - + ${title} - --- groovy-core-GROOVY_1_8_9/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxTimerFactory.groovy 2023-09-14 17:55:59.506229315 +0200 +++ groovy-core-GROOVY_1_8_9/subprojects/groovy-jmx/src/main/groovy/groovy/jmx/builder/JmxTimerFactory.groovy 2023-09-14 21:08:56.304430856 +0200 @@ -93,7 +93,13 @@ } private def getNormalizedDate(date) { - if (!date) return new Date() + def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH") + if (!date) { + if (sourceDateEpoch != null) { + return new Date(1000 * Long.parseLong(sourceDateEpoch)) + } + return new Date() + } if (date instanceof Date) { return date } @@ -103,6 +109,9 @@ case "now": default: startDate = new Date() + if (sourceDateEpoch != null) { + startDate = new Date(1000 * Long.parseLong(sourceDateEpoch)) + } } return startDate }