File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
grails-common/src/main/groovy/org/apache/grails/common/properties
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 17
17
package org.apache.grails.common.properties
18
18
19
19
import java.nio.charset.StandardCharsets
20
+ import java.time.LocalDate
21
+ import java.time.ZoneOffset
20
22
import java.util.regex.Pattern
21
23
22
24
final class PropertyFileUtils {
@@ -30,7 +32,9 @@ final class PropertyFileUtils {
30
32
static void makePropertiesFileReproducible (File factoriesFile ) {
31
33
String sourceDateEpoch = System . getenv(' SOURCE_DATE_EPOCH' )
32
34
if (! sourceDateEpoch) {
33
- return
35
+ sourceDateEpoch = LocalDate . now(ZoneOffset . UTC )
36
+ .atStartOfDay(ZoneOffset . UTC )
37
+ .toEpochSecond(). toString()
34
38
}
35
39
36
40
Pattern timeRegex = Pattern . compile(' ^#(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)(?:,|\\\\ s).*$' )
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ import org.springframework.boot.gradle.tasks.run.BootRun
72
72
73
73
import javax.inject.Inject
74
74
import java.nio.charset.StandardCharsets
75
+ import java.time.LocalDate
76
+ import java.time.ZoneOffset
75
77
import java.util.regex.Pattern
76
78
77
79
/**
@@ -173,7 +175,9 @@ class GrailsGradlePlugin extends GroovyPlugin {
173
175
static void makePropertiesFileReproducible (File factoriesFile ) {
174
176
String sourceDateEpoch = System . getenv(' SOURCE_DATE_EPOCH' )
175
177
if (! sourceDateEpoch) {
176
- return
178
+ sourceDateEpoch = LocalDate . now(ZoneOffset . UTC )
179
+ .atStartOfDay(ZoneOffset . UTC )
180
+ .toEpochSecond(). toString()
177
181
}
178
182
179
183
Pattern timeRegex = Pattern . compile(' ^#(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)(?:,|\\\\ s).*$' )
You can’t perform that action at this time.
0 commit comments