changeset 4234:08a346875ce7

RT-31519: Remove IDEA and Eclipse project generation from gradle build
author rbair
date Tue, 09 Jul 2013 11:41:18 -0700
parents 6f1a454c5a83
children 9bbba7779511
files build.gradle
diffstat 1 files changed, 0 insertions(+), 442 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Tue Jul 09 11:31:53 2013 -0700
+++ b/build.gradle	Tue Jul 09 11:41:18 2013 -0700
@@ -1855,448 +1855,6 @@
     //    dependsOn subprojects.collect { project -> project.getTasksByName("check", true)}
     //}
 
-/******************************************************************************
- *                                                                            *
- *                 Generation of NetBeans Project Files                       *
- *                                                                            *
- *  This next section is responsible for setting up the work for generation   *
- *  of NetBeans project files. The developer needs to invoke                  *
- *                                                                            *
- *      gradle netbeans                                                       *
- *                                                                            *
- *  and all necessary project files will be generated. Note that unlike       *
- *  Eclipse and IDEA, NetBeans natively understands Gradle build files so     *
- *  the project files generated for NetBeans is limited to just shared        *
- *  configuration files. Make sure you have the latest stable release of      *
- *                                                                            *
- *  http://plugins.netbeans.org/plugin/44510/gradle-support                   *
- *                                                                            *
- *  for your version of the IDE.                                              *
- *                                                                            *
- *****************************************************************************/
-
-/*
-  <built-in-tasks>
-    <task>
-      <display-name>build</display-name>
-      <non-blocking>yes</non-blocking>
-      <task-names>
-        <name must-exist="no">build</name>
-      </task-names>
-      <task-jvm-args/>
-    </task>
-  </built-in-tasks>
-  <common-tasks>
-    <task>
-      <display-name>sdk</display-name>
-      <non-blocking>no</non-blocking>
-      <task-names>
-        <name must-exist="yes">tasks</name>
-      </task-names>
-      <task-jvm-args/>
-    </task>
-  </common-tasks>
-
- */
-
-task netBeans() {
-    description = "Creates the NetBeans project files for JavaFX"
-    group = "IDE"
-
-    doLast {
-        File nbGradleProperties = file(".nb-gradle-properties")
-        if (nbGradleProperties.exists()) nbGradleProperties.delete()
-        nbGradleProperties.createNewFile()
-        nbGradleProperties <<
-"""<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<gradle-project-properties>
-  <!--DO NOT EDIT THIS FILE! - Used by the Gradle plugin of NetBeans.-->
-  <source-encoding>UTF-8</source-encoding>
-  <target-platform-name>j2se</target-platform-name>
-  <target-platform>1.7</target-platform>
-  <source-level>1.7</source-level>
-  <script-platform>
-    <spec-name>j2se</spec-name>
-    <spec-version>1.7</spec-version>
-  </script-platform>
-  <gradle-home>?VER=1.4</gradle-home>
-  <license-header>
-    <name>OpenJFX</name>
-    <template>.nb-openjfx-template-license</template>
-    <property name="organization">OpenJFX</property>
-  </license-header>
-</gradle-project-properties>"""
-
-        File nbGradleTemplate = file(".nb-openjfx-template-license")
-        if (nbGradleTemplate.exists()) nbGradleTemplate.delete()
-        nbGradleTemplate.createNewFile()
-        nbGradleTemplate <<
-"""My License will reign supreme!"""
-    }
-}
-
-task cleanNetBeans() {
-    description = "Deletes generated NetBeans files"
-    group = "IDE"
-    doLast {
-        file(".nb-gradle-properties").delete()
-    }
-}
-
-/******************************************************************************
- *                                                                            *
- *                   Generation of IDEA Project Files                         *
- *                                                                            *
- *  This next section is responsible for setting up the work for generation   *
- *  of IntelliJ IDEA project files. The developer needs to invoke             *
- *                                                                            *
- *      gradle idea                                                           *
- *                                                                            *
- *  and all necessary project files will be generated.                        *
- *                                                                            *
- *****************************************************************************/
-
-allprojects {
-    apply plugin: 'idea'
-    if (project == rootProject || project.name == "media") return
-
-    // Also need to un-exclude the build-dir since we put stuff in it, and then re-exclude other stuff
-    if (rootProject.BINARY_STUB != null) {
-        configurations {
-          binaryStub
-          binaryStub.extendsFrom(compile)
-        }
-
-        dependencies {
-          binaryStub rootProject.BINARY_STUB
-        }
-    }
-
-    idea {
-        module {
-            inheritOutputDirs = true;
-            excludeDirs -= buildDir;
-            excludeDirs += [
-                    new File(buildDir, "classes"),
-                    new File(buildDir, "dependency-cache"),
-                    new File(buildDir, "libs"),
-                    new File(buildDir, "resources"),
-                    new File(buildDir, "tmp")];
-
-            if (rootProject.BINARY_STUB != null) {
-                scopes.COMPILE.plus += configurations.binaryStub
-
-                // Some hackery. I have to make sure the binary stub is the VERY LAST entry
-                // in the class path or things will be somewhat unpredictable
-                iml {
-                    withXml { xmlProvider ->
-                        def root = xmlProvider.asNode();
-                        // Find the <root url=".../jfxrt.jar!/" />. Walk up 3 steps to <orderEntry>
-                        def orderEntry = root.depthFirst().find { it.name() == "root" }.parent().parent().parent(); // && it.@url.contains(rootProject.files(rootProject.BINARY_STUB))
-                        if (orderEntry.name() != "orderEntry") throw new Exception("Couldn't find the order entry");
-                        // Move that <orderEntry> to be the last child of its parent.
-                        def parent = orderEntry.parent();
-                        parent.remove(orderEntry);
-                        parent.append(orderEntry);
-                    }
-                }
-            }
-        }
-    }
-}
-
-/**
- * I want to keep all the project files and out directory and such all hidden from the filesystem
- * for the most part, so we don't have a lot of .iml files strewn about. So what we will do is
- * to redirect all of the .iml files into a .idea directory on the root project level, and stash the
- * out/ for all the projects there as well as the project module definition files.
- */
-idea {
-    project {
-        jdkName = "JavaFX 1.7"
-        languageLevel = "1.7"
-        wildcards += ["?*.css", "?*.bss", "?*.glsl", "?*.frag", "?*.ttf", "?*.txt", "?*.fxml"]
-        ipr {
-            withXml { xmlProvider ->
-                def root = xmlProvider.asNode();
-                def doc = root.depthFirst();
-
-                // Set the copyright
-                def copyrightManager = doc.find { it.name() == "component" && it.@name == "CopyrightManager" };
-                copyrightManager.@default="OpenJFX";
-                def module2copyright = copyrightManager.get("module2copyright");
-                module2copyright.replaceNode {
-                    copyright {
-                        option(name: "notice", value:
-"""Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code 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 General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.""");
-                        option(name: "keyword", value: "Copyright");
-                        option(name: "allowReplaceKeyword", value: "");
-                        option(name: "myName", value: "OpenJFX");
-                        option(name: "myLocal", value: "true");
-                    }
-                }
-
-                // Remove some setting and change the project output directory
-                def projectRootManager = doc.find { it.name() == "component" && it.@name == "ProjectRootManager" };
-                projectRootManager.attributes.remove("assert-jdk-15");
-                projectRootManager.children()[0].@url = "file://\$PROJECT_DIR\$/.idea-out";
-
-                // Add in some custom dictionary stuff so that people get fewer green-squigglies
-                // in their code. Nothing like a green squiggly to ruin my day.
-                copyrightManager.plus {
-                    component(name: "ProjectDictionaryState") {
-                        dictionary(name: "javafx") {
-                            words {
-                                w (text: "backoff")
-                                w (text: "blhr")
-                                w (text: "blvr")
-                                w (text: "brhr")
-                                w (text: "brvr")
-                                w (text: "gradle")
-                                w (text: "gzip")
-                                w (text: "halignment")
-                                w (text: "interpolator")
-                                w (text: "jfxrt")
-                                w (text: "multithreaded")
-                                w (text: "redoable")
-                                w (text: "resized")
-                                w (text: "squigglies")
-                                w (text: "subclassing")
-                                w (text: "timeline")
-                                w (text: "timeline's")
-                                w (text: "tlhr")
-                                w (text: "tlvr")
-                                w (text: "trhr")
-                                w (text: "trvr")
-                                w (text: "unmanaged")
-                                w (text: "unselect")
-                                w (text: "urlencoded")
-                                w (text: "valignment")
-                            }
-                        }
-                    }
-                }
-
-                // Setup some common project settings like tabs vs. spaces
-                copyrightManager.plus {
-                    component(name: "CodeStyleSettingsManager") {
-                        option(name: "PER_PROJECT_SETTINGS") {
-                            value {
-                                ADDITIONAL_INDENT_OPTIONS(fileType: "java") {
-                                    option (name: "IDENT_SIZE", value: "4")
-                                    option (name: "CONTINUATION_INDENT_SIZE", value: "8")
-                                    option (name: "TAB_SIZE", value: "4")
-                                    option (name: "USE_TAB_CHARACTER", value: "false")
-                                    option (name: "SMART_TABS", value: "false")
-                                    option (name: "LABEL_INDENT_SIZE", value: "0")
-                                    option (name: "LABEL_INDENT_ABSOLUTE", value: "false")
-                                    option (name: "USE_RELATIVE_INDENTS", value: "false")
-                                }
-                                ADDITIONAL_INDENT_OPTIONS(fileType: "xml") {
-                                    option (name: "IDENT_SIZE", value: "4")
-                                    option (name: "CONTINUATION_INDENT_SIZE", value: "8")
-                                    option (name: "TAB_SIZE", value: "4")
-                                    option (name: "USE_TAB_CHARACTER", value: "false")
-                                    option (name: "SMART_TABS", value: "false")
-                                    option (name: "LABEL_INDENT_SIZE", value: "0")
-                                    option (name: "LABEL_INDENT_ABSOLUTE", value: "false")
-                                    option (name: "USE_RELATIVE_INDENTS", value: "false")
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-//project("buildSrc") {
-//    // Add antlr to the sources for IDEA
-//    idea {
-//        module {
-//            sourceDirs += file("$buildDir/generated-src/antlr")
-//        }
-//    }
-//}
-
-project(":base") {
-    // Add in the version-info generated sources for IDEA projects
-    idea {
-        module {
-            sourceDirs += file("$buildDir/generated-src/version-info")
-        }
-    }
-}
-
-// TODO need to do the iOS stuff (ios package of prism-es2-native, ios package of javafx-iio-native javafx-font-native)
-
-project(":graphics") {
-    idea {
-        module {
-            sourceDirs += [file("$buildDir/generated-src/headers"),
-                    file("src/main/native-decora"),
-                    file("src/main/native-glass/gtk"),
-                    file("src/main/native-glass/ios"),
-                    file("src/main/native-glass/lens"),
-                    file("src/main/native-glass/mac"),
-                    file("src/main/native-glass/win"),
-                    file("src/main/native-prism"),
-                    file("src/main/native-prism-sw")]
-            // TODO generated JSL directories need to be added
-//            sourceDirs += file("$buildDir/generated-src/jsl")
-//            sourceDirs += file("$buildDir/generated-src/jsl")
-            excludeDirs += new File(buildDir, "native");
-            testSourceDirs += [file("src/stub/java"), file("src/stub/resources")];
-        }
-    }
-}
-
-project(":controls") {
-    idea {
-        module {
-            sourceDirs += file("src/main/dt");
-        }
-    }
-}
-
-cleanIdeaWorkspace.group = "IDE"
-cleanIdeaWorkspace.description = "Deletes the javafx.ipw file"
-
-
-/******************************************************************************
- *                                                                            *
- *                   Generation of Eclipse Project Files                      *
- *                                                                            *
- *  This next section is responsible for setting up the work for generation   *
- *  of Eclipse project files. The developer needs to get the Gradle IDE from  *
- *  the SpringSource update site:                                             *
- *                                                                            *
- *      http://dist.springsource.com/release/TOOLS/gradle                     *
- *                                                                            *
- *  and all project files will be generated when javafx is imported into the  *
- *  workspace.  Note that 'gradle eclipse' does not generate good results at  *
- *  this time so the Eclipse plugin is recommended.                           *
- *                                                                            *
- *****************************************************************************/
-
-//TODO - default setting for Eclipse IDE (spaces vs. tabs etc.)
-allprojects {
-    apply plugin: "eclipse"
-    task afterEclipseImport {
-        ext.srcFile = file('.classpath')
-        inputs.file srcFile
-        outputs.dir srcFile
-        onlyIf { srcFile.exists() }
-        doLast {
-            def classpath = new XmlParser().parse(srcFile)
-
-            // Temporary code:  Until full support for JDK8 is released for Eclipse, some expressions
-            // involving generics won't compile.  Builders inclues some exmaples of this.  The fix is
-            // to use the jar that was compiled by the JDK rather than source from Eclipse
-            if (project.name == 'builders') {
-                Node source = classpath.classpathentry.find {it.@path == 'src/main/java'}
-                if (source) {
-                    source.@kind="lib"
-                    source.@exported="true"
-                    source.@path="build/libs/builders.jar"
-                    source.@sourcepath="src/main/java"
-                }
-            }
-
-            // Add an optional reference to the closed runtime repository and the generated source to graphics
-            if (project.name == "graphics") {
-                classpath.appendNode('classpathentry', [kind: 'src', exported: 'true', path: '/builders'])
-                classpath.appendNode('classpathentry', [kind: 'src', exported: 'true', path: 'build/generated-src/jsl-decora'])
-                classpath.appendNode('classpathentry', [kind: 'src', exported: 'true', path: 'build/generated-src/jsl-prism'])
-                classpath
-                    .appendNode('classpathentry', [kind: 'src', exported: 'true', path: '/rt-closed'])
-                    .appendNode('attributes')
-                    .appendNode('attribute', [name: 'optional', value: 'true'])
-            }
-
-            // Add an optional reference to the closed media repository
-            if (project.name == 'media') {
-                //TODO - remove rt when legacy build goes away
-                def list = ['jfxmedia/src', 'test/demos/JavaTestApps/src', 'test/perf/JFXMediaSystemTestApp/src', '/rt', '/rt-closed']
-                for (string in list) {
-                    Node node = classpath.classpathentry.find {it.@path == string}
-                    if (!node) {
-                        classpath
-                            .appendNode('classpathentry', [kind: 'src', exported: 'true', path: string])
-                            .appendNode('attributes')
-                            .appendNode('attribute', [name: 'optional', value: 'true'])
-                    }
-                }
-            }
-
-            // Temporary code: The Eclipse gradle plugin fails when BUILD_CLOSED = true.  This means
-            // that projects must be imported into Eclipse in two passes, first with BUILD_CLOSED = false, 
-            // then with BUILD_CLOSED = true.  The classpath to media and web need to be fixed up during
-            // the second pass when these projects are imported 
-            if (project.name == 'builders') {
-                Node node = classpath.classpathentry.find {it.@path == '/web'}
-                if (!node) {
-                    classpath
-                        .appendNode('classpathentry', [kind: 'src', exported: 'true', path: '/web'])
-                        .appendNode('attributes')
-                        .appendNode('attribute', [name: 'optional', value: 'true'])
-                }
-            }
-            if (project.name == 'media') {
-                Node node = classpath.classpathentry.find {it.@path == '/controls'}
-                if (!node) {
-                    classpath
-                        .appendNode('classpathentry', [kind: 'src', exported: 'true', path: '/controls'])
-                        .appendNode('attributes')
-                        .appendNode('attribute', [name: 'optional', value: 'true'])
-                }
-            }
-            if (project.name == 'web') {
-                def list = ['src/main/java', '/controls', '/media']
-                for (string in list) {
-                    Node node = classpath.classpathentry.find {it.@path == string}
-                    if (!node) {
-                        classpath
-                            .appendNode('classpathentry', [kind: 'src', exported: 'true', path: string])
-                            .appendNode('attributes')
-                            .appendNode('attribute', [name: 'optional', value: 'true'])
-                    }
-                }
-            }
-            
-            // Add the standard Eclipse JUnit class path entry
-            Node node = classpath.classpathentry.find {it.@path == 'org.eclipse.jdt.junit.JUNIT_CONTAINER/4'}
-            if (!node) {
-                classpath.appendNode('classpathentry', [kind: 'con', path: 'org.eclipse.jdt.junit.JUNIT_CONTAINER/4'])
-            }
-            def writer = new FileWriter(srcFile)
-            new XmlNodePrinter(new PrintWriter(writer)).print(classpath)
-         }
-    }
-}
-
 /*
  * This clause changes the way we handle a build.gradle within ./apps
  * It does a few things: