Skip to content

Commit

Permalink
Merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
arapte committed Jul 28, 2020
2 parents c2beb0d + a46b250 commit f0c94d6
Show file tree
Hide file tree
Showing 5,830 changed files with 266,050 additions and 193,248 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).
101 changes: 77 additions & 24 deletions build.gradle
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, 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
Expand Down Expand Up @@ -1249,9 +1249,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 +1266,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 @@ -1424,7 +1432,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 @@ -2566,8 +2574,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 +2880,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 +3391,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 +3445,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 +3464,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 +3593,7 @@ project(":systemTests") {
testapp5
testapp6
testscriptapp1
testscriptapp2
}

def nonModSrcSets = [
Expand All @@ -3585,7 +3607,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 +3708,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 +4344,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 +4968,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 +5005,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
12 changes: 6 additions & 6 deletions build.properties
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2020, 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
Expand Down 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 @@ -88,8 +88,8 @@ jfx.gradle.version=6.3
jfx.gradle.version.min=5.3

# Toolchains
jfx.build.linux.gcc.version=gcc8.3.0-OL6.4+1.0
jfx.build.windows.msvc.version=VS2017-15.9.16+1.0
jfx.build.linux.gcc.version=gcc9.2.0-OL6.4+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 f0c94d6

Please sign in to comment.