Skip to content

Commit

Permalink
Merge pull request dita-ot#4313 from dita-ot/feature/refactor-preproc…
Browse files Browse the repository at this point in the history
…ess2-post-targets

Refactor preprocess2 post tasks to own target
  • Loading branch information
jelovirt authored Oct 27, 2023
2 parents b6de38e + aa9e19a commit 9adf871
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/main/plugins/org.dita.base/build_preprocess2_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the accompanying LICENSE file for applicable license.

<target name="preprocess2"
dita:extension="depends org.dita.dost.platform.InsertDependsAction"
description="Preprocess"
description="Map-first preprocessing"
dita:depends="{depend.preprocess.pre},
preprocess2.init,
ditaval-merge,
Expand All @@ -24,14 +24,11 @@ See the accompanying LICENSE file for applicable license.
map-clean-map,
clean-preprocess,
copy-files2,
{depend.preprocess.post}">
<dirname property="_dita.map.output.dir" file="${dita.output.dir}/${user.input.file}" />
<dirname property="_dita.map.temp.dir" file="${dita.temp.dir}/${user.input.file}" />
<property name="uplevels" value=""/>
<property name="dita.map.output.dir" location="${_dita.map.output.dir}/${uplevels}"/>
</target>
preprocess2.post,
{depend.preprocess.post}"/>

<target name="preprocess2.maps"
description="Map-first preprocessing map steps"
depends="map-reader,
map-mapref,
map-reader-profile,
Expand All @@ -42,6 +39,7 @@ See the accompanying LICENSE file for applicable license.
map-profile"/>

<target name="preprocess2.topics"
description="Map-first preprocessing topic steps"
depends="topic-reader,
topic-branch-filter,
topic-map-conref,
Expand All @@ -58,7 +56,7 @@ See the accompanying LICENSE file for applicable license.

<target name="preprocess2-topic"
dita:extension="depends org.dita.dost.platform.InsertDependsAction"
description="Preprocess topic"
description="Map-first preprocess for topic input"
dita:depends="{depend.preprocess.pre},
preprocess2.init,
ditaval-merge,
Expand All @@ -74,14 +72,10 @@ See the accompanying LICENSE file for applicable license.
clean-preprocess,
copy-files2,
{depend.preprocess.post}">
<dirname property="_dita.map.output.dir" file="${dita.output.dir}/${user.input.file}" />
<dirname property="_dita.map.temp.dir" file="${dita.temp.dir}/${user.input.file}" />
<property name="uplevels" value=""/>
<property name="dita.map.output.dir" location="${_dita.map.output.dir}/${uplevels}"/>
</target>
{depend.preprocess.post}"/>

<target name="preprocess2.init">
<target name="preprocess2.init"
description="Initialize map-first preprocessing">
<dita-ot-fail id="DOTA002F">
<condition>
<not><isset property="args.input"/></not>
Expand All @@ -102,7 +96,7 @@ See the accompanying LICENSE file for applicable license.

<echo level="info">*****************************************************************</echo>
<echo level="info">* input = ${args.input}</echo>
<echo level="info">* resources = ${args.resources}</echo>
<echo level="info" if:set="args.resources">* resources = ${args.resources}</echo>
<echo level="info">*****************************************************************</echo>

<echoxml file="${dita.temp.dir}/.job.xml">
Expand Down Expand Up @@ -139,7 +133,7 @@ See the accompanying LICENSE file for applicable license.
</target>

<target name="map-reader"
description="Generate lists, debug, and filter input map files">
description="Read input map files to temporary store">
<pipeline message="Generate maps" taskname="map-reader"
inputmap="${args.input}">
<module class="org.dita.dost.module.reader.MapReaderModule">
Expand Down Expand Up @@ -269,7 +263,7 @@ See the accompanying LICENSE file for applicable license.
</target>

<target name="topic-reader"
description="Generate file list">
description="Read topic files to temporary store">
<pipeline message="Generate topics" taskname="topic-reader"
inputmap="${args.input}">
<module class="org.dita.dost.module.reader.TopicReaderModule">
Expand Down Expand Up @@ -493,7 +487,7 @@ See the accompanying LICENSE file for applicable license.

<target name="copy-html2"
unless="preprocess.copy-html.skip"
description="Copy html files">
description="Copy html files">
<copy todir="${dita.output.dir}" failonerror="false" overwrite="true">
<ditafileset>
<excludes format="dita"/>
Expand All @@ -505,4 +499,11 @@ See the accompanying LICENSE file for applicable license.
<jobmapper/>
</copy>
</target>

<target name="preprocess2.post"
description="Preprocess post">
<dirname property="_dita.map.output.dir" file="${dita.output.dir}/${user.input.file}" />
<dirname property="_dita.map.temp.dir" file="${dita.temp.dir}/${user.input.file}" />
<property name="dita.map.output.dir" location="${_dita.map.output.dir}/${uplevels}"/>
</target>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ See the accompanying LICENSE file for applicable license.
<param name="result.rewrite-rule.class" value="${result.rewrite-rule.class}" if:set="result.rewrite-rule.class"/>
</module>
</pipeline>
<job-property dir="${dita.temp.dir}"/>
</target>

<!-- copy-files
Expand Down

0 comments on commit 9adf871

Please sign in to comment.