forked from RobinHerbots/Inputmask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
115 lines (103 loc) · 6.68 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
110
111
112
113
114
115
<?xml version="1.0"?>
<project name="jquery.inputmask" default="build" basedir=".">
<!-- define the path of compressor in this file -->
<property file="build.properties" />
<target name="init">
<mkdir dir="${distdir}" />
</target>
<target name="updateVersions">
<replaceregexp file="nuget/jquery.inputmask.nuspec" match="<version>.*</version>" replace="<version>${build.major}.${build.minor}.${build.revision}</version>" />
<replaceregexp file="nuget/jquery.inputmask.nuspec" match="-0.0.0" replace="-${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="<version>.*</version>" replace="<version>${build.major}.${build.minor}.${build.revision}</version>" />
<replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="-0.0.0" replace="-${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.date.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.numeric.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.regex.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.phone.extensions.js" match="Version:.*" replace="Version: ${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="./jquery.inputmask.jquery.json" match=""version":.*" replace=""version": "${build.major}.${build.minor}.${build.revision}"," byline="true"/>
<replaceregexp file="./component.json" match=""version":.*" replace=""version": "${build.major}.${build.minor}.${build.revision}"," byline="true"/>
</target>
<target name="resetVersions">
<replaceregexp file="nuget/jquery.inputmask.nuspec" match="<version>.*</version>" replace="<version>0.0.0</version>" />
<replaceregexp file="nuget/jquery.inputmask.nuspec" replace="-0.0.0" match="-${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="nuget/jquery.inputmask.linux.nuspec" match="<version>.*</version>" replace="<version>0.0.0</version>" />
<replaceregexp file="nuget/jquery.inputmask.linux.nuspec" replace="-0.0.0" match="-${build.major}.${build.minor}.${build.revision}" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.js" match="Version:.*" replace="Version: 0.0.0" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.extensions.js" match="Version:.*" replace="Version: 0.0.0" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.date.extensions.js" match="Version:.*" replace="Version: 0.0.0" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.numeric.extensions.js" match="Version:.*" replace="Version: 0.0.0" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.regex.extensions.js" match="Version:.*" replace="Version: 0.0.0" byline="true"/>
<replaceregexp file="${srcdir}/jquery.inputmask.phone.extensions.js" match="Version:.*" replace="Version: 0.0.0" byline="true"/>
</target>
<target name="jquery.inputmask" depends="init, updateVersions">
<concat destfile="${distdir}/${target}">
<fileset file="${srcdir}/jquery.inputmask.js"/>
<fileset file="${srcdir}/jquery.inputmask.extensions.js"/>
<fileset file="${srcdir}/jquery.inputmask.date.extensions.js"/>
<fileset file="${srcdir}/jquery.inputmask.numeric.extensions.js"/>
<fileset file="${srcdir}/jquery.inputmask.regex.extensions.js"/>
<fileset file="${srcdir}/jquery.inputmask.phone.extensions.js"/>
</concat>
</target>
<target name="jquery.inputmask.min" depends="jquery.inputmask">
<apply executable="java" parallel="false" verbose="true" failonerror="true" dest="${distdir}">
<fileset dir="${distdir}">
<include name="${target}" />
</fileset>
<arg line="-jar" />
<arg path="${GoogleCompiler}" />
<arg value="--compilation_level" />
<arg value="SIMPLE_OPTIMIZATIONS" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<mapper type="glob" from="${target}" to="${target.min}" />
</apply>
<echo message="${target.min} built." />
</target>
<target name="minfiles">
<mkdir dir="${distdir}/min" />
<apply executable="java" parallel="false" verbose="true" failonerror="true" dest="${distdir}/min">
<fileset dir="${srcdir}">
<include name="*.js" />
</fileset>
<arg line="-jar" />
<arg path="${GoogleCompiler}" />
<arg value="--compilation_level" />
<arg value="SIMPLE_OPTIMIZATIONS" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
<mapper type="glob" from="*.js" to="*.js" />
</apply>
</target>
<target name="jquery.inputmask.nuget" depends="jquery.inputmask, jquery.inputmask.min, minfiles">
<exec executable="${NugetExe}" failonerror="true" dir="tools" vmlauncher="false" osfamily="windows" >
<arg value="pack"/>
<arg value="..\nuget\${nuspec}" />
<arg value="-OutputDirectory" />
<arg value="..\${distdir}" />
</exec>
<exec executable="mono" failonerror="false" dir="tools" vmlauncher="false" osfamily="unix" >
<arg value="--runtime=v4.0.30319"/>
<arg value="${NugetExe}"/>
<arg value="pack"/>
<arg value="../nuget/${nuspeclinux}"/>
<arg value="-BasePath"/>
<arg value="../"/>
<arg value="-OutputDirectory"/>
<arg value="../${distdir}"/>
</exec>
</target>
<target name="build" depends="jquery.inputmask, jquery.inputmask.min, minfiles, jquery.inputmask.nuget, resetVersions"/>
<target name="clean">
<delete dir="${distdir}" />
</target>
<target name="all" depends="clean,build"/>
</project>