PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/build.xml

https://bitbucket.org/renren_platform/renren-api-javascript-sdk/
XML | 89 lines | 75 code | 9 blank | 5 comment | 0 complexity | 540adcd1459b7f3ed7b6f3068cc03a7a MD5 | raw file
 1<?xml version="1.0" standalone="yes"?>
 2<project basedir="." default="consolidate.js">
 3
 4	<!--
 5		general file locations
 6	-->
 7	<property name="src_home" value="${basedir}/src" />
 8	<property name="build_home" value="${basedir}/build" />
 9	<property name="yuicompressor.jar" value="${build_home}/lib/yuicompressor-2.4.6.jar" />
10	<property name="closure-compiler.jar" value="${build_home}/lib/closure-compiler.jar" />
11
12	<property name="rr.js" value="${build_home}/js/renren.js" />
13	<property name="rr-yc.js" value="${build_home}/js/renren-yc.js" />
14	<property name="rr-gc.js" value="${build_home}/js/renren-gc.js" />
15	<property name="version" value="1.0" />
16
17	<tstamp>
18		<format property="date" pattern="yyyy-MM-dd HH:mm" />
19	</tstamp>
20
21	<!-- @start consolidate -->
22	<target name="reconsolidate.js.check">
23		<condition property="js.uptodate">
24			<uptodate targetfile="${rr.js}">
25				<srcfiles dir="${src_home}" includes="intro.js" />
26				<srcfiles dir="${src_home}" includes="outro.js" />
27				<srcfiles dir="${src_home}" includes="browser.js" />
28				<srcfiles dir="${src_home}" includes="class.js" />
29				<srcfiles dir="${src_home}" includes="dom.js" />
30				<srcfiles dir="${src_home}" includes="flash.js" />
31				<srcfiles dir="${src_home}" includes="init.js" />
32				<srcfiles dir="${src_home}" includes="request.js" />
33				<srcfiles dir="${src_home}" includes="ui.js" />
34				<srcfiles dir="${src_home}" includes="utils.js" />
35				<srcfiles dir="${src_home}" includes="xd.js" />
36				<srcfiles dir="${src_home}" includes="xdpc.js" />
37			</uptodate>
38		</condition>
39	</target>
40
41	<target name="consolidate.js" depends="reconsolidate.js.check" unless="js.uptodate">
42		<echo message="Consolidating js" />
43		<concat destfile="${rr.js}" encoding="UTF-8" fixlastline="yes">
44			<filelist dir="${src_home}">
45				<file name="intro.js" />
46				<file name="init.js" />
47				<file name="utils.js" />
48				<file name="class.js" />
49				<file name="browser.js" />
50				<file name="flash.js" />
51				<file name="dom.js" />
52				<file name="xd.js" />
53				<file name="request.js" />
54				<file name="ui.js" />
55				<file name="xdpc.js" />
56				<file name="outro.js" />
57			</filelist>
58		</concat>
59		<replaceregexp match="@VERSION" replace="${version}" flags="g" file="${rr.js}" />
60		<replaceregexp match="@DATE" replace="${date}" file="${rr.js}" />
61	</target>
62	<!-- @end consolidate -->
63
64	<target name="compress.js" depends="consolidate.js">
65		<echo message="Compressing js use YUI Compressor" />
66		<java jar="${yuicompressor.jar}" fork="true" failonerror="true" output="${rr-yc.js}">
67			<arg value="--charset" />
68			<arg value="UTF-8" />
69			<arg value="${rr.js}" />
70		</java>
71		<echo message="Compressing js use google Closure Compiler" />
72		<java jar="${closure-compiler.jar}" fork="true" failonerror="true">
73			<arg value="--js" />
74			<arg value="${rr.js}" />
75			<arg value="--js_output_file" />
76			<arg value="${rr-gc.js}" />
77		</java>
78	</target>
79
80	<target name="build.js" depends="consolidate.js, compress.js">
81	</target>
82
83	<target name="clean.js">
84		<delete file="${rr.js}" />
85		<delete file="${rr-yc.js}" />
86		<delete file="${rr-gc.js}" />
87	</target>
88
89</project>