File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,20 @@ import java.time.OffsetDateTime
4
4
import java.time.ZoneOffset
5
5
import java.time.format.DateTimeFormatter
6
6
7
- val buildTimeAndDate: OffsetDateTime by extra {
8
-
9
- // SOURCE_DATE_EPOCH is a UNIX timestamp for pinning build metadata against
10
- // in order to achieve reproducible builds
11
- //
12
- // More details - https://reproducible-builds.org/docs/source-date-epoch/
13
-
7
+ val buildTimeAndDate =
14
8
if (System .getenv().containsKey(" SOURCE_DATE_EPOCH" )) {
15
9
10
+ // SOURCE_DATE_EPOCH is a UNIX timestamp for pinning build metadata against
11
+ // in order to achieve reproducible builds
12
+ //
13
+ // More details - https://reproducible-builds.org/docs/source-date-epoch/
16
14
val sourceDateEpoch = System .getenv(" SOURCE_DATE_EPOCH" ).toLong()
17
15
18
16
Instant .ofEpochSecond(sourceDateEpoch).atOffset(ZoneOffset .UTC )
19
17
20
18
} else {
21
19
OffsetDateTime .now()
22
20
}
23
- }
24
21
25
22
val buildDate: String by extra { DateTimeFormatter .ISO_LOCAL_DATE .format(buildTimeAndDate) }
26
23
val buildTime: String by extra { DateTimeFormatter .ofPattern(" HH:mm:ss.SSSZ" ).format(buildTimeAndDate) }
You can’t perform that action at this time.
0 commit comments