Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ Release/
bin/
build/
dist/
gradle.properties
testbin/
**/Ensemble8/lib/
**/Ensemble8/src/generated/resources/ensemble/search/index/write.lock
**/nbproject/private/
hs_err_pid*

# JavaFX user-local properties for the build
gradle-local.properties

# Ignore webrevs
/webrev/
/webrev.zip
Expand Down
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,29 @@ void loadProperties(String sourceFileName) {
}
}

/**
* Reads the JavaFX local user properties file (gradle-local.properties).
*/
void loadLocalProperties(String sourceFileName) {
def propFile = new File(sourceFileName)
if (!propFile.canRead()) {
return
}

def localProps = new Properties()
propFile.withInputStream { localProps.load(it) }

def cliProps = gradle.startParameter.projectProperties
localProps.forEach((name, value) -> {
if (cliProps.containsKey(name)) {
logger.info("gradle-local.properties: $name overriden by CLI arg")
return
}
ext[name] = value
logger.info("gradle-local.properties: defined $name=$value")
})
}

/**
* Struct used to contain some information passed to the closure
* passed to compileTargets.
Expand Down Expand Up @@ -308,6 +331,7 @@ void setFileTimestamps(Provider<RegularFile> archive, Instant instant) {
*****************************************************************************/

loadProperties("$projectDir/build.properties")
loadLocalProperties("$projectDir/gradle-local.properties")

// If the ../rt-closed directory exists, then we are doing a closed build.
// In this case, build and property files will be read from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
#####################################################################################
# #
# This properties file allows for a developer to override various properties used #
# when building JavaFX. Any settings you configure in the gradle.properties file #
# will have precedence over any values specified in the build script itself. #
# when building JavaFX. Any settings you configure in the gradle-local.properties #
# file will have precedence over any values specified in the build script itself. #
# Don't place Gradle properties (org.gradle.*) or system properties (systemProp.*) #
# here as they will be read too late. Either pass them with -D, set GRADLE_OPTS, #
# or put them in <GRADLE_USER_HOME>/gradle.properties. #
# #
#####################################################################################

Expand Down
27 changes: 27 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright (c) 2026, 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.
#

# Search for Java installations also in JDK_HOME - required for using the Java Toolchain
org.gradle.java.installations.fromEnv=JDK_HOME