summaryrefslogtreecommitdiffstats
path: root/tools/cents/forrest.cent/xbuild.xml
blob: 5c48ea6207aa1127a57ed9bcfca95df667111ea1 (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0"?>
<project default="docs" name="docs build file">
  <!-- =================================================================== -->
  <!-- Prepares the docs                                                   -->
  <!-- =================================================================== -->
  <target name="prepare-docs">

    <property name="forrest.cent.dir" value="${cents.dir}/forrest.${cent.dir.suffix}"/> 

    <!-- define filters --> 
    <filter token="skin" value="${forrest.skin.name}"/>
    

    <mkdir dir="${xlayout.build.documentation.dir}"/>
    <mkdir dir="${xlayout.build.work.dir}"/>


    <!-- make filtered copy of XML docs -->
    <copy todir="${xlayout.build.documentation.dir}" filtering="on">
      <fileset dir="${xlayout.source.documentation.dir}" casesensitive="no">
        <include name="**/*.xml"/>
      </fileset>
    </copy>

    <!-- make filtered copy of images -->
    <copy todir="${xlayout.build.documentation.dir}" filtering="off">
      <fileset dir="${xlayout.source.documentation.dir}" casesensitive="no">
        <exclude name="**/*.xml"/>
      </fileset>
    </copy>
 
     <!-- Copy Cocoon configuration and sitemap -->
    <copy todir="${xlayout.build.documentation.dir}" filtering="on">
      <fileset dir="${forrest.cent.dir}/conf"/>
    </copy>

     <!-- Copy Cocoon resources -->
    <copy todir="${xlayout.build.documentation.dir}" filtering="off">
      <fileset dir="${forrest.cent.dir}/resources"/>
    </copy>
    
     <!-- Copy xdocs -->
    <mkdir dir="${xlayout.build.documentation.dir}/content/xdocs"/>
    <copy todir="${xlayout.build.documentation.dir}/content/xdocs" filtering="on">
      <fileset dir="${xlayout.source.documentation.content.xdocs.dir}">
        <exclude name="*.htm*"/>
      </fileset>
    </copy>
    
     <!-- Copy images -->
    <mkdir dir="${xlayout.build.documentation.dir}/resources/images"/>
    <copy todir="${xlayout.build.documentation.dir}/resources/images" filtering="off">
      <fileset dir="${xlayout.source.documentation.resources.images.dir}"/>
    </copy>
               
    <!-- Setup entity catalog and entities -->
    <mkdir dir="${xlayout.build.documentation.dir}/WEB-INF/classes"/>
    <mkdir dir="${xlayout.build.documentation.dir}/WEB-INF/lib"/>
    <move todir="${xlayout.build.documentation.dir}/WEB-INF/classes">
      <fileset dir="${xlayout.build.documentation.dir}/resources/schema">
        <include name="CatalogManager.properties"/>
      </fileset>
    </move>
    
  </target>

  <!-- =================================================================== -->
  <!-- Clean generated docs dir.                                           -->
  <!-- =================================================================== -->
  <target name="cleandocs" description="* Cleans the build docs directories">
    <delete dir="${xlayout.build.documentation.dir}"/>
  </target>


  <target name="making-docs">
    <echo message="-------------------------------------------------------------"/>
    <echo message="  Building docs, please stand by ..."/>
  </target>
  
  <!-- =================================================================== -->
  <!-- The documentation system                                            -->
  <!-- =================================================================== -->
  <target name="owdocs"
          depends="prepare-docs, making-docs"
          description="* Generates the documentation">

    <java classname="org.apache.cocoon.Main" fork="true" dir="${xlayout.build.documentation.dir}" failonerror="true">
      <arg value="-c."/>
      <arg value="-d../docs"/>
      <arg value="-w../work"/>
      <arg value="-l../work/cocoon.log"/>
      <arg value="-uINFO"/>
      <arg value="index.html"/>
      <classpath>
       <fileset dir="." casesensitive="yes"> 
        <patternset>
         <include name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.jar"/>
         <include name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.zip"/>
        </patternset>
       </fileset>  
       <pathelement location="${tools.jar}"/>
       <pathelement location="${xlayout.build.documentation.dir}/WEB-INF/classes"/>
       <fileset dir="${xlayout.build.documentation.dir}/WEB-INF/lib">
         <include name="*.jar"/>
       </fileset>    
     </classpath>
    </java>

    <echo message="  ...docs generated succesfully in ./build/docs ."/>
    <echo message="-------------------------------------------------------------"/>
    
  </target>
  
  <!-- =================================================================== -->
  <!-- The documentation system                                            -->
  <!-- =================================================================== -->
  <target name="docs"
          depends="cleandocs, owdocs"
          description="Cleans docs and generates the documentation">

  </target>
    


</project>