Skip to content

Commit

Permalink
Merge pull request w3c#14 from ndw/mfix
Browse files Browse the repository at this point in the history
Refactor build scripts to avoid out-of-memory errors
  • Loading branch information
ndw authored Dec 7, 2020
2 parents b5f7152 + 431cb46 commit 6789632
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
working_directory: ~/repo

environment:
JVM_OPTS: -Xmx3200m
JVM_OPTS: -Xmx16g -XX:MetaspaceSize=4g -XX:MaxMetaspaceSize=8g
TERM: dumb

steps:
Expand Down
25 changes: 25 additions & 0 deletions etc/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@

<target name="anchor-summary" depends="specinit, chk.anchor-summary, -style-spec, -copy-xml"
if="run.anchor-summary">

<java fork="true" classname="net.sf.saxon.Transform">
<classpath refid="saxon9.classpath"/>
<jvmarg value="-Xmx16g"/>
<jvmarg value="-XX:MetaspaceSize=4g"/>
<jvmarg value="-XX:MaxMetaspaceSize=8g"/>
<arg value="${dist.dir}/${shortname}.xml"/>
<arg value="-s:${shared.style.dir}/extract.xsl"/>
<arg value="-o:${etc.dir}/${spec.code}.xml"/>
<arg value="specdoc=${spec.code}"/>
<arg value="uri=${spec.uri}"/>
</java>
<!--
<xslt in="${dist.dir}/${shortname}.xml" out="${etc.dir}/${spec.code}.xml"
style="${shared.style.dir}/extract.xsl" force="yes" classpathref="saxon9.classpath">
<factory name="net.sf.saxon.TransformerFactoryImpl">
Expand All @@ -101,6 +114,7 @@
<param name="specdoc" expression="${spec.code}"/>
<param name="uri" expression="${spec.uri}"/>
</xslt>
-->
</target>

<!-- ======================================================================== -->
Expand Down Expand Up @@ -155,13 +169,24 @@
if="build.spec" unless="spec.exists">
<echo message="Copying XML for ${shortname}..."/>

<java fork="true" classname="net.sf.saxon.Transform">
<classpath refid="saxon9.classpath"/>
<jvmarg value="-Xmx16g"/>
<jvmarg value="-XX:MetaspaceSize=4g"/>
<jvmarg value="-XX:MaxMetaspaceSize=8g"/>
<arg value="${spec.xml}"/>
<arg value="-s:${shared.style.dir}/identity.xsl"/>
<arg value="-o:${dist.dir}/${shortname}.xml"/>
</java>
<!--
<xslt in="${spec.xml}" out="${dist.dir}/${shortname}.xml"
style="${shared.style.dir}/identity.xsl" force="yes"
classpathref="saxon9.classpath">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/generateByteCode" value="false"/>
</factory>
</xslt>
-->
</target>

<!-- ======================================================================== -->
Expand Down
69 changes: 56 additions & 13 deletions specifications/xslt-40/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,15 @@
highlight.output - the output HTML5 file -->

<target name="highlighter">
<xslt
in="${highlight.input}"
out="${highlight.output}"
style="style/highlighter.xsl"
force="yes"
classpathref="saxon9.classpath"/>
<java fork="true" classname="net.sf.saxon.Transform">
<classpath refid="saxon9.classpath"/>
<jvmarg value="-Xmx16g"/>
<jvmarg value="-XX:MetaspaceSize=4g"/>
<jvmarg value="-XX:MaxMetaspaceSize=8g"/>
<arg value="${highlight.input}"/>
<arg value="-s:style/highlighter.xsl"/>
<arg value="-o:${highlight.output}"/>
</java>
</target>


Expand Down Expand Up @@ -176,9 +179,9 @@
<param name="show.diff.markup.string" expression="0"/>
<xmlcatalog refid="common"/>
</xslt>

</target>

<target name="diagrams" description="Process all the diagrams in the img directory"
depends="dot-files">
<!-- This used to use foreach to iterate over all the dot files -->
Expand Down Expand Up @@ -267,7 +270,24 @@

<target name="style-diff-spec" depends="specinit,validate-spec, function-streamability-rules">
<echo message="Building XSLT 4.0 (Diff) with baseline=${baseline} ..." />


<java fork="true" classname="net.sf.saxon.Transform">
<classpath refid="saxon9.classpath"/>
<jvmarg value="-Xmx16g"/>
<jvmarg value="-XX:MetaspaceSize=4g"/>
<jvmarg value="-XX:MaxMetaspaceSize=8g"/>
<arg value="${merged-spec.xml}"/>
<arg value="-s:style/xslt-diff.xsl"/>
<arg value="-o:${build.dir}/rendered-diff.xml"/>
<arg value="baseline=${baseline}"/>
<arg value="diff.baseline.date.string=${baseline-date}"/>
<arg value="specdoc=XT"/>
<arg value="date=${pubdate}"/>
<arg value="use-local-css=${use.local.css}"/>
<arg value="back.to.top.link=1"/>
</java>

<!--
<xslt in="${merged-spec.xml}" out="${build.dir}/rendered-diff.xml" style="style/xslt-diff.xsl"
force="yes" classpathref="saxon9.classpath">
<param name="baseline" expression="${baseline}"/>
Expand All @@ -277,9 +297,21 @@
<param name="use-local-css" expression="${use.local.css}"/>
<param name="back.to.top.link" expression="1"/>
</xslt>
-->

<java fork="true" classname="net.sf.saxon.Transform">
<classpath refid="saxon9.classpath"/>
<jvmarg value="-Xmx16g"/>
<jvmarg value="-XX:MetaspaceSize=4g"/>
<jvmarg value="-XX:MaxMetaspaceSize=8g"/>
<arg value="${build.dir}/rendered-diff.xml"/>
<arg value="-s:style/xsltdiff-cleanup.xsl"/>
<arg value="-o:${build.dir}/cleaned-up-diff.xml"/>
</java>
<!--
<xslt in="${build.dir}/rendered-diff.xml" out="${build.dir}/cleaned-up-diff.xml" style="style/xsltdiff-cleanup.xsl"
force="yes" classpathref="saxon9.classpath"/>
-->

<echo message="Highlighting XSLT 4.0 diff ..." />

Expand All @@ -298,16 +330,27 @@
</target>

<!-- Overrides internal template -->
<target name="-style-errata" depends="specinit,chk.errata"
<target name="XXX-style-errata" depends="specinit,chk.errata"
if="build.errata" unless="errata.exists">
<echo message="Formating ${shortname} errata..." />

<xslt in="${errata.xml}" out="${dist.dir}/errata.html" style="${spec.style}"
force="yes" classpathref="saxon9.classpath"/>
</target>




<target name="-style-errata" depends="specinit,chk.errata"
if="build.errata" unless="errata.exists">
<echo message="Formating ${shortname} errata with java..." />
<java fork="true" classname="net.sf.saxon.Transform">
<classpath refid="saxon9.classpath"/>
<jvmarg value="-Xmx16g"/>
<jvmarg value="-XX:MetaspaceSize=4g"/>
<jvmarg value="-XX:MaxMetaspaceSize=8g"/>
<arg value="${errata.xml}"/>
<arg value="-s:${spec.style}"/>
<arg value="-o:${dist.dir}/errata.html"/>
</java>
</target>

<!-- ======================================================================== -->

Expand Down

0 comments on commit 6789632

Please sign in to comment.