Fixes for reproducible Gradle build

This commit is contained in:
Zlatin Balevsky
2021-05-13 12:45:50 +00:00
parent d2eda3e2e2
commit ec163549f9
4 changed files with 65 additions and 4 deletions

View File

@ -75,7 +75,27 @@ task helpersJar(type: Jar) {
archiveBaseName='i2pTunnelHelpers'
}
task copyJsps(type: Copy) {
doFirst {
def f = file("$buildDir/jsp_copy")
f.mkdirs()
}
from("jsp")
include("**/*.jsp")
include("**/*.jsi")
into("$buildDir/jsp_copy")
doLast {
fileTree("$buildDir/jsp_copy").getFiles().each {
if (it.getName().endsWith("jsi"))
it.setLastModified(0)
}
}
}
task precompileJsp(type : JavaExec) {
dependsOn copyJsps
classpath = sourceSets.main.runtimeClasspath
main = 'net.i2p.servlet.util.JspC'
@ -90,7 +110,7 @@ task precompileJsp(type : JavaExec) {
args "-webinc"
args "$buildDir/web-fragment.xml"
args "-webapp"
args "jsp"
args "$buildDir/jsp_copy"
doLast {
def output = new File("$buildDir/compiledJsps")
output.mkdirs()

View File

@ -89,7 +89,26 @@ task helpersJar(type: Jar) {
}
task copyJsps(type: Copy) {
doFirst {
def f = file("$buildDir/jsp_copy")
f.mkdirs()
}
from("jsp")
include("**/*.jsp")
include("**/*.jsi")
into("$buildDir/jsp_copy")
doLast {
fileTree("$buildDir/jsp_copy").getFiles().each {
if (it.getName().endsWith("jsi"))
it.setLastModified(0)
}
}
}
task precompileJsp(type: JavaExec) {
dependsOn copyJsps
classpath = sourceSets.main.runtimeClasspath
main = 'net.i2p.servlet.util.JspC'
@ -104,7 +123,7 @@ task precompileJsp(type: JavaExec) {
args "-webinc"
args "$buildDir/web-fragment.xml"
args "-webapp"
args "jsp"
args "$buildDir/jsp_copy"
doLast {
def output = new File("$buildDir/compiledJsps")
output.mkdirs()

View File

@ -29,11 +29,32 @@ task bundle {
}
}
task copyJsps(type: Copy) {
doFirst {
def f = file("$buildDir/jsp_copy")
f.mkdirs()
}
from("src/jsp")
include("**/*.jsp")
include("**/*.jsi")
into("$buildDir/jsp_copy")
doLast {
fileTree("$buildDir/jsp_copy").getFiles().each {
if (it.getName().endsWith("jsi"))
it.setLastModified(0)
}
}
}
task precompileJsp(type: JavaExec) {
doFirst {
file("$buildDir/tmp_jsp").mkdirs()
}
dependsOn copyJsps
classpath = sourceSets.main.runtimeClasspath + fileTree("src/lib")
main = 'net.i2p.servlet.util.JspC'
@ -48,7 +69,7 @@ task precompileJsp(type: JavaExec) {
args "-webinc"
args "$buildDir/web-fragment.xml"
args "-webapp"
args "src/jsp"
args "$buildDir/jsp_copy"
doLast {
// normalize the order of the _jspx_dependents
ant.replaceregexp(file : "$buildDir/tmp_jsp/i2p/susi/dns/jsp/addressbook_jsp.java",

View File

@ -26,7 +26,8 @@ dependencies {
implementation project(':core')
implementation project(':router')
implementation project(path : ':installer', configuration: 'jbigi')
implementation fileTree("../apps/susidns/src/lib")
implementation files("../apps/susidns/src/lib/standard.jar")
implementation files("../apps/susidns/src/lib/jstl.jar")
}
import java.nio.file.*