Skip to content

Commit

Permalink
Merge branch 'master' into new_ime
Browse files Browse the repository at this point in the history
  • Loading branch information
tsayao committed Sep 3, 2023
2 parents fb55d36 + 84aad81 commit 353bcfa
Show file tree
Hide file tree
Showing 6,408 changed files with 265,235 additions and 171,384 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
[general]
project=openjfx
jbs=jdk
version=jfx21
version=jfx22

[repository]
tags=(jdk-){0,1}([1-9]([0-9]*)(\.(0|[1-9][0-9]*)){0,3})(\+(([0-9]+))|(-ga))|[1-9]((\.\d{1,3}){0,2})-((b\d{2,3})|(ga))|[1-9]u(\d{1,3})-((b\d{2,3})|(ga))
Expand Down
150 changes: 118 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,20 @@
*/
defaultTasks = ["sdk"]

import java.nio.file.Files
import java.nio.file.StandardCopyOption
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoUnit
import java.util.concurrent.CountDownLatch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.Future
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import java.util.zip.ZipOutputStream

/******************************************************************************
* Utility methods *
Expand Down Expand Up @@ -256,6 +266,50 @@ void fail(String msg) {
throw new GradleException("FAIL: " + msg);
}

/**
* Rewrites the ZIP or JAR archive, setting the timestamp of each entry to
* the local date and time in UTC of the instant provided.
*
* Note that using the method 'eachFile(Closure)' of the Zip Task for this
* purpose fails to modify the JAR entries for META-INF and MANIFEST.MF
* because the manifest file is generated by Gradle instead of copied.
*
* Also note that the ZIP format has no notion of time zone. The UTC date
* and time can be set in optional extra fields, but only in addition to
* the local "MS-DOS date and time." To avoid depending on the time zone
* of the build machine, this method provides the local date and time in
* UTC by calling 'setTimeLocal(LocalDateTime)'.
*
* An alternative solution is to set the default time zone of the
* JVM temporarily to UTC while providing the UTC date and time with
* 'setLastModifiedTime(FileTime)'. This solution stores the precise instant
* on the time-line, but it also increases the size of the archive by adding
* an extra Extended Timestamp field for each entry.
*
* @param archive the ZIP or JAR archive file to rewrite
* @param instant the instant for the timestamp of each entry
*/
void setFileTimestamps(Provider<RegularFile> archive, Instant instant) {
def dosTime = LocalDateTime.ofInstant(instant, ZoneOffset.UTC)
def oldFile = archive.get().getAsFile()
def zipFile = new ZipFile(oldFile)
def newName = oldFile.getName() + ".new"
def newFile = new File(oldFile.getParentFile(), newName)
def output = new ZipOutputStream(new FileOutputStream(newFile))
zipFile.entries().each { ZipEntry entry ->
def clone = new ZipEntry(entry)
def input = zipFile.getInputStream(entry)
clone.setTimeLocal(dosTime)
output.putNextEntry(clone)
input.transferTo(output)
output.closeEntry()
input.close()
}
output.close()
zipFile.close()
Files.move(newFile.toPath(), oldFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
}

/******************************************************************************
* *
* Definition of project properties *
Expand Down Expand Up @@ -301,6 +355,7 @@ ext.ARCH_NAME = "x64"
ext.IS_64 = OS_ARCH.toLowerCase().contains("64")
ext.IS_AARCH64 = OS_ARCH.toLowerCase().contains("aarch64")
ext.IS_LOONGARCH64 = OS_ARCH.toLowerCase().contains("loongarch64")
ext.IS_RISCV64 = OS_ARCH.toLowerCase().contains("riscv64")
ext.IS_MAC = OS_NAME.contains("mac") || OS_NAME.contains("darwin")
ext.IS_WINDOWS = OS_NAME.contains("windows")
ext.IS_LINUX = OS_NAME.contains("linux")
Expand All @@ -312,19 +367,21 @@ ext.MAVEN_GROUP_ID = "org.openjfx"
// some changes on assumptions on what should be built (like SWT / Swing) and
// such and we could probably make it work.
if (!IS_MAC && !IS_WINDOWS && !IS_LINUX) fail("Unsupported build OS ${OS_NAME}")
if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64") {
fail("Unknown and unsupported build architecture: $OS_ARCH")
if (IS_WINDOWS && OS_ARCH != "x86" && OS_ARCH != "amd64" && !IS_AARCH64) {
logger.warn("Unknown and unsupported build architecture: $OS_ARCH")
} else if (IS_MAC && OS_ARCH != "x86_64" && OS_ARCH != "aarch64") {
fail("Unknown and unsupported build architecture: $OS_ARCH")
} else if (IS_LINUX && OS_ARCH != "i386" && OS_ARCH != "amd64" && !IS_AARCH64 && !IS_LOONGARCH64) {
fail("Unknown and unsupported build architecture: $OS_ARCH")
logger.warn("Unknown and unsupported build architecture: $OS_ARCH")
} else if (IS_LINUX && OS_ARCH != "i386" && OS_ARCH != "amd64" && !IS_AARCH64 && !IS_LOONGARCH64 && !IS_RISCV64) {
logger.warn("Unknown and unsupported build architecture: $OS_ARCH")
}

if (IS_64) {
if (IS_AARCH64) {
ARCH_NAME = "aarch64"
} else if (IS_LOONGARCH64) {
ARCH_NAME = "loongarch64"
} else if (IS_RISCV64) {
ARCH_NAME = "riscv64"
} else {
ARCH_NAME = "x64"
}
Expand Down Expand Up @@ -575,14 +632,25 @@ if (jfxReleasePatchVersion == "0") {
defineProperty("RELEASE_VERSION", relVer)
defineProperty("RELEASE_VERSION_PADDED", "${jfxReleaseMajorVersion}.${jfxReleaseMinorVersion}.${jfxReleaseSecurityVersion}.${jfxReleasePatchVersion}")

def buildDate = new java.util.Date()
def buildTimestamp = new java.text.SimpleDateFormat("yyyy-MM-dd-HHmmss").format(buildDate)
def buildInstant = Instant.now().truncatedTo(ChronoUnit.SECONDS)
def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH")
if (sourceDateEpoch != null) {
def epochSeconds = Long.parseLong(sourceDateEpoch)
buildInstant = Instant.ofEpochSecond(epochSeconds)
}
// Creates the timestamp in UTC using the ISO 8601 extended format
def buildTimestamp = buildInstant.toString()
defineProperty("BUILD_TIMESTAMP", buildTimestamp)
def relSuffix = ""
def relOpt = ""
if (HUDSON_JOB_NAME == "not_hudson") {
// The version OPT field matches the regular expression "([-a-zA-Z0-9.]+)".
// For the ISO 8601 basic format, use the pattern "yyyyMMdd'T'HHmmssX".
def zonedTime = ZonedDateTime.ofInstant(buildInstant, ZoneOffset.UTC)
def formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd-HHmmss")
String versionTimestamp = zonedTime.format(formatter)
relSuffix = "-internal"
relOpt = "-${buildTimestamp}"
relOpt = "-${versionTimestamp}"
} else {
relSuffix = IS_MILESTONE_FCS ? "" : jfxReleaseSuffix
}
Expand Down Expand Up @@ -1389,6 +1457,7 @@ logger.quiet("HUDSON_JOB_NAME: $HUDSON_JOB_NAME")
logger.quiet("HUDSON_BUILD_NUMBER: $HUDSON_BUILD_NUMBER")
logger.quiet("PROMOTED_BUILD_NUMBER: $PROMOTED_BUILD_NUMBER")
logger.quiet("PRODUCT_NAME: $PRODUCT_NAME")
logger.quiet("BUILD_TIMESTAMP: $BUILD_TIMESTAMP")
logger.quiet("RELEASE_VERSION: $RELEASE_VERSION")
logger.quiet("RELEASE_SUFFIX: $RELEASE_SUFFIX")
logger.quiet("RELEASE_VERSION_SHORT: $RELEASE_VERSION_SHORT")
Expand Down Expand Up @@ -3593,6 +3662,11 @@ project(":web") {
if (t.name == "win") {
// To enable ninja build on Windows
environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
// Adds compiler and linker flags if present
def cFlags = webkitProperties.ccFlags?.join(' ') ?: ''
def lFlags = webkitProperties.linkFlags?.join(' ') ?: ''
cmakeArgs = "$cmakeArgs -DCMAKE_C_FLAGS='${cFlags}' -DCMAKE_CXX_FLAGS='${cFlags}'"
cmakeArgs = "$cmakeArgs -DCMAKE_SHARED_LINKER_FLAGS='${lFlags}'"
} else if (t.name == "mac") {
cmakeArgs = " $cmakeArgs -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_MIN_VERSION -DCMAKE_OSX_SYSROOT=$MACOSX_SDK_PATH"
} else if (t.name == "linux") {
Expand All @@ -3602,6 +3676,8 @@ project(":web") {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=aarch64"
} else if (IS_LOONGARCH64) {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=loongarch64"
} else if (IS_RISCV64) {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=riscv64"
} else {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=x86_64"
}
Expand Down Expand Up @@ -4001,6 +4077,17 @@ allprojects {
}
} // tasks with javaCompile

// Normalizes the ZIP and JAR archives
tasks.withType(Zip) {
if (sourceDateEpoch != null) {
preserveFileTimestamps = false
reproducibleFileOrder = true
doLast {
setFileTimestamps(archiveFile, buildInstant)
}
}
}

// If I am a module....
if (project.hasProperty('moduleSourcePath') &&
(project.hasProperty('buildModule') && project.buildModule)) {
Expand Down Expand Up @@ -4169,6 +4256,11 @@ task javadoc(type: Javadoc, dependsOn: createMSPfile) {
options.tags("factory")
options.tags("see")

options.addStringOption("-since").setValue((9..jfxReleaseMajorVersion.toInteger()).join(","))
options.addStringOption("-since-label").setValue("New API since JavaFX 9")
options.addStringOption("Xmaxwarns").setValue("1000")
options.addStringOption("Xmaxerrs").setValue("1000")

options.windowTitle("${javadocTitle}")
options.header("${javadocHeader}")
options.bottom("${javadocBottom}")
Expand Down Expand Up @@ -4346,21 +4438,9 @@ compileTargets { t ->
)
}

// FIXME: do we really need the index task for this modular jar?
def javafxSwtIndexTask = task("javafxSwtIndex$t.capital") {
//the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
dependsOn(javafxSwtTask)

doLast() {
def destDir = javafxSwtTask.destinationDirectory.get()
def afName = javafxSwtTask.archiveFileName.get()
ant.jar (update: true, index: true, destfile: "${destDir}/${afName}")
}
}

def sdkTask = task("sdk$t.capital") {
group = "Basic"
dependsOn(javafxSwtIndexTask)
dependsOn(javafxSwtTask)
}

sdk.dependsOn(sdkTask)
Expand Down Expand Up @@ -4507,16 +4587,17 @@ compileTargets { t ->
}
zips.dependsOn(zipsTask)

// Use native zip tool so that file permissions are preserved on Windows
def zipSdkTask = task("zipSdk$t.capital", dependsOn: publicExportsTask) {
doLast {
def outZipFile = "${bundlesDir}/${sdkBundleName}.zip"
mkdir bundlesDir
exec {
workingDir(artifactsDir)
commandLine("zip", "-q", "-r", outZipFile, sdkBundleName)
}
def zipSdkTask = task("zipSdk$t.capital", type: Zip, dependsOn: publicExportsTask) {
destinationDirectory = file("${bundlesDir}")
archiveFileName = "${sdkBundleName}.zip"
includeEmptyDirs = false
// Sets directory and file permissions in archive for Windows
if (IS_WINDOWS && IS_USE_CYGWIN) {
dirMode = 0755
fileMode = 0755
}
from sdkArtifactsDir
into "${sdkBundleName}"
}
zipsTask.dependsOn(zipSdkTask)

Expand Down Expand Up @@ -5338,8 +5419,8 @@ compileTargets { t ->
dependsOn(buildModuleGraphicsTask) // we copy to the graphics module

if (COMPILE_SWT) {
def javafxSwtIndexTask = tasks.getByName("javafxSwtIndex${t.capital}");
dependsOn(javafxSwtIndexTask)
def javafxSwtTask = tasks.getByName("javafxSwt$t.capital");
dependsOn(javafxSwtTask)
//enabled = COMPILE_SWT
}

Expand Down Expand Up @@ -5550,6 +5631,11 @@ compileTargets { t ->
}
args("--legal-notices")
args(srcLegalDir)
// https://bugs.openjdk.org/browse/JDK-8278766
def status = compareJdkVersion(jdkVersion, "19")
if (sourceDateEpoch != null && status >= 0) {
args("--date", buildTimestamp)
}
args(jmodFile)
}
}
Expand Down
6 changes: 3 additions & 3 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
jfx.release.suffix=-ea

# UPDATE THE FOLLOWING VALUES FOR A NEW RELEASE
jfx.release.major.version=21
jfx.release.major.version=22
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, 2023, Oracle and/or its affiliates. All rights reserved.</small>

javadoc.title=JavaFX 21
javadoc.header=JavaFX&nbsp;21
javadoc.title=JavaFX 22
javadoc.header=JavaFX&nbsp;22

##############################################################################
#
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/linux.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def commonFlags = [
"-fstack-protector",
"-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses", "-Werror=trampolines"] // warning flags

if (!IS_64) {
if (OS_ARCH == "i386") {
commonFlags += "-m32"
}

Expand Down
6 changes: 4 additions & 2 deletions buildSrc/mac.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ MAC.glass.javahInclude = [
"com/sun/glass/events/**",
"com/sun/glass/ui/*",
"com/sun/glass/ui/mac/*"]
MAC.glass.nativeSource = file("${project("graphics").projectDir}/src/main/native-glass/mac")
MAC.glass.nativeSource = [file("${project("graphics").projectDir}/src/main/native-glass/mac"),
file("${project("graphics").projectDir}/src/main/native-glass/mac/a11y")]
MAC.glass.compiler = compiler
MAC.glass.ccFlags = [ccFlags,
"-DGL_SILENCE_DEPRECATION",
"-DMACOS_MIN_VERSION_MAJOR=$macOSMinVersionMajor",
"-DMACOS_MIN_VERSION_MINOR=$macOSMinVersionMinor"].flatten()
MAC.glass.linker = linker
Expand Down Expand Up @@ -237,7 +239,7 @@ MAC.prismES2.nativeSource = [
file("${project("graphics").projectDir}/src/main/native-prism-es2/macosx")
]
MAC.prismES2.compiler = compiler
MAC.prismES2.ccFlags = ["-DMACOSX", ccFlags].flatten()
MAC.prismES2.ccFlags = ["-DGL_SILENCE_DEPRECATION", "-DMACOSX", ccFlags].flatten()
MAC.prismES2.linker = linker
MAC.prismES2.linkFlags = [linkFlags].flatten()
MAC.prismES2.lib = "prism_es2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LinkTask extends DefaultTask {
args("$lib");
}
// Exclude parfait files (.bc)
args(objectDir.listFiles().findAll{ !it.getAbsolutePath().endsWith(".bc") });
args(objectDir.listFiles().sort().findAll{ !it.getAbsolutePath().endsWith(".bc") });
if (project.IS_WINDOWS) {
args("/out:$lib");
} else {
Expand Down
12 changes: 12 additions & 0 deletions buildSrc/win.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ if (winVsVer >= 120) {
if (IS_DEBUG_NATIVE) ccDebugFlags += "/FS"
}

// Enables reproducible builds when defined
def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH")

// Common set of flags for all modules
def ccFlags = ["/nologo", "/W3", "/EHsc", "/c",
Expand All @@ -123,13 +125,19 @@ def ccFlags = ["/nologo", "/W3", "/EHsc", "/c",
"/I$JDK_HOME/include", "/I$JDK_HOME/include/win32",
ccDebugFlags].flatten();
if (IS_STATIC_BUILD) ccFlags.add("/DSTATIC_BUILD")
if (sourceDateEpoch != null) {
ccFlags.add("/experimental:deterministic")
}

def linkFlags = ["/nologo"]
if (!IS_STATIC_BUILD) {
linkFlags += ["/dll", "/manifest", "/opt:REF", "/incremental:no", "/dynamicbase", "/nxcompat"]
}
if (!IS_64) linkFlags.add("/safeseh");
if (IS_DEBUG_NATIVE) linkFlags.add("/debug");
if (sourceDateEpoch != null) {
linkFlags.add("/experimental:deterministic")
}

// Remove C++ static linking if not on VS2010
if (WINDOWS_VS_VER != "100") {
Expand Down Expand Up @@ -461,6 +469,10 @@ WIN.webkit.compiler = compiler
WIN.webkit.linker = linker
WIN.webkit.rcCompiler = rcCompiler
WIN.webkit.rcSource = defaultRcSource
if (sourceDateEpoch != null) {
WIN.webkit.ccFlags = ["/experimental:deterministic"].flatten()
WIN.webkit.linkFlags = ["/experimental:deterministic"].flatten()
}
WIN.webkit.rcFlags = ["/d", "JFX_FNAME=jfxwebkit.dll", "/d", "JFX_INTERNAL_NAME=webkit", rcFlags].flatten();

String getWinArch(String arch) {
Expand Down
5 changes: 5 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<sha256 value="ff48e1c05fd5e3701b53fc9ac59a2745d61daf1484d9aa24dc2f79a74e381cf8" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="" name="org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512" version="">
<artifact name="org.eclipse.swt.gtk.linux.x86_3.105.3.v20170228-0512-.jar">
<sha256 value="3011a9779c3f4fc4568b621f65cfbd5f3722d0cb4dcd28bb5be2ff3441046fc9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="" name="org.eclipse.swt.gtk.linux.x86_64_3.105.3.v20170228-0512" version="">
<artifact name="org.eclipse.swt.gtk.linux.x86_64_3.105.3.v20170228-0512-.jar">
<sha256 value="a963351d5f7b82b890c4994e158d80555dae38b00af3b8d73f3875c21ff398bc" origin="Generated by Gradle"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, 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
Loading

0 comments on commit 353bcfa

Please sign in to comment.