forked from deftjs/DeftJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
109 lines (88 loc) · 4.04 KB
/
build.xml
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
<project name="DeftJS" default="build">
<property file="build.properties" />
<target name="clean" description="Remove artifacts in build directory from previous builds.">
<delete dir="build" />
</target>
<target name="init" description="Initialize build directory.">
<mkdir dir="build" />
</target>
<target name="build" depends="init" description="Builds debug and deployment versions of the framework.">
<echo message="Compiling CoffeeScript..." />
<condition property="coffeeExecutable" value="coffee.cmd">
<os family="windows"/>
</condition>
<condition property="coffeeExecutable" value="coffee">
<os family="unix"/>
</condition>
<exec dir="src" executable="${coffeeExecutable}">
<arg line="-cb -o js coffee" />
</exec>
<exec dir="spec" executable="${coffeeExecutable}">
<arg line="-cb -o js coffee" />
</exec>
<echo message="Concatenating JavaScript files..." />
<concat destfile="build/${deftjs.filename.debug}" encoding="UTF-8" outputencoding="UTF-8">
<header>${deftjs.copyright.notice}</header>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="// Generated by CoffeeScript*"/>
</linecontainsregexp>
</filterchain>
<filelist dir="src/js">
<!-- NOTE: Order is important - driven by class dependencies. -->
<file name="Deft/core/Class.js" />
<file name="Deft/log/Logger.js" />
<file name="Deft/util/Function.js" />
<file name="Deft/event/LiveEventListener.js" />
<file name="Deft/event/LiveEventBus.js" />
<file name="Deft/ioc/DependencyProvider.js" />
<file name="Deft/ioc/Injector.js" />
<file name="Deft/mixin/Injectable.js" />
<file name="Deft/mvc/Observer.js" />
<file name="Deft/mvc/ComponentSelectorListener.js" />
<file name="Deft/mvc/ComponentSelector.js" />
<file name="Deft/mvc/ViewController.js" />
<file name="Deft/mvc/Application.js" />
<file name="Deft/mixin/Controllable.js" />
<file name="Deft/promise/Promise.js" />
<file name="Deft/promise/Deferred.js" />
<file name="Deft/promise/Chain.js" />
</filelist>
</concat>
<echo message="Minifying concatenated JavaScript file..." />
<condition property="yuiCompressorExecutable" value="yuicompressor.cmd">
<os family="windows"/>
</condition>
<condition property="yuiCompressorExecutable" value="yuicompressor">
<os family="unix"/>
</condition>
<exec dir="build" executable="${yuiCompressorExecutable}">
<arg line="${deftjs.filename.debug} -o ${deftjs.filename.deploy} --charset utf-8" />
</exec>
<!-- Convert EOL characters to match local OS conventions. -->
<fixcrlf srcdir="src/js" includes="**/*.js" />
<fixcrlf srcdir="build" includes="**/*.js" />
<!-- TODO: Once vetted, comment this in to trigger doc generation during build. For now, docs task can be run independently. -->
<!-- <antcall target="docs" /> -->
<echo message="Done." />
</target>
<target name="docs" description="Generates JSDuck API documentation.">
<condition property="jsDuckExecutable" value="jsduck.exe">
<os family="windows"/>
</condition>
<!-- JSDuck on *nix requires a Ruby gem to be installed. See https://github.com/senchalabs/jsduck -->
<condition property="jsDuckExecutable" value="jsduck">
<os family="unix"/>
</condition>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="./docs" />
</delete>
<!-- For some reason, deleting and re-adding the docs folder often causes a write error. A slight delay usually avoids this. -->
<sleep seconds="2"/>
<echo message="Generating API documentation..." />
<exec executable="tools/${jsDuckExecutable}" timeout="20000" failonerror="false">
<arg line='--warnings=-all --ext-namespaces=Ext --output=docs --ignore-global --title="DeftJS - API Documentation" src/js' />
<arg line='--head-html="<style type=text/css>.class-categories .section .left-column{float:left;width:350px;margin-left:20px} .class-categories .section .middle-column{float:left;width:350px} .class-categories .section .right-column{float:left;width:350px}</style>"' />
</exec>
</target>
</project>