This repository has been archived by the owner on Oct 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
87 lines (68 loc) · 2.62 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
<?xml version="1.0" encoding="utf-8"?>
<project name="offenraum.de" basedir="." default="main">
<!-- props -->
<property name="htdocs.dir" value="${basedir}/htdocs"/>
<property name="build.dir" value="${htdocs.dir}/build"/>
<property name="assets.dir" value="${htdocs.dir}/assets"/>
<property name="final_css" value="${build.dir}/complete.css"/>
<!-- libraries -->
<property name="yui-compressor" location="/opt/yui/yuicompressor-2.4.7.jar"/>
<property name="yui-compressor-ant-task" location="/opt/yui/yui-compressor-ant-task-0.5.jar"/>
<!-- classpath -->
<path id="yui.classpath">
<pathelement location="${yui-compressor}"/>
<pathelement location="${yui-compressor-ant-task}"/>
</path>
<!-- task definitions -->
<taskdef name="yui-compressor" classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask">
<classpath refid="yui.classpath"/>
</taskdef>
<!-- targets -->
<target name="concat">
<mkdir dir="${build.dir}"/>
<echo message="SASSing…"/>
<exec executable="sass">
<arg value="${assets.dir}/styles.scss"/>
<arg value="${assets.dir}/styles.css"/>
</exec>
<echo message="Building ${final_css}"/>
<concat destfile="${final_css}" force="true" fixlastline="true">
<fileset file="${assets.dir}/normalize.css"/>
<fileset file="${assets.dir}/font-awesome.css"/>
<fileset file="${assets.dir}/styles.css"/>
</concat>
<copy todir="${build.dir}/">
<fileset file="${assets.dir}/fontawesome-*"/>
</copy>
</target>
<target name="compress" depends="concat">
<!-- CSS -->
<yui-compressor
warn="false"
munge="true"
preserveallsemicolons="false"
fromdir="${build.dir}"
todir="${build.dir}"
/>
<!-- Optimize PNGs -->
<copy todir="${build.dir}/">
<fileset file="${assets.dir}/*.png"/>
</copy>
<apply executable="/usr/bin/optipng">
<fileset file="${build.dir}/*.png"/>
</apply>
<!-- Optimize JPGs -->
<copy todir="${build.dir}/">
<fileset file="${assets.dir}/*.jpg"/>
</copy>
<apply executable="/usr/bin/jpegoptim">
<fileset file="${build.dir}/*.jpg"/>
<arg value="--all-progressive"/>
<arg value="--strip-all"/>
</apply>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="main" depends="clean,compress,concat"/>
</project>