summaryrefslogtreecommitdiff
path: root/buildscripts/jGrouseDoc/build.xml
blob: 6184882054f342e486d205af85342131c7b1b1ee (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0"?>
    <!-- 
        jGrouseDoc Sample build file. 
        @Copyright (c) 2007 by Denis Riabtchik. All rights reserved. See license.txt and http://jgrouse.com for details@
        $Id: build.xml 522 2008-03-31 23:34:36Z denis.riabtchik $
    -->

<project name="jGrouseDoc Sample" basedir="." default="default" >
    <description>
            jGrouse sample file
    </description>
    <!--
    <taskdef name="jgdoc" classname="jgrouse.jgdoc.ant.JGTask" classpath="${jGrouseHome}/jgdoc.jar"></taskdef>
    <taskdef name="fastxslt" classname="jgrouse.jgdoc.ant.FastXsltTask" classpath="${jGrouseHome}/jgdoc.jar"></taskdef>
    -->

    <!-- ================================= 
          target: default              
         ================================= -->
    <target name="default" description="jGrouseDoc task" depends="setup, clean, makeProjectFile, antgen, antrun, cleanupTempFiles">
    </target>
    
    <target name="makeProjectFile" description="Extract comments from source code" depends="setup">
        <mkdir dir="${outputDir}"/>
        <jgdoc output="${outputDir}/${projectFile}" encoding="${encoding}" stopOnErrors="${stopOnErrors}" 
        	suppressGlobalWarnings="${suppressGlobalWarnings}" outputformat="${outputFormat}" srcUrl="${srcUrl}"
        	privateprefix="${privatePrefix}">
            <fileset dir="${inputDir}" includes="${fileMask}">
            </fileset>
        </jgdoc>      
    </target>
    
	<target name="antgen" depends="antgenxml, antgenvm"></target>
    
    <target name="antgenxml" depends="setup" if="isXML">
        <delete file="${outputDir}/antgen.xml"/>
        <xslt style="${jGrouseHome}/skins/${skin}/xslt/antgen.xslt" in="${outputDir}/${projectFile}" out="${outputDir}/antgen.xml">             
            <param name="jGrouseHome" expression="${jGrouseHome}"/>
            <param name="projectName" expression="${projectName}"/>
            <param name="projectDesc" expression="${projectDesc}"/>
            <param name="projectFile" expression="${projectFile}"/>
            <param name="useFullNames" expression="${useFullNames}"/>
            <param name="outDir" expression="${outputDir}"/>
            <param name="version" expression="${appVersion}"/>
            <param name="aux_css" expression="${aux_css}"/>
            <param name="skinDir" expression="${jGrouseHome}/skins/${skin}"/>
        </xslt>
    </target>
	
	<target name="antgenvm" depends="setup" if="isBIN">
        <delete file="${outputDir}/antgen.xml"/>
        <vmtask resourcePath="., ${jGrouseHome}" source="${outputDir}/${projectFile}" loglevel="INFO">
            <template templatename="skins/${skin}/vm/antgen.vm">
                <output file="${outputDir}/antgen.xml">
                    <param key="jGrouseHome" value="${jGrouseHome}"/>
                    <param key="projectName" value="${projectName}"/>
                    <param key="projectDesc" value="${projectDesc}"/>
                    <param key="projectFile" value="${projectFile}"/>
                    <param key="useFullNames" value="${useFullNames}"/>
                    <param key="outDir" value="${outputDir}"/>
                    <param key="version" value="${appVersion}"/>
                    <param key="aux_css" value="${aux_css}"/>
                    <param key="skin" value="${skin}"/>
                    <param key="skinDir" value="${jGrouseHome}/skins/${skin}"/>
                    <param key="commonSkin" value="${jGrouseHome}/skins/common"/>
                </output>
            </template>
        </vmtask>
	</target>
    
    <target name="antrun" depends="setup">
        <ant antfile="${outputDir}/antgen.xml"></ant>
        <ant antfile="${jGrouseHome}/themes/${theme}/build.xml"></ant>
    </target>
    
    <target name="cleanupTempFiles" depends="setup">
        <delete file="${outputDir}/antgen.xml"/>
        <delete file="${outputDir}/${projectFile}"/>
    </target>
    
    <target name="clean" depends="setup">
          <delete dir="${outputDir}"></delete>
    </target>
    
    <target name="setup">
        <condition property="configFile" value="jgrousedoc.properties">
            <not><isset property="configFile"/></not>
        </condition>
        <property file="${configFile}"/>
        <fail message="jGrouseHome home not defined">
            <condition>
               <and>
                 <not><isset property="jGrouseHome"/></not>
                 <not><isset property="jGrouseHome.default"/></not>
               </and>
             </condition>
        </fail>
        <condition property="jGrouseHome" value="${jGrouseHome.default}">
            <not><isset property="jGrouseHome"/></not>
        </condition>
        <condition property="jgdocTask" value="${jGrouseHome}/jgdoc.jar">
            <not><isset property="jgdocTask"/></not>
        </condition>
        <taskdef name="jgdoc" classname="jgrouse.jgdoc.ant.JGTask" classpath="${jgdocTask}"></taskdef>
        <taskdef name="fastxslt" classname="jgrouse.jgdoc.ant.FastXsltTask" classpath="${jgdocTask}"></taskdef>
        
        <condition property="inputDir" value="${inputDir.default}">
            <isset property="inputDir.default"/>
        </condition>
        <condition property="inputDir" value="source">
            <not><isset property="inputDir"/></not>
        </condition>
        <condition property="fileMask" value="${fileMask.default}">
            <isset property="fileMask.default"/>
        </condition>
        <condition property="fileMask" value="**/*.js">
              <not><isset property="fileMask"/></not>
        </condition>
        
        <condition property="outputDir" value="${outputDir.default}">
            <isset property="outputDir.default"/>
        </condition>
        <condition property="outputDir" value="api">
              <not><isset property="outputDir"/></not>
        </condition>
        
        <condition property="skin" value="noframes">
              <not><isset property="skin"/></not>
        </condition>
        <condition property="theme" value="sample">
              <not><isset property="theme"/></not>
        </condition>
        <condition property="projectFile" value="jgrouse.jgd">
            <not><isset property="projectFile"/></not>
        </condition>
        <condition property="projectName" value="Project name not specified">
            <not><isset property="projectName"/></not>
        </condition>
        <condition property="appVersion" value="Version not specified">
            <not><isset property="appVersion"/></not>
        </condition>
        <condition property="projectDesc" value="Project Description not specified">
            <not><isset property="projectDesc"/></not>
        </condition>
        <condition property="stopOnErrors" value="false">
            <not><isset property="stopOnErrors"/></not>
        </condition>
        <condition property="srcUrl" value="not_defined">
            <not><isset property="srcUrl"/></not>
        </condition>
        <condition property="privatePrefix" value="not_defined">
            <not><isset property="privatePrefix"/></not>
        </condition>
        <condition property="outputFormat" value="BIN">
            <not><isset property="outputFormat"/></not>
        </condition>
    	<condition property="isXML">
    		<equals arg1="${outputFormat}" arg2="xml" casesensitive="false" trim="true"/>
    	</condition>
        <condition property="isBIN">
            <equals arg1="${outputFormat}" arg2="bin" casesensitive="false" trim="true"/>
        </condition>
        <condition property="encoding" value="UTF-8">
            <not><isset property="encoding"/></not>
        </condition>
        <condition property="srcEncoding" value="DEFAULT">
	            <not><isset property="srcEncoding"/></not>
        </condition>
        <condition property="aux_css" value="not_specified">
	            <not><isset property="aux_css"/></not>
        </condition>
    	
    	
        <taskdef name="vmtask" classname="jgrouse.jgdoc.ant.VMTask" classpath="${jgdocTask};${jGrouseHome}/velocity-dep-1.5.jar"></taskdef>
    </target>
        

</project>