/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ import org.apache.tools.ant.filters.ReplaceTokens // Run this Gradle build with 'gradle' to generate the various versions and variants from the template directory. // Whenever a new version of XWiki is out, update this file to update the token values, run gradle and commit the // result. // // Note: As a consequence only update the template files and never the generated files! defaultTasks 'generate' def variants = ['mysql-tomcat', 'mariadb-tomcat', 'postgres-tomcat'] // Notes: // - To compute the XWiki sha256, download the XWiki WAR from // http://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-war, and issue: // - Unix: sha256sum <binary name> // - Mac: shasum --algorithm 256 <binary name> // - To compute the mysql JDBC sha256, get the JAR at https://search.maven.org/artifact/com.mysql/mysql-connector-j and // do the same as for the XWiki sha256. // - To compute the MariaDB JDBC sha256, get the JAR at // https://search.maven.org/artifact/org.mariadb.jdbc/mariadb-java-client and do the same as for the XWiki sha256. // - To compute the Postgres JDBC sha256, get the JAR at // https://search.maven.org/artifact/org.postgresql/postgresql and do the same as for the XWiki sha256. // - Use the JDBC driver versions found in the XWiki POM for the specified versions: // - mysql: https://github.com/xwiki/xwiki-platform/blob/master/pom.xml#L110 (link for master) // - mariadb: https://github.com/xwiki/xwiki-platform/blob/master/pom.xml#L113 (link for master) // - postgresql: https://github.com/xwiki/xwiki-platform/blob/master/pom.xml#L119 (link for master) def tokens = [ '16': [ xwikiVersion: '16.2.0', xwikiSha256: '7d355ae1c88691b19af9658e3f042083d57c08d5e52e1ade25536536ad72fb3f', mysqlJDBCVersion: '8.3.0', mysqlJDBCSha256: '94e7fa815370cdcefed915db7f53f88445fac110f8c3818392b992ec9ee6d295', mariadbJDBCVersion: '3.3.3', mariadbJDBCSha256: '89d71a6ffd800c032b23e588108688d391631f0aba962ba2381cc82cb111b796', postgresJDBCVersion: '42.7.2', postgresJDBCSha256: '0c244ac7d02cf89d8e29852eace6595d75bc4d78581b85b2768460081646a57b' ], '15': [ xwikiVersion: '15.10.8', xwikiSha256: '20bfda3e0a694df904cab1f0291ff40761cf3461117654c5dc4860ba6397fd85', mysqlJDBCVersion: '8.3.0', mysqlJDBCSha256: '94e7fa815370cdcefed915db7f53f88445fac110f8c3818392b992ec9ee6d295', mariadbJDBCVersion: '3.3.3', mariadbJDBCSha256: '89d71a6ffd800c032b23e588108688d391631f0aba962ba2381cc82cb111b796', postgresJDBCVersion: '42.7.2', postgresJDBCSha256: '0c244ac7d02cf89d8e29852eace6595d75bc4d78581b85b2768460081646a57b' ], '14': [ xwikiVersion: '14.10.21', xwikiSha256: '72a634e2aeb085878dce2629a3e5e6136887d0c22712dcee5a284be8143135ea', mysqlJDBCVersion: '8.3.0', mysqlJDBCSha256: '94e7fa815370cdcefed915db7f53f88445fac110f8c3818392b992ec9ee6d295', mariadbJDBCVersion: '3.3.3', mariadbJDBCSha256: '89d71a6ffd800c032b23e588108688d391631f0aba962ba2381cc82cb111b796', postgresJDBCVersion: '42.7.2', postgresJDBCSha256: '0c244ac7d02cf89d8e29852eace6595d75bc4d78581b85b2768460081646a57b' ] ] task generate() { doLast { // Copy the template for all versions and variants tokens.keySet().each() { version -> variants.each() { variant -> // Extract the db type and add it as a token def (db, servlet) = variant.tokenize('-') tokens[version].'db' = db // Copy common template files, evaluating groovy in them copy { from 'template' into "${version}/${variant}" include '.env' include 'Dockerfile' include 'docker-compose.yml' include 'xwiki/*' expand(tokens[version]) filteringCharset = 'UTF-8' } // Copy DB-specific template files, evaluating groovy in them copy { from 'template' into "${version}/${variant}" include "${db}/*" expand(tokens[version]) filteringCharset = 'UTF-8' } // Copy Servlet-specific template files, evaluating groovy in them copy { from 'template' into "${version}/${variant}" include "${servlet}/*" expand(tokens[version]) filteringCharset = 'UTF-8' } } } } }