Use proper module-name without "poi-" prefix when compiling module-java with Java 9+

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1889840 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2021-05-13 12:11:38 +00:00
parent 41ff8bb20c
commit f3e670c1eb
1 changed files with 20 additions and 4 deletions

View File

@ -1059,14 +1059,22 @@ under the License.
</classpath>
</javac>
<!-- compile jigsaw files to sources, so we don't forget to update/provide them for Java 8 builds -->
<local name="module-name"/>
<loadresource property="module-name">
<string>@{module}</string>
<filterchain>
<replacestring from="poi-" to=""/>
</filterchain>
</loadresource>
<!-- compile jigsaw files to sources, so we don't forget to update/provide them for Java 8 builds -->
<javac release="9"
srcdir="${basedir}/@{module}/src/main/java9"
destdir="${basedir}/@{module}/src/main/java9"
includeantruntime="false"
fork="true"
unless:true="${isJava8}">
<compilerarg line="--patch-module org.apache.poi.@{module}=@{classes}"/>
<compilerarg line="--patch-module org.apache.poi.${module-name}=@{classes}"/>
<modulepath>
<lib/>
</modulepath>
@ -1125,7 +1133,7 @@ under the License.
includeantruntime="false"
fork="true"
unless:true="${isJava8}" unless:blank="@{test}">
<compilerarg line="--patch-module org.apache.poi.@{module}=${merged}"/>
<compilerarg line="--patch-module org.apache.poi.${module-name}=${merged}"/>
<modulepath>
<lib/>
</modulepath>
@ -2185,6 +2193,14 @@ under the License.
<mkdir dir="@{src}/META-INF/versions/9"/>
<local name="module-name"/>
<loadresource property="module-name">
<string>@{module}</string>
<filterchain>
<replacestring from="poi-" to=""/>
</filterchain>
</loadresource>
<javac release="9"
srcdir="${basedir}/@{module}/src/main/java9"
destdir="@{src}/META-INF/versions/9"
@ -2192,7 +2208,7 @@ under the License.
fork="true"
modulepath="${main.lib}"
unless:true="${isJava8}">
<compilerarg line="--patch-module org.apache.poi.@{module}=@{src}"/>
<compilerarg line="--patch-module org.apache.poi.${module-name}=@{src}"/>
<elements/>
</javac>