aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-04-15 12:39:00 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-04-15 12:39:00 +0200
commit5d32950cd5ce133843c591690143b67e5d6eb64f (patch)
tree0eebb116a789a169b78acb0d5c8edc76a182ed31 /pdf-as-web
parenta141f891c3b146719cb85c3f201166e77343cf89 (diff)
downloadpdf-as-4-5d32950cd5ce133843c591690143b67e5d6eb64f.tar.gz
pdf-as-4-5d32950cd5ce133843c591690143b67e5d6eb64f.tar.bz2
pdf-as-4-5d32950cd5ce133843c591690143b67e5d6eb64f.zip
update gradle to 5.6.4 and update some build steps to this new version
Diffstat (limited to 'pdf-as-web')
-rw-r--r--pdf-as-web/build.gradle134
1 files changed, 73 insertions, 61 deletions
diff --git a/pdf-as-web/build.gradle b/pdf-as-web/build.gradle
index 164925ad..19b7c73b 100644
--- a/pdf-as-web/build.gradle
+++ b/pdf-as-web/build.gradle
@@ -85,25 +85,27 @@ test {
systemProperties 'pdf-as-web.conf': System.getProperty("user.home") + '/.pdfas/pdf-as-web.properties'
}
-task downloadTomcat << {
- if(!project.buildDir.exists()){
- project.buildDir.mkdirs()
- }
+task downloadTomcat {
+ doLast {
+ if(!project.buildDir.exists()){
+ project.buildDir.mkdirs()
+ }
- String url = "http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/##VERSION##/tomcat-##VERSION##.zip"
- String filename = project.buildDir.toString() + "/tomcat-##VERSION##.zip";
+ String url = "http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/##VERSION##/tomcat-##VERSION##.zip"
+ String filename = project.buildDir.toString() + "/tomcat-##VERSION##.zip";
- url = url.replaceAll("##VERSION##", project.tomcatVersion);
- filename = filename.replaceAll("##VERSION##", project.tomcatVersion);
+ url = url.replaceAll("##VERSION##", project.tomcatVersion);
+ filename = filename.replaceAll("##VERSION##", project.tomcatVersion);
- println "Tomcat Version: " + url
+ println "Tomcat Version: " + url
- println "Tomcat file: " + filename
+ println "Tomcat file: " + filename
- def f = new File(filename)
- if (!f.exists()) {
- println "Downloading Tomcat ..."
- new URL(url).withInputStream{ i -> f.withOutputStream{ it << i }}
+ def f = new File(filename)
+ if (!f.exists()) {
+ println "Downloading Tomcat ..."
+ new URL(url).withInputStream{ i -> f.withOutputStream{ it << i }}
+ }
}
}
@@ -126,68 +128,78 @@ task extractTomcat(dependsOn: downloadTomcat, type: Copy) {
def deployVersions=['','-pdfbox1']
-task copyTomcat(dependsOn: extractTomcat)<<{
- deployVersions.each{
- String targetDir = project.buildDir.toString() + "/tomcat-##VERSION##"+it;
- targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
- println "copiing to "+targetDir
- copy{
- with extractTomcat
- into targetDir
+task copyTomcat(dependsOn: extractTomcat) {
+ doLast {
+ deployVersions.each{
+ String targetDir = project.buildDir.toString() + "/tomcat-##VERSION##"+it;
+ targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
+ println "copiing to "+targetDir
+ copy{
+ with extractTomcat
+ into targetDir
+ }
}
}
}
-task cleanWebAppsInTomcat(dependsOn: copyTomcat) << {
- deployVersions.each{
- String targetDir = project.buildDir.toString() + "/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##/webapps/";
- targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
-
- def webappDir = new File(targetDir);
- println "Removing: " + webappDir.toString()
- def result = webappDir.deleteDir() // Returns true if all goes well, false otherwise.
- println result.toString()
-
- assert result
-
- webappDir.mkdirs()
+task cleanWebAppsInTomcat(dependsOn: copyTomcat) {
+ doLast {
+ deployVersions.each{
+ String targetDir = project.buildDir.toString() + "/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##/webapps/";
+ targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
+
+ def webappDir = new File(targetDir);
+ println "Removing: " + webappDir.toString()
+ def result = webappDir.deleteDir() // Returns true if all goes well, false otherwise.
+ println result.toString()
+
+ assert result
+
+ webappDir.mkdirs()
+ }
}
}
-task putTemplateIntoTomcat(dependsOn: cleanWebAppsInTomcat)<<{
- deployVersions.each{
- String source = project.projectDir.toString() + "/";
-
- String targetDir = "build/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##";
- targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
- copy{
- from "src/main/assembly/tomcat"
- into targetDir
+task putTemplateIntoTomcat(dependsOn: cleanWebAppsInTomcat) {
+ doLast {
+ deployVersions.each{
+ String source = project.projectDir.toString() + "/";
+
+ String targetDir = "build/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##";
+ targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
+ copy{
+ from "src/main/assembly/tomcat"
+ into targetDir
+ }
}
}
}
-task putConfigIntoTomcat(dependsOn: putTemplateIntoTomcat)<<{
- deployVersions.each{
- String source = "../pdf-as-lib/build/resources/main/config/config.zip";
-
- String targetDir = "build/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##/conf/pdf-as";
- targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
- copy{
- from zipTree(source)
- into targetDir
+task putConfigIntoTomcat(dependsOn: putTemplateIntoTomcat) {
+ doLast {
+ deployVersions.each{
+ String source = "../pdf-as-lib/build/resources/main/config/config.zip";
+
+ String targetDir = "build/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##/conf/pdf-as";
+ targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
+ copy{
+ from zipTree(source)
+ into targetDir
+ }
}
}
}
-task putWebConfigIntoTomcat(dependsOn: putConfigIntoTomcat)<<{
- deployVersions.each{
- String targetDir = "build/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##/conf/pdf-as";
- targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
-
- copy{
- from 'src/main/configuration/'
- into targetDir
+task putWebConfigIntoTomcat(dependsOn: putConfigIntoTomcat) {
+ doLast {
+ deployVersions.each{
+ String targetDir = "build/tomcat-##VERSION##"+it+"/apache-tomcat-##VERSION##/conf/pdf-as";
+ targetDir = targetDir.replaceAll("##VERSION##", project.tomcatVersion);
+
+ copy{
+ from 'src/main/configuration/'
+ into targetDir
+ }
}
}
}