|
1 | 1 | <project name="csslint" default="all"> |
2 | 2 |
|
| 3 | + <!-- version number --> |
| 4 | + <property name="csslint.version" value="0.2.0" /> |
| 5 | + |
3 | 6 | <!-- the directories containing the source files --> |
4 | 7 | <property name="src.dir" value="./src" /> |
5 | 8 | <property name="npm.dir" value="./npm" /> |
|
21 | 24 |
|
22 | 25 | <loadfile property="license.text" srcfile="LICENSE" /> |
23 | 26 |
|
| 27 | + <!-- get a timestamp --> |
| 28 | + <tstamp> |
| 29 | + <format property="RIGHT_NOW" |
| 30 | + pattern="d-MMMM-yyyy hh:mm:ss" |
| 31 | + locale="en,US"/> |
| 32 | + </tstamp> |
| 33 | + |
24 | 34 | <!-- clean --> |
25 | 35 | <target name="clean"> |
26 | 36 | <delete dir="${build.dir}" /> |
|
32 | 42 | <header trimleading="yes">/*! |
33 | 43 | ${license.text} |
34 | 44 | */ |
| 45 | + /* Build time: ${RIGHT_NOW} */ |
35 | 46 | var CSSLint = (function(){ |
36 | 47 | </header> |
37 | 48 | <fileset dir="${lib.dir}" includes="*.js" /> |
|
52 | 63 | <header trimleading="yes">/*! |
53 | 64 | ${license.text} |
54 | 65 | */ |
| 66 | + /* Build time: ${RIGHT_NOW} */ |
55 | 67 | </header> |
56 | 68 | <fileset dir="${lib.dir}" includes="*.js" /> |
57 | 69 | <filelist dir="${src.dir}/core" files="CSSLint.js" /> |
|
69 | 81 | <header trimleading="yes">/*! |
70 | 82 | ${license.text} |
71 | 83 | */ |
| 84 | + /* Build time: ${RIGHT_NOW} */ |
72 | 85 | </header> |
73 | 86 | <fileset dir="${lib.dir}" includes="*.js" /> |
74 | 87 | <filelist dir="${src.dir}/core" files="CSSLint.js" /> |
|
82 | 95 | <mkdir dir="${build.npm.dir}"/> |
83 | 96 | <mkdir dir="${build.npm.dir}/lib"/> |
84 | 97 | <copy file="${npm.dir}/package.json" todir="${build.npm.dir}"/> |
85 | | - <copy file="${src.dir}/node/cli.js" todir="${build.npm.dir}"/> |
| 98 | + <concat destfile="${build.npm.dir}/cli.js" fixlastline="true"> |
| 99 | + <header trimleading="yes">#!/usr/bin/env node</header> |
| 100 | + <filelist dir="${src.dir}/cli" files="util.js,node.js" /> |
| 101 | + </concat> |
86 | 102 | <copy file="${build.dir}/${node.build.file}" todir="${build.npm.dir}/lib"/> |
87 | 103 |
|
88 | 104 | </target> |
|
94 | 110 | </concat> |
95 | 111 | </target> |
96 | 112 |
|
97 | | - |
98 | 113 | <!-- build for rhino CLI integration --> |
99 | 114 | <target name="build.rhino" depends="build.core"> |
100 | 115 | <concat destfile="${build.dir}/${rhino.build.file}" fixlastline="true"> |
101 | 116 | <filelist dir="${build.dir}" files="${core.build.file}" /> |
102 | | - <filelist dir="${src.dir}/rhino" files="cli.js" /> |
| 117 | + <filelist dir="${src.dir}/cli" files="util.js,rhino.js" /> |
103 | 118 | </concat> |
104 | | - </target> |
105 | | - |
| 119 | + </target> |
106 | 120 |
|
| 121 | + <!-- Update version number in files --> |
| 122 | + <target name="release" depends="all"> |
| 123 | + <replaceregexp match="@VERSION@" replace="${csslint.version}" flags="g" byline="true"> |
| 124 | + <fileset dir="${build.dir}" includes="**/*.js"/> |
| 125 | + </replaceregexp> |
| 126 | + </target> |
107 | 127 |
|
108 | 128 | <!-- Build all files --> |
109 | 129 | <target name="all" depends="clean,build.core,build.worker,build.node,build.tests,build.rhino"/> |
|
0 commit comments