Skip to content

Commit

Permalink
Merge branch 'master' into clip_mask_support
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaweshkc committed Aug 26, 2020
2 parents ef47709 + 7a4bd9b commit b1299ba
Show file tree
Hide file tree
Showing 5,796 changed files with 264,245 additions and 202,183 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
51 changes: 51 additions & 0 deletions WEBKIT-MEDIA-STUBS.md
@@ -0,0 +1,51 @@
# Web Testing

The web project needs WebKit and Media shared libraries to run tests.

These can be supplied in a number of ways. See sections below.

## Compiled from source

Specify these Gradle properties to enable building of WebKit and Media libraries from source:

-PCOMPILE_WEBKIT=true -PCOMPILE_MEDIA=true

Note that these require additional build tooling and take some time to build.

If you are not actively working on these sources, you may want to cache the output by copying it to one of the folders mentioned below.


## Cached libraries

You can manually place WebKit and Media shared libraries in these folders:

* Unix libraries (*.so or *.dylib files)
````
$projectDir/../caches/sdk/lib
````

* Windows libraries (*.dll files)
````
$projectDir/../caches/sdk/bin
````

## Officially released libraries

Gradle has a task to automate downloading officially released libraries from MavenCentral.

You can enable the task by specifying this Gradle property:

-PSTUB_RUNTIME_OPENJFX="15-ea+4"

Note that these libraries may not be compatible with the source tree you are working with. Always use the [latest version](https://search.maven.org/search?q=g:org.openjfx%20AND%20a:javafx); this may improve your chances of compatibility.


## Skip Web tests

You can also skip the web module tests.

Specify these options to Gradle

-x :web:test

Note that this is fine for local work. But a full test *is* required before submitting a PR, see [CONTRIBUTING.md](https://github.com/openjdk/jfx/blob/master/CONTRIBUTING.md).
111 changes: 86 additions & 25 deletions build.gradle
Expand Up @@ -453,6 +453,10 @@ defineProperty("CONF", "Debug")
ext.IS_DEBUG_JAVA = CONF == "Debug" || CONF == "DebugNative"
ext.IS_DEBUG_NATIVE = CONF == "DebugNative"

// Specifies whether to enable the Maven publishing tasks
defineProperty("MAVEN_PUBLISH", "false")
ext.IS_MAVEN_PUBLISH = Boolean.parseBoolean(MAVEN_PUBLISH)

// Defines the compiler warning levels to use. If empty, then no warnings are generated. If
// not empty, then the expected syntax is as a space or comma separated list of names, such
// as defined in the javac documentation.
Expand Down Expand Up @@ -553,7 +557,7 @@ if (HUDSON_JOB_NAME == "not_hudson") {
defineProperty("RELEASE_SUFFIX", relSuffix)
defineProperty("RELEASE_VERSION_SHORT", "${RELEASE_VERSION}${RELEASE_SUFFIX}")
defineProperty("RELEASE_VERSION_LONG", "${RELEASE_VERSION_SHORT}+${PROMOTED_BUILD_NUMBER}${relOpt}")
defineProperty("MAVEN_VERSION", IS_MILESTONE_FCS ? "${RELEASE_VERSION_SHORT}" : "${RELEASE_VERSION_LONG}")
defineProperty("MAVEN_VERSION", IS_MAVEN_PUBLISH ? (IS_MILESTONE_FCS ? "${RELEASE_VERSION_SHORT}" : "${RELEASE_VERSION_LONG}") : "")

// Check whether the COMPILE_TARGETS property has been specified (if so, it was done by
// the user and not by this script). If it has not been defined then default
Expand Down Expand Up @@ -1249,9 +1253,15 @@ if (gradle.gradleVersion != jfxGradleVersion) {

// Look for stub runtime in bundled sdk, standalone sdk, or boot JDK

// Allows automatic provisioning of webkit+media shared libraries
// from official OpenJFX releases, downloaded from MavenCentral
defineProperty("STUB_RUNTIME_OPENJFX", "")
ext.IS_STUB_RUNTIME_OPENJFX = !STUB_RUNTIME_OPENJFX.isBlank()

def String cachedBundledRuntime = cygpath("$projectDir") + "/../caches/modular-sdk"
def String cachedStandaloneRuntime = cygpath("$projectDir") + "/../caches/sdk"
def String jdkStubRuntime = cygpath("$JDK_HOME")
def String openjfxStubRuntime = cygpath("$projectDir") + "/buildSrc/build/openjfxStub"

def defaultStubRuntime = ""
if (file(cachedBundledRuntime).exists()) {
Expand All @@ -1260,6 +1270,8 @@ if (file(cachedBundledRuntime).exists()) {
defaultStubRuntime = cachedStandaloneRuntime
} else if (BUILD_CLOSED) {
defaultStubRuntime = cachedBundledRuntime
} else if (IS_STUB_RUNTIME_OPENJFX) {
defaultStubRuntime = openjfxStubRuntime
} else {
defaultStubRuntime = jdkStubRuntime
}
Expand Down Expand Up @@ -1329,6 +1341,7 @@ logger.quiet("RELEASE_SUFFIX: $RELEASE_SUFFIX")
logger.quiet("RELEASE_VERSION_SHORT: $RELEASE_VERSION_SHORT")
logger.quiet("RELEASE_VERSION_LONG: $RELEASE_VERSION_LONG")
logger.quiet("RELEASE_VERSION_PADDED: $RELEASE_VERSION_PADDED")
logger.quiet("MAVEN_PUBLISH: $MAVEN_PUBLISH")
logger.quiet("MAVEN_VERSION: $MAVEN_VERSION")
logger.quiet("UPDATE_STUB_CACHE: $UPDATE_STUB_CACHE")

Expand Down Expand Up @@ -1424,7 +1437,7 @@ void addNative(Project project, String name) {
cleanTask.delete "$libRootDir/${t.name}"
}
nativeTask.dependsOn(linkTask)
if (IS_WINDOWS && t.name == "win") {
if (IS_WINDOWS && t.name == "win" && (!IS_STATIC_BUILD || name == "glass")) {
def rcTask = project.task("rc$capitalName$capitalVariant", type: CompileResourceTask, group: "Build") {
description = "Compiles native sources for $name"
matches = ".*\\.rc"
Expand Down Expand Up @@ -1533,6 +1546,10 @@ void addJSL(Project project, String name, String pkg, List<String> addExports, C
}

void addMavenPublication(Project project, List<String> projectDependencies) {
if (!IS_MAVEN_PUBLISH) {
return
}

project.apply plugin: 'maven-publish'

project.group = MAVEN_GROUP_ID
Expand Down Expand Up @@ -2043,7 +2060,6 @@ project(":graphics") {
project.ext.includeSources = true
project.ext.moduleRuntime = true
project.ext.moduleName = "javafx.graphics"
project.ext.mavenPublish = true

getConfigurations().create("antlr");

Expand Down Expand Up @@ -2566,8 +2582,18 @@ project(":swing") {

sourceSets {
main
//shims // no test shims needed
test
shims {
java {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
test {
java {
compileClasspath += sourceSets.shims.output
runtimeClasspath += sourceSets.shims.output
}
}
}

project.ext.moduleSourcePath = defaultModuleSourcePath
Expand Down Expand Up @@ -2862,15 +2888,7 @@ project(":media") {
"CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")

if (t.name == "win") {
Map winEnv = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)

String sdkDir = System.getenv("BASECLASSES_SDK_DIR");
if (sdkDir == null) {
sdkDir = "C:/Program Files/Microsoft SDKs/Windows/v7.1" // Default value
winEnv["BASECLASSES_SDK_DIR"] = sdkDir
}
environment(winEnv)

environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
args("RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.fxpluginsRcFile}")
}
}
Expand Down Expand Up @@ -3381,16 +3399,21 @@ project(":web") {

test {
doFirst {
if (!IS_COMPILE_WEBKIT) {
println "*****************************************************"
if (IS_STUB_RUNTIME_OPENJFX) {
println "********************************************************"
println "WARNING: running web tests with officially built webkit."
println "The webkit native library may not be compatible with the"
println "source tree you are using."
println "If tests fail, try compiling webkit instead."
println "See WEBKIT-MEDIA-STUBS.md"
println "********************************************************"
} else if (!IS_COMPILE_WEBKIT) {
println "******************************************************"
println "WARNING: running web tests without building webkit."
println "The webkit native library will be copied from the JDK,"
println "which might lead to failures in some web tests."
println "To avoid these failures, you should either build"
println "webkit locally, copy the native webkit library from a"
println "recent build, or skip execution of web test cases with"
println "'-x :web:test'"
println "*****************************************************"
println "See WEBKIT-MEDIA-STUBS.md"
println "******************************************************"
}
}
// Run web tests in headless mode
Expand Down Expand Up @@ -3430,6 +3453,9 @@ project(":web") {
exec {
workingDir("$webkitOutputDir")
def cmakeArgs = "-DENABLE_TOOLS=1"
if (IS_STATIC_BUILD) {
cmakeArgs = " $cmakeArgs -DSTATIC_BUILD=1 -DUSE_THIN_ARCHIVES=OFF";
}
cmakeArgs = " $cmakeArgs -DCMAKE_C_COMPILER='${webkitProperties.compiler}'"
if (t.name == "win") {
// To enable ninja build on Windows
Expand All @@ -3446,6 +3472,9 @@ project(":web") {
// TODO: Use cflags and ldflags from all platforms
def cFlags = webkitProperties.ccFlags?.join(' ') ?: ''
def lFlags = webkitProperties.linkFlags?.join(' ') ?: ''
if (IS_STATIC_BUILD) {
cFlags = " $cFlags -DSTATIC_BUILD=1";
}
// -shared flag should be omitted while creating executable.
def exeFlags = webkitProperties.linkFlags?.join(' ')?.replace('-shared', '') ?: ''
cmakeArgs = "$cmakeArgs -DCMAKE_C_FLAGS='${cFlags}' -DCMAKE_CXX_FLAGS='${cFlags}'"
Expand Down Expand Up @@ -3572,6 +3601,7 @@ project(":systemTests") {
testapp5
testapp6
testscriptapp1
testscriptapp2
}

def nonModSrcSets = [
Expand All @@ -3585,7 +3615,8 @@ project(":systemTests") {
sourceSets.testapp4,
sourceSets.testapp5,
sourceSets.testapp6,
sourceSets.testscriptapp1
sourceSets.testscriptapp1,
sourceSets.testscriptapp2
]

project.ext.buildModule = false
Expand Down Expand Up @@ -3685,7 +3716,7 @@ project(":systemTests") {
}
test.dependsOn(createTestApps);

def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6", "testscriptapp1" ]
def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6", "testscriptapp1", "testscriptapp2" ]
modtestapps.each { testapp ->
def testappCapital = testapp.capitalize()
def copyTestAppTask = task("copy${testappCapital}", type: Copy) {
Expand Down Expand Up @@ -4321,6 +4352,36 @@ compileTargets { t ->
}


/******************************************************************************
* *
* OpenJFX Stubs *
* *
*****************************************************************************/

configurations {
openjfxStubs
}

if (IS_STUB_RUNTIME_OPENJFX) {
def String platform = IS_MAC ? "mac" : IS_WINDOWS ? "win" : IS_LINUX ? "linux" : ""
dependencies {
openjfxStubs "org.openjfx:javafx-media:$STUB_RUNTIME_OPENJFX:$platform@jar"
openjfxStubs "org.openjfx:javafx-web:$STUB_RUNTIME_OPENJFX:$platform@jar"
}
}

// Extract binary libraries from OpenJFX artifacts for use as stubs
task prepOpenJfxStubs(type: Copy) {
enabled = IS_STUB_RUNTIME_OPENJFX

from configurations.openjfxStubs.files.collect { zipTree(it) }
include("*.dll")
include("*.dylib")
include("*.so")
into IS_WINDOWS ? file("$openjfxStubRuntime/bin") : file("$openjfxStubRuntime/lib")
}


/******************************************************************************
* *
* Modules *
Expand Down Expand Up @@ -4915,7 +4976,7 @@ compileTargets { t ->
}
}

def buildModuleMediaTask = task("buildModuleMedia$t.capital", type: Copy, dependsOn: mediaProject.assemble) {
def buildModuleMediaTask = task("buildModuleMedia$t.capital", type: Copy, dependsOn: [mediaProject.assemble, prepOpenJfxStubs]) {
group = "Basic"
description = "copies javafx.media native libraries"

Expand Down Expand Up @@ -4952,7 +5013,7 @@ compileTargets { t ->
}
}

def buildModuleWeb = task("buildModuleWeb$t.capital", type: Copy, dependsOn: webProject.assemble) {
def buildModuleWeb = task("buildModuleWeb$t.capital", type: Copy, dependsOn: [webProject.assemble, prepOpenJfxStubs]) {
group = "Basic"
description = "copies javafx.web native libraries"

Expand Down
8 changes: 4 additions & 4 deletions build.properties
Expand Up @@ -39,7 +39,7 @@
jfx.release.suffix=-ea

# UPDATE THE FOLLOWING VALUES FOR A NEW RELEASE
jfx.release.major.version=15
jfx.release.major.version=16
jfx.release.minor.version=0
jfx.release.security.version=0
jfx.release.patch.version=0
Expand All @@ -56,8 +56,8 @@ jfx.release.patch.version=0

javadoc.bottom=<small><a href="http://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> Copyright &copy; 2008, 2020, Oracle and/or its affiliates. All rights reserved.</small>

javadoc.title=JavaFX 15
javadoc.header=JavaFX&nbsp;15
javadoc.title=JavaFX 16
javadoc.header=JavaFX&nbsp;16

##############################################################################
#
Expand Down Expand Up @@ -89,7 +89,7 @@ jfx.gradle.version.min=5.3

# Toolchains
jfx.build.linux.gcc.version=gcc9.2.0-OL6.4+1.0
jfx.build.windows.msvc.version=VS2017-15.9.16+1.0
jfx.build.windows.msvc.version=VS2019-16.5.3+1.0
jfx.build.macosx.xcode.version=Xcode10.1-MacOSX10.14+1.0

# Build tools
Expand Down

0 comments on commit b1299ba

Please sign in to comment.