annotate buildSrc/build.gradle @ 8148:6b242a49e749

RT-34893: [Media] Use of QuickTime prevents Mac AppStore Submission Summary: Added new media platform module which uses AVFoundation instead of QTKit Reviewed-by: almatvee, stayer, kcr, flar
author ddehaven
date Mon, 06 Oct 2014 09:32:41 -0700
parents c1c6f4066627
children 32b4f835090b
rev   line source
richard@3219 1 /*
kcr@7366 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
richard@3219 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
richard@3219 4 *
richard@3219 5 * This code is free software; you can redistribute it and/or modify it
richard@3219 6 * under the terms of the GNU General Public License version 2 only, as
richard@3219 7 * published by the Free Software Foundation. Oracle designates this
richard@3219 8 * particular file as subject to the "Classpath" exception as provided
richard@3219 9 * by Oracle in the LICENSE file that accompanied this code.
richard@3219 10 *
richard@3219 11 * This code is distributed in the hope that it will be useful, but WITHOUT
richard@3219 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
richard@3219 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
richard@3219 14 * version 2 for more details (a copy is included in the LICENSE file that
richard@3219 15 * accompanied this code).
richard@3219 16 *
richard@3219 17 * You should have received a copy of the GNU General Public License version
richard@3219 18 * 2 along with this work; if not, write to the Free Software Foundation,
richard@3219 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
richard@3219 20 *
richard@3219 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
richard@3219 22 * or visit www.oracle.com if you need additional information or have any
richard@3219 23 * questions.
richard@3219 24 */
richard@3219 25
richard@3219 26 /**
richard@3219 27 * Build file for buildSrc project. The buildSrc project contains the annotation
richard@3219 28 * processor that is used to generate the builders, the decora compiler used for effects,
richard@3219 29 * and various annotations we use for FXML, etc. It also contains build script logic such
richard@3219 30 * as for compiling native code. Nothing in buildSrc should *ever* be shipped with the runtime.
richard@3219 31 */
richard@3219 32
kcr@4078 33 /**
kcr@4078 34 * If the given named property is not defined, then this method will define
kcr@4078 35 * it with the given defaultValue. Any properties defined by this method can
kcr@4078 36 * be substituted on the command line by using -P, or by specifying a
kcr@4078 37 * gradle.properties file in the user home dir
kcr@4078 38 *
kcr@4078 39 * @param name The name of the property to define
kcr@4078 40 * @param defaultValue The default value to assign the property
kcr@4078 41 */
kcr@4078 42 void defineProperty(String name, String defaultValue) {
kcr@4078 43 if (!project.hasProperty(name)) {
kcr@4078 44 project.ext.set(name, defaultValue);
kcr@4078 45 }
kcr@4078 46 }
kcr@4078 47
kcr@4078 48 def closedDir = file("../../rt-closed")
kcr@4078 49 def buildClosed = closedDir.isDirectory()
kcr@4078 50
kcr@4078 51 if (buildClosed) {
kcr@4078 52 File supplementalBuildFile = new File("../../rt-closed/closed-properties.gradle");
kcr@4078 53 apply from: supplementalBuildFile
kcr@4078 54 }
kcr@4078 55
richard@3325 56 apply plugin: "java"
richard@3325 57
kcr@4078 58
richard@3219 59 repositories {
kcr@4078 60 if (buildClosed) {
richard@3325 61 ivy {
kcr@4078 62 url jfxRepositoryURL
richard@3325 63 layout "pattern", {
richard@3325 64 artifact "[artifact]-[revision].[ext]"
richard@3325 65 artifact "[artifact].[ext]"
richard@3325 66 }
richard@3325 67 }
richard@3325 68 } else {
richard@3325 69 mavenCentral()
richard@3325 70 }
richard@3219 71 }
richard@3219 72
richard@3219 73 // Include the to-be-generated antlr source files in the source set. We will generate
richard@3219 74 // the antlr sources first before compilation.
richard@3219 75 sourceSets {
richard@3219 76 main.java.srcDirs = ["src/main/java", "$buildDir/generated-src/antlr"]
richard@3219 77 }
richard@3219 78
richard@3219 79 // Workaround for lack of Antlr 3 support in Gradle. By defining a configuration,
richard@3219 80 // we can then give it a class path and use that classpath to execute a java command
danno@6605 81 getConfigurations().create("antlr3");
richard@3219 82
richard@3219 83 dependencies {
richard@3325 84 compile group: "org.antlr", name: "antlr", version: "3.1.3"
richard@3325 85 testCompile group: "junit", name: "junit", version: "4.8.2"
richard@3325 86 antlr3 group: "org.antlr", name: "antlr-runtime", version: "3.1.3"
richard@3325 87 antlr3 group: "org.antlr", name: "stringtemplate", version: "3.2"
richard@3325 88 antlr3 group: "org.antlr", name: "antlr", version: "3.1.3"
richard@3219 89 }
richard@3219 90
richard@3219 91 // At the moment the ASM library shipped with Gradle that is used to
richard@3219 92 // discover the different test classes fails on Java 8, so in order
richard@3219 93 // to have sourceCompatibility set to 1.8 I have to also turn scanForClasses off
richard@3219 94 // and manually specify the includes / excludes. At the moment we use
richard@3219 95 // Java 7 but when we switch to 8 this will be needed, and probably again when
richard@3219 96 // we start building with Java 9.
richard@3219 97 test {
richard@3219 98 jvmArgs("-Djava.ext.dirs=");
richard@3219 99 enableAssertions = true;
richard@3219 100 testLogging.exceptionFormat = "full";
richard@3219 101 scanForTestClasses = false;
richard@3219 102 include("**/*Test.*");
richard@3219 103 exclude("**/DepthTest.*");
richard@3219 104 exclude("**/*Abstract*.*");
richard@3219 105 }
richard@3219 106
richard@3219 107 // This is the task that will call antlr to generate the sources
richard@3219 108 task generateGrammarSource(type: JavaExec) {
richard@3219 109 description = "Generate JSL parser from Antlr3 grammars"
richard@3219 110 String dest = "$buildDir/generated-src/antlr/com/sun/scenario/effect/compiler"
richard@3219 111 String src = "src/main/antlr"
richard@3219 112 inputs.dir file(src)
richard@3219 113 outputs.dir file(dest)
richard@3219 114 def grammars = fileTree(src).include("**/*.g")
richard@3219 115 main = "org.antlr.Tool"
richard@3219 116 classpath = configurations.antlr3
richard@3219 117 args = ["-o", dest, grammars.files].flatten()
richard@3874 118 // See RT-30955. This should be removed when JDK-8015656 is fixed
richard@3874 119 ignoreExitValue = true
richard@3219 120 }
richard@3219 121
richard@3219 122 // Configure the compileJava task so that it relies on the task for generating
richard@3219 123 // the grammar source (gotta have it prior to compilation)
richard@3219 124 compileJava {
richard@3219 125 dependsOn(generateGrammarSource);
richard@3219 126 }