8177667: Langtools ant build has issues with Windows file separators jdk-9+164
authormcimadamore
Mon, 03 Apr 2017 12:40:41 +0100
changeset 5887c7f3df19667b
parent 5886 04d69a5db5e1
child 5888 77a4b2e2e5be
child 5889 f08f6a2f834c
8177667: Langtools ant build has issues with Windows file separators
Summary: Replace complex, non-portable regex logic for generating --patch-module option with a script mapper
Reviewed-by: jjg, ksrini
make/build.properties
make/build.xml
make/intellij/runConfigurations/javadoc.xml
make/intellij/runConfigurations/jshell.xml
     1.1 --- a/make/build.properties	Fri Mar 31 07:38:34 2017 -0700
     1.2 +++ b/make/build.properties	Mon Apr 03 12:40:41 2017 +0100
     1.3 @@ -56,7 +56,7 @@
     1.4  tool.javap.main.class=com.sun.tools.javap.Main
     1.5  tool.javah.main.class=com.sun.tools.javah.Main
     1.6  tool.sjavac.main.class=com.sun.tools.sjavac.Main
     1.7 -tool.jshell.main.class=jdk.internal.jshell.tool.JShellTool
     1.8 +tool.jshell.main.class=jdk.internal.jshell.tool.JShellToolProvider
     1.9  
    1.10  #test configuration:
    1.11  jtreg.tests=
     2.1 --- a/make/build.xml	Fri Mar 31 07:38:34 2017 -0700
     2.2 +++ b/make/build.xml	Mon Apr 03 12:40:41 2017 +0100
     2.3 @@ -89,16 +89,22 @@
     2.4      </pathconvert>
     2.5  
     2.6      <pathconvert property="xpatch.rest" pathsep=" --patch-module=">
     2.7 -        <regexpmapper from="/([^$/]+)$"
     2.8 -                      to='\1="${build.modules}/\1"'
     2.9 -                      handledirsep="yes"/>
    2.10 +        <scriptmapper language="javascript">
    2.11 +            fs = project.getProperty("file.separator");
    2.12 +            path = project.getProperty("build.modules");
    2.13 +            mod = source.substr(source.lastIndexOf(fs)+1);
    2.14 +            self.addMappedName(mod + "=\"" + path + fs + mod + "\"");
    2.15 +        </scriptmapper>
    2.16          <dirset dir="${src.dir}" includes="*.*"/>
    2.17      </pathconvert>
    2.18  
    2.19      <pathconvert property="xpatch.noquotes.rest" pathsep=" --patch-module=">
    2.20 -        <regexpmapper from="/([^$/]+)$"
    2.21 -                      to="\1=${build.modules}/\1"
    2.22 -                      handledirsep="yes"/>
    2.23 +        <scriptmapper language="javascript">
    2.24 +            fs = project.getProperty("file.separator");
    2.25 +            path = project.getProperty("build.modules");
    2.26 +            mod = source.substr(source.lastIndexOf(fs)+1);
    2.27 +            self.addMappedName(mod + "=" + path + fs + mod);
    2.28 +        </scriptmapper>
    2.29          <dirset dir="${src.dir}" includes="*.*"/>
    2.30      </pathconvert>
    2.31  
    2.32 @@ -341,7 +347,7 @@
    2.33              <attribute name="agentvm" default="true"/>
    2.34              <attribute name="verbose" default="${default.jtreg.verbose}"/>
    2.35              <attribute name="options" default="${other.jtreg.options}"/>
    2.36 -            <attribute name="keywords" default="-keywords:!ignore"/>
    2.37 +            <attribute name="ignore" default="-keywords:!ignore -exclude:${test.dir}/ProblemList.txt"/>
    2.38              <attribute name="jpda.jvmargs" default=""/>
    2.39              <attribute name="extra.jvmargs" default=""/>
    2.40              <attribute name="build.modules" default="${build.modules}"/>
    2.41 @@ -360,7 +366,7 @@
    2.42                      failonerror="false" resultproperty="jtreg.@{name}.result"
    2.43                      vmoptions="${coverage.options} @{extra.jvmargs} ${xpatch.noquotes.cmd}">
    2.44                      <arg value="-debug:@{jpda.jvmargs}"/>
    2.45 -                    <arg line="@{keywords}"/>
    2.46 +                    <arg line="@{ignore}"/>
    2.47                      <arg line="@{options}"/>
    2.48                      <arg line="@{tests}"/>
    2.49                  </jtreg>
     3.1 --- a/make/intellij/runConfigurations/javadoc.xml	Fri Mar 31 07:38:34 2017 -0700
     3.2 +++ b/make/intellij/runConfigurations/javadoc.xml	Mon Apr 03 12:40:41 2017 +0100
     3.3 @@ -1,8 +1,8 @@
     3.4  <component name="ProjectRunConfigurationManager">
     3.5    <configuration default="false" name="javadoc" type="Application" factoryName="Application">
     3.6      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
     3.7 -    <option name="MAIN_CLASS_NAME" value="com.sun.tools.javadoc.Main" />
     3.8 -    <option name="VM_PARAMETERS" value='@XPATCH@' />
     3.9 +    <option name="MAIN_CLASS_NAME" value="jdk.javadoc.internal.tool.Main" />
    3.10 +    <option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED' />
    3.11      <option name="PROGRAM_PARAMETERS" value="" />
    3.12      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
    3.13      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
     4.1 --- a/make/intellij/runConfigurations/jshell.xml	Fri Mar 31 07:38:34 2017 -0700
     4.2 +++ b/make/intellij/runConfigurations/jshell.xml	Mon Apr 03 12:40:41 2017 +0100
     4.3 @@ -1,7 +1,7 @@
     4.4  <component name="ProjectRunConfigurationManager">
     4.5    <configuration default="false" name="jshell" type="Application" factoryName="Application">
     4.6      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
     4.7 -    <option name="MAIN_CLASS_NAME" value="jdk.internal.jshell.tool.JShellTool" />
     4.8 +    <option name="MAIN_CLASS_NAME" value="jdk.internal.jshell.tool.JShellToolProvider" />
     4.9      <option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED' />
    4.10      <option name="PROGRAM_PARAMETERS" value="" />
    4.11      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />