view generator.gradle @ 4047:937a1432ee79

Gradle build. Seriously, getting it right this time.
author Richard Bair <richard.bair@oracle.com>
date Mon, 24 Jun 2013 13:54:44 -0700
parents 35ed9cc8cfb0
children 87c39dfffa54 998a064081b9
line wrap: on
line source
/**
 * This task will generate the new project layout structure for JavaFX. The entire new project
 * structure is generated beneath a new directory simply called "javafx". The idea is that this
 * could become a single repo under which all public JavaFX sources live (rather than where we
 * presently have multiple repositories).
 *
 * Items left to do:
 *  - javafx checkstyle
 *  - media
 *  - building apps
 *  - performance tests
 *  - sqe tests
 *  - unit tests
 *  - manual tests (toys)
 *  - media tests
 *  - all platforms native code, + cross compilation
 *  - How to handle dt *.properties?
 *  - ModenaTest needs to be properly integrated into the tests area
 *  - What about maven builds? We have some .pom right now, but these will need to be redone
 */

defaultTasks = ["generate"]

task createWrapper(type: Wrapper) {
    gradleVersion = '1.4'
}

def fileList = []

ext.RTDir = "."
if (!project.hasProperty('FXDir')) {
    project.ext.FXDir = "../javafx"
}

def verbose = false
if (project.hasProperty('VERBOSE')) {
    verbose = Boolean.parseBoolean(VERBOSE);
}

task generate << {
    def excludeFromSource = ["META-INF/**", "**/doc-files/**/*", "**/*.properties", "**/*.stg", "**/*.g", "**/*.css", "**/*.png", "**/*.jpg", "**/*.gif", "nbproject", "*.iml", "**/*.txt", "**/*.fxml", "**/*.bak", "**/*.orig", "**/*.js", "**/*.frag", "**/*.vert"]
    def includeInResources = ["META-INF/**", "**/*.properties", "**/*.stg", "**/*.css", "**/*.png", "**/*.jpg", "**/*.gif", "**/*.txt", "**/*.fxml", "**/*.js", "**/*.frag", "**/*.vert"]
    def excludeFromResources = ["**/doc-files/**/*"]

    // Copy over the new gradle build files, LICENSE, and README
    copy {
        from RTDir
        into FXDir
        include "*.gradle", "LICENSE", "README", "gradle.properties", "build.properties"
        exclude "generator.gradle"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Copy over the apps
    ["ConferenceScheduleApp", "Modena"].each { app ->
        copy {
            from "$RTDir/apps/experiments/$app/src"
            into "$FXDir/apps/experiments/$app/src/main/java"
            exclude excludeFromSource
            exclude "build.xml"
            eachFile { f ->
                fileList.add(f.file);
            }
        }
        copy {
            from "$RTDir/apps/experiments/$app/src"
            into "$FXDir/apps/experiments/$app/src/main/resources"
            include includeInResources
            exclude excludeFromResources
            eachFile { f ->
                fileList.add(f.file);
            }
        }
    }

    ["3DViewer"].each { app ->
        copy {
            from "$RTDir/apps/experiments/$app/src"
            into "$FXDir/apps/experiments/$app/src"
            exclude "main/java/META-INF/MANIFEST.MF"
            eachFile { f ->
                fileList.add(f.file);
            }
        }
    }

    // Copy over Ensemble8. Some special care taken for the generated stuff.
    copy {
        from "$RTDir/apps/samples/Ensemble8/src"
        into "$FXDir/apps/samples/Ensemble8/src/main/java"
        exclude excludeFromSource
        exclude "build.xml"
        exclude "generated/ensemble/search/index/"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "$RTDir/apps/samples/Ensemble8/src"
        into "$FXDir/apps/samples/Ensemble8/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        include "generated/ensemble/search/index/"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the buildSrc project
    copy {
        from "$RTDir/gradleBuildSrc"
        into "$FXDir/buildSrc"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the NetBeans projects
    copy {
        from "$RTDir/gradleNetBeans"
        into "$FXDir/netbeansProjs"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    
    // Copy the Eclipse project files
    copy {
        from "${RTDir}/gradleEclipse/"
        into "${FXDir}/"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/javafx-beans/src"
        into "${FXDir}/buildSrc/src/main/java"
        include "com/sun/javafx/beans/annotations/**",
                "com/sun/javafx/collections/annotations/**"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-annotation-processor/src",
             "${RTDir}/decora-compiler/src"
        into "${FXDir}/buildSrc/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-annotation-processor/src",
             "${RTDir}/decora-compiler/src"
        into "${FXDir}/buildSrc/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        exclude "**/META-INF/**/*"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/decora-compiler/src/com/sun/scenario/effect/compiler/JSL.g"
        into "${FXDir}/buildSrc/src/main/antlr"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/decora-compiler/test"
        into "${FXDir}/buildSrc/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/decora-compiler/test"
        into "${FXDir}/buildSrc/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the base module
    copy {
        from "${RTDir}/javafx-beans/src",
             "${RTDir}/javafx-util-converter/src",
             "${RTDir}/javafx-anim/src",
             "${RTDir}/javafx-common/src",
             "${RTDir}/javafx-logging/src"
        into "${FXDir}/modules/base/src/main/java"
        exclude "com/sun/javafx/beans/annotations/**",
                "com/sun/javafx/collections/annotations/**"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-beans/src",
             "${RTDir}/javafx-util-converter/src",
             "${RTDir}/javafx-anim/src",
             "${RTDir}/javafx-common/src",
             "${RTDir}/javafx-logging/src"
        into "${FXDir}/modules/base/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-anim/src"
        into "${FXDir}/modules/base/src/main/docs"
        include "**/doc-files/**/*"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-common/build-tools"
        into "${FXDir}/modules/base/src/main/version-info"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-beans/test",
             "${RTDir}/javafx-util-converter/test",
             "${RTDir}/javafx-anim/test/unit", // TODO also has functional tests
             "${RTDir}/javafx-common/test/unit"
        into "${FXDir}/modules/base/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-beans/test",
             "${RTDir}/javafx-util-converter/test",
             "${RTDir}/javafx-anim/test/unit", // TODO also has functional tests
             "${RTDir}/javafx-common/test/unit"
        into "${FXDir}/modules/base/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the graphics module
    copy {
        from "${RTDir}/decora-d3d/src",
             "${RTDir}/decora-es2/src",
             "${RTDir}/decora-jsw/src",
             "${RTDir}/decora-prism/src",
             "${RTDir}/decora-prism-ps/src",
             "${RTDir}/decora-prism-sw/src",
             "${RTDir}/decora-runtime/src",
             "${RTDir}/decora-sse/src",
             "${RTDir}/javafx-accessible/src",
             "${RTDir}/javafx-ui-common/src",
             "${RTDir}/javafx-concurrent/src",
             "${RTDir}/javafx-font/src",
             "${RTDir}/javafx-geom/src",
             "${RTDir}/javafx-geom/cagsrc.double",
             "${RTDir}/javafx-iio/src",
             "${RTDir}/javafx-sg-common/src",
             "${RTDir}/javafx-sg-prism/src",
             "${RTDir}/pisces/src",
             "${RTDir}/glass/glass/src",
             "${RTDir}/javafx-ui-quantum/src",
             "${RTDir}/prism-common/src",
             "${RTDir}/prism-d3d/src",
             "${RTDir}/prism-es2/src",
             "${RTDir}/prism-es2-eglfb/src",
             "${RTDir}/prism-es2-eglx11/src",
             "${RTDir}/prism-es2-ios/src",
             "${RTDir}/prism-es2-mac/src",
             "${RTDir}/prism-es2-win/src",
             "${RTDir}/prism-es2-x11/src",
             "${RTDir}/prism-j2d/src",
             "${RTDir}/prism-null/src",
             "${RTDir}/prism-ps/src",
             "${RTDir}/prism-sw/src",
             "${RTDir}/prism-util/src"
        into "${FXDir}/modules/graphics/src/main/java"
        exclude "com/sun/scenario/effect/compiler/JSL.g"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/decora-d3d/src",
             "${RTDir}/decora-es2/src",
             "${RTDir}/decora-jsw/src",
             "${RTDir}/decora-prism/src",
             "${RTDir}/decora-prism-ps/src",
             "${RTDir}/decora-prism-sw/src",
             "${RTDir}/decora-runtime/src",
             "${RTDir}/decora-sse/src",
             "${RTDir}/javafx-ui-common/src",
             "${RTDir}/javafx-concurrent/src",
             "${RTDir}/javafx-font/src",
             "${RTDir}/javafx-geom/src",
             "${RTDir}/javafx-geom/cagsrc.double",
             "${RTDir}/javafx-iio/src",
             "${RTDir}/javafx-sg-common/src",
             "${RTDir}/javafx-sg-prism/src",
             "${RTDir}/pisces/src",
             "${RTDir}/glass/glass/src",
             "${RTDir}/javafx-ui-quantum/src",
             "${RTDir}/prism-common/src",
             "${RTDir}/prism-d3d/src",
             "${RTDir}/prism-es2/src",
             "${RTDir}/prism-es2-eglfb/src",
             "${RTDir}/prism-es2-eglx11/src",
             "${RTDir}/prism-es2-ios/src",
             "${RTDir}/prism-es2-mac/src",
             "${RTDir}/prism-es2-win/src",
             "${RTDir}/prism-es2-x11/src",
             "${RTDir}/prism-j2d/src",
             "${RTDir}/prism-null/src",
             "${RTDir}/prism-ps/src",
             "${RTDir}/prism-sw/src",
             "${RTDir}/prism-util/src"
        into "${FXDir}/modules/graphics/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-ui-common/src"
        into "${FXDir}/modules/graphics/src/main/docs"
        include "**/doc-files/**/*"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/decora-runtime/test",
             "${RTDir}/javafx-concurrent/test",
             "${RTDir}/javafx-geom/test",
             "${RTDir}/javafx-iio/test",
             "${RTDir}/javafx-sg-common/test",
             "${RTDir}/javafx-sg-prism/test",
             "${RTDir}/javafx-ui-quantum/test",
             "${RTDir}/prism-common/test",
             "${RTDir}/prism-ps/test"
        into "${FXDir}/modules/graphics/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/decora-runtime/test",
             "${RTDir}/javafx-concurrent/test",
             "${RTDir}/javafx-geom/test",
             "${RTDir}/javafx-iio/test",
             "${RTDir}/javafx-sg-common/test",
             "${RTDir}/javafx-sg-prism/test",
             "${RTDir}/javafx-ui-quantum/test",
             "${RTDir}/prism-common/test",
             "${RTDir}/prism-ps/test"
        into "${FXDir}/modules/graphics/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    // Because we have tests that need to be run with StubToolkit vs. Quantum,
    // and others that need Quantum, we have to split them apart
    copy {
        from "${RTDir}/javafx-ui-common/test/unit",
             "${RTDir}/test-stub-toolkit/src"
        into "${FXDir}/modules/graphics/src/stub/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-ui-common/test/unit",
             "${RTDir}/test-stub-toolkit/src"
        into "${FXDir}/modules/graphics/src/stub/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/javafx-beans-dt/src"
        into "${FXDir}/modules/designTime/src/main/java"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-designtime/src"
        into "${FXDir}/modules/designTime/src/main/java"
        include "javafx/scene/ParentDesignInfo.java", "javafx/scene/layout/**", "com/**"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/javafx-beans-dt/test",
             "${RTDir}/javafx-designtime/test"
        into "${FXDir}/modules/designTime/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-beans-dt/test",
             "${RTDir}/javafx-designtime/test"
        into "${FXDir}/modules/designTime/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/prism-ps/jsl",
             "${RTDir}/prism-ps/shadergen"
        into "${FXDir}/modules/graphics/src/main/jsl-prism"
        exclude "nbproject", "*.iml"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    ["glass-lib-gtk", "glass-lib-ios", "glass-lib-lens", "glass-lib-macosx", "glass-lib-windows"].each { dir ->
        def name = dir.substring(dir.lastIndexOf("-") + 1);
        if (name == "windows") name = "win"
        if (name == "macosx") name = "mac"
        copy {
            from "${RTDir}/glass/${dir}/src"
            into "${FXDir}/modules/graphics/src/main/native-glass/${name}"
            eachFile { f ->
                fileList.add(f.file);
            }
        }
    }

    copy {
        from "${RTDir}/javafx-font-native/src"
        into "${FXDir}/modules/graphics/src/main/native-font"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/javafx-iio-native/src"
        into "${FXDir}/modules/graphics/src/main/native-iio"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/prism-common-native/src"
        into "${FXDir}/modules/graphics/src/main/native-prism"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/prism-d3d-native/src"
        into "${FXDir}/modules/graphics/src/main/native-prism-d3d"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/prism-es2-native/src"
        into "${FXDir}/modules/graphics/src/main/native-prism-es2"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/prism-sw-native/include"
        from "${RTDir}/prism-sw-native/src"
        into "${FXDir}/modules/graphics/src/main/native-prism-sw"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/decora-sse-native"
        into "${FXDir}/modules/graphics/src/main/native-decora"
        include "*.cc", "*.h"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/decora-runtime/jsl",
             "${RTDir}/decora-runtime/generator"
        into "${FXDir}/modules/graphics/src/main/jsl-decora"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the controls module
    copy {
        from "${RTDir}/javafx-ui-charts/src",
             "${RTDir}/javafx-ui-controls/src"
        into "${FXDir}/modules/controls/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-ui-charts/src",
             "${RTDir}/javafx-ui-controls/src"
        into "${FXDir}/modules/controls/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-designtime/src"
        into "${FXDir}/modules/controls/src/main/dt"
        include "javafx/scene/control/**"
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-ui-charts/test",
             "${RTDir}/javafx-ui-controls/test"
        into "${FXDir}/modules/controls/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-ui-charts/test",
             "${RTDir}/javafx-ui-controls/test"
        into "${FXDir}/modules/controls/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the swing module
    copy {
        from "${RTDir}/javafx-embed-swing/src"
        into "${FXDir}/modules/swing/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-embed-swing/src"
        into "${FXDir}/modules/swing/src/main/java"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the swt module
    copy {
        from "${RTDir}/javafx-embed-swt/src"
        into "${FXDir}/modules/swt/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-embed-swt/src"
        into "${FXDir}/modules/swt/src/main/java"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the fxml module
    copy {
        from "${RTDir}/javafx-fxml/src"
        into "${FXDir}/modules/fxml/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-fxml/src"
        into "${FXDir}/modules/fxml/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-fxml/src"
        into "${FXDir}/modules/fxml/src/main/docs"
        include "**/doc-files/**/*"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/javafx-fxml/test"
        into "${FXDir}/modules/fxml/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-fxml/test"
        into "${FXDir}/modules/fxml/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the deployment code
    copy {
        from "$RTDir/deploy/javafx-deploy/src/js"
        into "$FXDir/modules/fxpackager/src/main/resources/resources/web-files"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/lib"
        into "$FXDir/modules/fxpackager/src/main/resources/resources/web-files"
        exclude "java-coffee-cup-23x20.png", "splash.gif"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/javafx-launcher/src"
        into "$FXDir/modules/fxpackager/src/main/java"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/src"
        into "$FXDir/modules/fxpackager/src/main/java"
        exclude excludeFromSource
        exclude "**/*antlib.xml",
                "**/*.control", "**/*.copyright", "**/*.desktop", "**/*.postinst", "**/*.postrm", "**/*.spec",
                "**/*.scpt", "**/*.icns", "**/*.template", "**/*.plist",
                "**/*.bmp", "**/*.ico", "**/*.iss", "**/*.wxs"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/src", "$RTDir/deploy/packager/scripts"
        into "$FXDir/modules/fxpackager/src/main/resources"
        include includeInResources
        include "**/*antlib.xml",
                "**/*.control", "**/*.copyright", "**/*.desktop", "**/*.postinst", "**/*.postrm", "**/*.spec",
                "**/*.scpt", "**/*.icns", "**/*.template", "**/*.plist",
                "**/*.bmp", "**/*.ico", "**/*.iss", "**/*.wxs"
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/native/linux"
        into "$FXDir/modules/fxpackager/src/main/native/launcher/linux"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/native/macosx"
        into "$FXDir/modules/fxpackager/src/main/native/launcher/mac"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/native/windows"
        into "$FXDir/modules/fxpackager/src/main/native/launcher/win"
        rename "iconswap.cpp", "IconSwap.cpp"
        include "WinLauncher.cpp", "iconswap.cpp"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/scripts"
        into "$FXDir/modules/fxpackager/src/main/native/javafxpackager/shell"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/winlauncher"
        into "$FXDir/modules/fxpackager/src/main/native/javafxpackager/win"
        include "javafxpackager.manifest", "javafxpackager.rc", "main.cpp"
        rename "main.cpp", "javafxpackager.cpp"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/packager/test"
        into "$FXDir/modules/fxpackager/test/main/java"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/man"
        into "$FXDir/modules/fxpackager/src/main/man"
        exclude "build.xml", "**/ja/**"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "$RTDir/deploy/man/ja"
        into "$FXDir/modules/fxpackager/src/main/man/ja_JP.UTF-8"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the web module
    copy {
        from "${RTDir}/webview/src"
        into "${FXDir}/modules/web/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/webview/src"
        into "${FXDir}/modules/web/src/main/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/webview/test"
        into "${FXDir}/modules/web/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    
    copy {
        from "${RTDir}/webview/test"
        into "${FXDir}/modules/web/src/test/resources"
        include includeInResources
        exclude excludeFromResources
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    copy {
        from "${RTDir}/webview/native"
        into "${FXDir}/modules/web/src/main/native"
        eachFile { f ->
            fileList.add(f.file);
        }
    }

    // Create the builders module
    copy {
        from "${RTDir}/javafx-builders/src"
        into "${FXDir}/modules/builders/src/main/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    copy {
        from "${RTDir}/javafx-builders/test/unit"
        into "${FXDir}/modules/builders/src/test/java"
        exclude excludeFromSource
        eachFile { f ->
            fileList.add(f.file);
        }
    }
    // Find every empty directory and nuke it
    def empty = []
    fileTree("$FXDir").visit {
        if (it.directory && it.file.list().length == 0) empty.add(it.file);
    }
    empty.each { it.delete() }
}

task generateThenDelete() {
    description = "Generate new project layout structure THEN DELETE existing files (i.e., move rather than copy)";
    dependsOn(generate);
    doLast {
        // Delete all copied files
        def nFiles = fileList.size();
        println "Deleting ${nFiles} files"
        if (verbose) {
            fileList.each { f ->
                println "delete: $f";
            }
        }
        delete(fileList);

    }
}