JDK-8161705 : Rename directories under modules to exactly match the module names
  • Type: Bug
  • Component: javafx
  • Sub-Component: build
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-07-19
  • Updated: 2016-08-02
  • Resolved: 2016-08-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Blocks :  
Relates :  
Description
In order to be able to compile FX modules as modules (see JDK-8161704), we need to rename the directories under the modules/ directory to exactly match the module names. This is required by javac. In addition we need to move any directory under modules that isn't really a module (e.g., the "extensions" directory).

The following renaming, at a minimum, is needed:

base --> javafx.base
controls --> javafx.controls
fxml --> javafx.fxml
fxpackager --> jdk.packager
fxpackagerservices --> jdk.packager.services
graphics --> javafx.graphics
jmx --> javafx.jmx
media --> javafx.media
swing --> javafx.swing
swt --> javafx.swt
web --> javafx.web

Comments
Changeset: 90e7d4314ecd Author: ddhill Date: 2016-08-01 10:58 -0400 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/90e7d4314ecd 8161705: Rename directories under modules to exactly match the module names Reviewed-by: kcr, vadim
01-08-2016

Looks great. +1
01-08-2016

Will add the following diff: diff -r e8eeaa101710 doc-files/javafxsdk.tbom --- a/doc-files/javafxsdk.tbom Sat Jul 30 09:57:12 2016 -0400 +++ b/doc-files/javafxsdk.tbom Sat Jul 30 21:16:10 2016 -0400 @@ -5,37 +5,37 @@ </meta> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/fxpackager/src/main/resources/com/sun/javafx/tools/packager/Bundle%j.properties" + <file source="rt/modules/jdk.packager/src/main/resources/com/sun/javafx/tools/packager/Bundle%j.properties" file-type="JavaProperties"/> </file-set> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/jmx/src/main/resources/com/oracle/javafx/jmx/json/impl/JSONMessagesBundle%j.properties" + <file source="rt/modules/javafx.jmx/g/src/main/resources/com/oracle/javafx/jmx/json/impl/JSONMessagesBundle%j.properties" file-type="JavaProperties"/> </file-set> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/LinuxDebBundler%j.properties" + <file source="rt/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/linux/LinuxDebBundler%j.properties" file-type="JavaProperties"/> </file-set> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/LinuxRpmBundler%j.properties" + <file source="rt/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/linux/LinuxRpmBundler%j.properties" file-type="JavaProperties"/> </file-set> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/fxpackager/src/main/resources/com/oracle/tools/packager/mac/MacAppBundler%j.properties" + <file source="rt/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/mac/MacAppBundler%j.properties" file-type="JavaProperties"/> </file-set> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/WinExeBundler%j.properties" + <file source="rt/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/windows/WinExeBundler%j.properties" file-type="JavaProperties"/> </file-set> <file-set name="Java Property Resource Bundles" languages="Japanese +Simplified_Chinese"> - <file source="rt/modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/WinMsiBundler%j.properties" + <file source="rt/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/windows/WinMsiBundler%j.properties" file-type="JavaProperties"/> </file-set> diff -r e8eeaa101710 tools/scripts/fix_patch_9_8 --- a/tools/scripts/fix_patch_9_8 Sat Jul 30 09:57:12 2016 -0400 +++ b/tools/scripts/fix_patch_9_8 Sat Jul 30 21:16:10 2016 -0400 @@ -8,7 +8,7 @@ -e '/^\(diff \|--- \|+++ \)/s,modules/jdk.packager.services,modules/fxpackagerservices,g' \ -e '/^\(diff \|--- \|+++ \)/s,extensions/,modules/extensions/,g' \ \ - -e '/^\(diff \|--- \|+++ \)/s,modules/javafx\(.*\)/src/test/java/test,modules/\1/src/test/java/,' \ + -e '/^\(diff \|--- \|+++ \)/s,modules/javafx.\(.*\)/src/test/java/test/,modules/\1/src/test/java/,' \ \ -e '/^\(diff \|--- \|+++ \)/s,modules/javafx.\(base\|graphics\|controls\|swing\|media\|web\|fxml\|swt\|jmx\)/,modules/\1/,g'
31-07-2016

Two issues remain: 1. The following line in fix_patch_9_8 is missing a '.' after javafx so will leave a stray . in the updated pathname for tests, which will then point to the wrong path: 11 -e '/^\(diff \|--- \|+++ \)/s,modules/javafx\(.*\)/src/test/java/test,modules/\1/src/test/java/,' \ Also, as a minor point it leaves an extra '/' after removing the 'test' directory. Adding a '/' after the end of the first (old) string right after test/java/test will fix this. I believe the following is correct: -e '/^\(diff \|--- \|+++ \)/s,modules/javafx.\(.*\)/src/test/java/test/,modules/\1/src/test/java/,' \ 2. I just noticed one more tbom file that needs to be fixed: doc-files/javafxsdk.tbom Issue #2 could be fixed as a separate bug, but since you need to fix #1, it might be easier to fix the other at the same time.
30-07-2016

webrev: http://cr.openjdk.java.net/~ddhill/8161705-rt.2/ merged in the above diff and corrected the fix_patch-* scripts
30-07-2016

The above delta to remove extensions looks good (I had already tested it). After discussing with Dave and doing some testing on the scripts we have decided to go with a modified version of Dave's two scripts (they are two orders of magnitude faster than the unshuffle script, especially on Windows, plus I ran into a bug in the unshuffle script modifying part of a path incorrectly). Dave will post an updated webrev including the above delta to settings.gradle and build.gradle and the modified "fix_patch_*" scripts.
29-07-2016

added to the diff diff -r 9fec88dc9ada build.gradle --- a/build.gradle Wed Jul 27 15:39:34 2016 -0700 +++ b/build.gradle Fri Jul 29 07:18:28 2016 -0700 @@ -1785,12 +1785,6 @@ } } -project(":extensions") { - dependencies { - compile BUILD_SRC, project(":base"), project(":graphics") - } -} - project(":swing") { /* should not be built, but needed in JMX tasks.all { diff -r 9fec88dc9ada settings.gradle --- a/settings.gradle Wed Jul 27 15:39:34 2016 -0700 +++ b/settings.gradle Fri Jul 29 07:18:28 2016 -0700 @@ -23,7 +23,7 @@ * questions. */ -include "base", "graphics", "controls", "swing", "swt", "fxml", "fxpackager", "fxpackagerservices", "jmx", "web", "media", "extensions", "systemTests" +include "base", "graphics", "controls", "swing", "swt", "fxml", "fxpackager", "fxpackagerservices", "jmx", "web", "media", "systemTests" project(":base").projectDir = file("modules/javafx.base") project(":graphics").projectDir = file("modules/javafx.graphics") @@ -36,7 +36,6 @@ project(":jmx").projectDir = file("modules/javafx.jmx") project(":web").projectDir = file("modules/javafx.web") project(":media").projectDir = file("modules/javafx.media") -project(":extensions").projectDir = file("modules/extensions") project(":systemTests").projectDir = file("tests/system") def closedDir = file("../rt-closed")
29-07-2016

I'm attaching a quick hack to get JDK's script to work with this rename. Might be worth a try?
29-07-2016

I wonder if it's possible to use JDK's unshuffle_patch.sh script? I think it does similar thing and in both directions too.
29-07-2016

Three quick comments on the diff_jdk_8_9 and diff_jdk_9_8 scripts: 1) The scripts don't work with webrev patch files (which will be a common use case), which puts an extra "old/" or "new/" in the path name. 2) The scripts don't change the 'diff' line of a changeset patch (they do change the two lines following the diff). This can be confusing -- I sometimes use this line to get a list of files changed, for example. 3) The name of the diff_jdk_8_9 script is misleading. It's really "pre-reorg-9-to-post-reorg-9" the difference being that converting JDK 8 patches to JDK 9 (which I don't think we don't need/want) would fix up the test directory whereas the script you provided is intended to fix up "in flight" JDK 9 patches, so doesn't touch the patch to the unit tests. I don't know what to call it, though. Maybe "fix_patch_old_new" and "fix_patch_9_8"? Something else? At least #1 and #2 should be fixed
28-07-2016

+1. Looks good to me other than what Kevin has commented.
28-07-2016

One minor comment on the latest version. The extensions directory was moved out of modules/ until we can figure out what to do with it (good), but it still shows up in build.gradle and settings.gradle, causing an empty .jar file to be created in modules/extension/build. I recommend to remove the extensions project in settings.gradle (it shouldn't have ever been a separate project in the first place, so that needs to go away anyway), and the following lines from build.gradle: project(":extensions") { dependencies { compile BUILD_SRC, project(":base"), project(":graphics") } } If you want to file a follow-on JIRA to fix the extensions problem I'm OK with that, too, but it seems easy enough to just fix it now. All my testing looks good so far. I just need to do the final before/after artifact comparison and verify the scripts to update a patch to/from the new FX 9 directory structure.
28-07-2016

+1
28-07-2016

This is a biggie.... and is presented a bit not traditionally. In short, we need to rename modules/*/ to match the new JDK9 module names - javafx.* (with a few exceptions). For your review - a webrev of the actual changes needed in files to support this change. And... the script that will be used to 'hg mv' the hierarchies. This operation generates a HUGE diff that is not very informative for reviewers. This rename operation has been tested by myself, Kevin, Vadim, Chien and our Hudson server in test builds. webrev: http://cr.openjdk.java.net/~ddhill/8161705 rename script: http://cr.openjdk.java.net/~ddhill/8161705/module_rename
27-07-2016