root/branches/2.2/docs/phing_guide/build.xml

Revision 1, 5.2 kB (checked in by hans, 3 years ago)

Initial checkin

Line 
1 <project name="phing_guide" default="main" basedir=".">
2
3   <!-- ================================================================ -->
4   <!-- M A I N  T A R G E T                                             -->
5   <!-- ================================================================ -->
6         <target
7                 name="main"
8                 description="==>build phing_guide">
9                
10                 <!-- <phingcall target="normalize_linebreaks"/> -->
11                 <phingcall target="remove_old_toc"/>
12                 <phingcall target="gen_standard_toc"/>
13                 <phingcall target="gen_frame_toc"/>
14                 <phingcall target="gen_chapter_js"/>
15                
16                 <!-- the next step here would be to create a PDF -->
17                      
18         </target>
19        
20         <!--
21         ##==============================================
22         ## Normalize line breaks to ensure a good
23         ## conversion
24         ##
25         ## @author  alex black, enigma@turingstudio.com
26         ## @revision $Revision: 1.6 $
27         ##==============================================       
28         -->
29         <target name="normalize_linebreaks"
30                         description="==>normalize linebreaks (make them unix)">
31                 <!-- use replaceregexp filter to handle the normalization -->
32
33                 <echo message="/----------------------------------\"/>
34                 <echo message="| NORMALIZING LINE BREAKS          |"/>
35                 <echo message="\----------------------------------/"/>
36                      
37                 <reflexive>
38                         <fileset dir=".">
39                                 <include name="**/*.html"/>
40                         </fileset>
41                         <filterchain>
42                                 <replaceregexp>
43                                         <regexp pattern="\r\n" replace="\n"/>
44                                         <regexp pattern="\r" replace="\n"/>
45                                 </replaceregexp>
46                         </filterchain>
47                 </reflexive>
48                
49         </target>
50        
51         <!--
52     ##==============================================
53         ## Kill any old ToC
54         ##
55         ## @author  alex black, enigma@turingstudio.com
56         ##==============================================       
57         -->
58         <target
59                 name="remove_old_toc"
60                 description="==> deletes the old table of contents file.">
61                        
62                 <echo message="/----------------------------------\"/>
63                 <echo message="|      REMOVING OLD TOC FILES      |"/>
64                 <echo message="\----------------------------------/"/>
65
66                 <delete file="book/toc/ToC.html"/>
67                 <delete file="book/toc/FrameToC.html"/>
68                 <delete file="book/js/Chapters.js"/>
69
70         </target>
71        
72         <!--   
73         ##==============================================
74         ## generate a standard Toc
75         ##
76         ## @author  alex black, enigma@turingstudio.com
77         ##==============================================       
78         -->
79         <target
80                 name="gen_standard_toc"
81                 description="==>generate a standard Toc">
82
83                 <echo message="/----------------------------------\"/>
84                 <echo message="| GENERATE STD TABLE OF CONTENTS   |"/>
85                 <echo message="\----------------------------------/"/>         
86                
87                 <append destFile="book/toc/ToC.html">                                   
88                         <filterchain>
89                                 <xsltfilter style="../docsystem/xsl/Toc.xsl" html="yes">
90                                         <param name="mode" expression="standard"/>
91                                         <param name="file_name" expression="%{task.append.current_file}"/>
92                                 </xsltfilter>
93                         </filterchain>
94                         <filelist dir="book/" listfile="book/PhingGuide.book"/>                 
95                 </append>
96                
97                
98                 <append file="../docsystem/html/StandardToCBottom.html" destFile="book/toc/ToC.html"/>                         
99                  
100         </target>
101        
102         <!--
103         ##==============================================
104         ## generate a frame Toc
105         ##
106         ## @author  alex black, enigma@turingstudio.com
107         ##==============================================       
108         -->
109         <target name="gen_frame_toc"
110                         description="==>generate table of contents for frame">
111                
112                 <echo message="/----------------------------------\"/>
113                 <echo message="| GENERATE FRAME TABLE OF CONTENTS |"/>
114                 <echo message="\----------------------------------/"/>
115                
116                 <append file="../docsystem/html/FrameToCTop.html" destFile="book/toc/FrameToC.html"/>
117                        
118                 <append destFile="book/toc/FrameToC.html">                                     
119                         <filterchain>
120                                 <xsltfilter style="../docsystem/xsl/Toc.xsl" html="yes">
121                                         <param name="mode" expression="frame"/>
122                                         <param name="file_name" expression="%{task.append.current_file}"/>
123                                 </xsltfilter>
124                         </filterchain>
125                         <filelist dir="book/" listfile="book/PhingGuide.book"/>                 
126                 </append>
127                                                                        
128                 <append file="../docsystem/html/FrameToCBottom.html" destFile="book/toc/FrameToC.html"/>                               
129        
130         </target>
131        
132         <!--   
133         ##==============================================
134         ## generate chapter JS array
135         ##
136         ## @author  alex black, enigma@turingstudio.com
137         ##==============================================       
138         -->
139         <target name="gen_chapter_js"
140                         description="==>generate the javascript">
141
142                 <echo message="/----------------------------------\"/>
143                 <echo message="| GENERATE CHAPTER JAVASCRIPT      |"/>
144                 <echo message="\----------------------------------/"/>
145                
146                 <append text="var Chapters = new Array(" destFile="book/js/Chapters.js"/>
147                
148                 <append destFile="book/js/Chapters.js">                                 
149                         <filterchain>
150                                 <xsltfilter style="../docsystem/xsl/Chapters.xsl" html="yes">
151                                         <param name="mode" expression="${process.xslt.mode}"/>
152                                         <param name="file_name" expression="%{task.append.current_file}"/>
153                                 </xsltfilter>
154                         </filterchain>
155                         <filelist dir="book/" listfile="book/PhingGuide.book"/>                 
156                 </append>
157                                
158                 <append text=");" destFile="book/js/Chapters.js"/>                             
159                
160                 <!-- remove the trailing ',' because the XSLT does not (and this will trigger jscript errors) -->
161                 <reflexive file="book/js/Chapters.js">
162                         <filterchain>
163                                 <replaceregexp>
164                                         <regexp pattern="\),[\s]+\);" replace="));"/>
165                                 </replaceregexp>
166                         </filterchain>
167                 </reflexive>
168                        
169         </target>
170        
171 </project>
Note: See TracBrowser for help on using the browser.