Skip to content

Commit cf2abd4

Browse files
committed
Support SOURCE_DATE_EPOCH for deterministic builds.
1 parent 3e2f613 commit cf2abd4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
-- Support SOURCE_DATE_EPOCH for deterministic builds.
2+
(Here and in mchange-commons-java.)
3+
See https://github.com/swaldman/c3p0/issues/163
4+
https://reproducible-builds.org/docs/source-date-epoch/
5+
https://github.com/swaldman/mchange-commons-java/commit/09480482ddde70b98baf8437e66c5e3bba9ae3e2
6+
Thanks Bernhard M. Wiedemann!
17
-- Eliminate support for traditional reflective proxies.
28
-- Fix bad anchor in docs, thanks Hakan!
39
-- Relicense to allow users to opt for LGPL-2.1 or later, rather than LGPL-2.1-only.
10+
(Here and in mchange-commons-java.)
411
See https://github.com/swaldman/c3p0/issues/133
512
Thanks Bernhard E. Reiter!
613
-- Define (in a separate, Java 21, project) a loom virtual-threads based
@@ -34,6 +41,7 @@ c3p0-0.10.0-pre3
3441
See https://github.com/swaldman/c3p0/issues/132
3542
Thanks marcatl, MichaelMih, Leona Nezvalova!
3643
-- Include license files in published source jar.
44+
(Here and in mchange-commons-java.)
3745
See https://github.com/swaldman/c3p0/issues/167
3846
c3p0-0.10.0-pre2
3947
-- Add "Automatic-Module-Name" entry to jar manifest for interoperability with Project Jigsaw / Java 9 modules

build.sc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ object c3p0 extends RootModule with JavaModule with PublishModule {
6565
}
6666
override def forkArgs = T{Seq("-Dcom.mchange.v2.log.MLog=com.mchange.v2.log.FallbackMLog")}
6767
}
68-
object bean extends Gen {}
68+
object bean extends Gen {}
6969

7070
object proxy extends Gen {
7171
override def sources = T { super.sources() :+ PathRef( os.pwd / "src-proxy-interface" ) }
@@ -115,6 +115,8 @@ object c3p0 extends RootModule with JavaModule with PublishModule {
115115
val bmt = buildModTime()
116116
val dmt = recursiveDirModTime( T.dest )
117117
if ( bmt > dmt ) {
118+
import java.time.Instant
119+
val timestamp = sys.env.get("SOURCE_DATE_EPOCH").map( sde => Instant.ofEpochSecond( sde.toLong ) ).getOrElse( Instant.now )
118120
val text =
119121
s"""|package com.mchange.v2.c3p0.subst;
120122
|
@@ -123,7 +125,7 @@ object c3p0 extends RootModule with JavaModule with PublishModule {
123125
| public final static String VERSION = "${version}";
124126
| public final static String DEBUG = "${Debug}";
125127
| public final static String TRACE = "${Trace}";
126-
| public final static String TIMESTAMP = "${java.time.Instant.now}";
128+
| public final static String TIMESTAMP = "${timestamp}";
127129
|
128130
| private C3P0Substitutions()
129131
| {}

0 commit comments

Comments
 (0)