Closed ldesgrange closed 3 years ago
I just tried converting a file with the Asciidoctor Gradle Plugin and an environment variable and it set the expected attributes. I don't think though that setting file metadata on OSX is the goal of SOURCE_DATE_EPOCH, but rather that you have an attribute with that timestamp that you can embed in the document.
You might want to file this in asciidoctor/asciidoctor. Therefore I am going to close this ticket here.
Sorry, I was a bit tired and mixed up some things. Yes you are right it's not to set the file system metadata but the PDF metadata, what I wanted to say is that if I create the same document twice and do $ diff *.pdf
I get:
7,8c7,8
< /ModDate (D:20201207151415+01'00')
< /CreationDate (D:20201207151415+01'00')
---
> /ModDate (D:20201207151143+01'00')
> /CreationDate (D:20201207151143+01'00')
After more tests, in fact it works with gradle (from the command line) but not the other cases (from within Java). Thanks.
Hi,
In order to make reproducible PDF files for my tests, I'm trying to set the SOURCE_DATE_EPOCH environment variable as explained in the doc but from what I see, the generated PDF is still using the current date.
I tried using JUnit's annotation
@SetEnvironmentVariable(key = "SOURCE_DATE_EPOCH", value = "1000000")
or by running gradle with the environnement variable:$ SOURCE_DATE_EPOCH=1000000 ./gradlew test --tests *generatePdf
, I also triedSystem.setProperty("SOURCE_DATE_EPOCH", "1000000");
, but runningmdls
on the PDF shows:Am I doing it wrong or is the environment variable not provided to JRuby (or something else)?