Skip to content

Commit

Permalink
build: Use -notimestamp option for javadoc for reproducibility
Browse files Browse the repository at this point in the history
Signed-off-by: BJ Hargrave <bj@hargrave.dev>
  • Loading branch information
bjhargrave committed May 10, 2022
1 parent 4f96bc4 commit 0b4f6ad
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Expand Up @@ -86,6 +86,7 @@ public Jar doJavadoc(Map<String, String> options, boolean exportsOnly) throws Ex

try (PrintWriter writer = IO.writer(javadocOptions)) {
writer.println("-quiet");
writer.println("-notimestamp"); // reproducibility
writer.println("-protected");
writer.printf("%s '%s'%n", "-d", fileName(javadoc));
writer.println("-charset 'UTF-8'");
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -42,6 +42,7 @@ subprojects {
"NotThreadSafe:t:",
"GuardedBy:mf:\"Guarded By:\""
]
options.noTimestamp = true
}
tasks.named("test") {
useJUnitPlatform()
Expand Down
8 changes: 8 additions & 0 deletions gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts
Expand Up @@ -192,6 +192,14 @@ tasks.withType<AbstractArchiveTask> {
isReproducibleFileOrder = true
}

// Reproducible javadoc
tasks.withType<Javadoc> {
options {
this as StandardJavadocDocletOptions // unsafe cast
isNoTimestamp = true
}
}

tasks.pluginUnderTestMetadata {
// Include dsl SourceSet
pluginClasspath.from(sourceSets["dsl"].output)
Expand Down
1 change: 1 addition & 0 deletions maven/bnd-plugin-parent/pom.xml
Expand Up @@ -294,6 +294,7 @@
<configuration>
<detectJavaApiLink>false</detectJavaApiLink>
<doclint>none</doclint>
<notimestamp>true</notimestamp>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 0b4f6ad

Please sign in to comment.