Skip to main content
summaryrefslogtreecommitdiffstats
blob: eb4be335ed4abcb0ae2c0064fdd47fe82caefea0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="UTF-8"?>

<project
  default="default"
  basedir=".">

  <!-- 
       This file is called by the pom's "antrun" plugin. These tasks were 
       "pulled out" of using directly in the pom because it seems errors are 
       not well captured, and only thing "left" on the build system is the 
       last ant file created. (Makes me even wonder if you can call twice 
       during same phase?)
  -->

  <target
    name="preTransform"
    depends="checkExistence">
    <echoproperties />
    <fail
      unless="contentjarexists"
      message="content.jar file did not exist as expected" />
    <echo message="unzip content.jar, for xslt transform" />
    <unzip
      src="${project.build.directory}/repository/content.jar"
      dest="${project.build.directory}/repository/" />
    <echo message="backup, of originals, just to help debugging" />
    <copy
      file="${project.build.directory}/repository/content.jar"
      tofile="${project.build.directory}/backup/contentORIG.jar"
      preservelastmodified="true" />
    <copy
      file="${project.build.directory}/repository/content.xml"
      tofile="${project.build.directory}/backup/contentORIG.xml"
      preservelastmodified="true" />
  </target>
  <target name="checkExistence">
    <condition property="contentjarexists">
      <available file="${project.build.directory}/repository/content.jar" />
    </condition>
  </target>

  <target name="postTransform">
    <!-- In the pom file, are steps that do the transorm,
        xxx and copy the transformed content.xml back to "here" -->
    <delete
      file="${project.build.directory}/repository/content.jar"
      failonerror="true" />
    <zip
      destfile="${project.build.directory}/repository/content.jar"
      basedir="${project.build.directory}/generated-resources/xml/xslt"
      includes="content.xml"
      filesonly="true" />
    <!-- must delete, or will be kept in the final zipped up version. 
         Would not really hurt much ... but, be confusing 
    <delete file="${project.build.directory}/repository/content.xml" />
    -->
    <copy
      file="${project.build.directory}/repository/content.jar"
      tofile="${project.build.directory}/backup/contentORIG2.jar"
      preservelastmodified="true" />
  </target>

  <target name="default">
    <fail message="There is no default target for this antrunbuild.xml file." />
  </target>
</project>

Back to the top