Skip to content
Snippets Groups Projects
build.gradle 3.22 KiB
Newer Older
/*
 * 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', 'postgres-tomcat']
// Note: To compute the sha256, download the XWiki WAR and issue:
// - Unix: sha256sum <binary name>
// - Mac: shasum --algorithm 256 <binary name>

        xwikiVersion: '10.11.11',
        xwikiSha256: '5390b10f416bf7229cf5866611475452fbe9a1dec1d524c92daa5fbae9091291'
        xwikiVersion: '11.10.2',
        xwikiSha256: 'a904633ccebb9570c50349479818f67fcb3482c7baa1666616f19f389dacb727'
    ]
]

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])

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.