-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
98 lines (85 loc) · 3.82 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
<?xml version="1.0" ?>
<!-- OpenSCAD ANT Build by Free Beachler, Longevity Software DBA Terawatt Industries is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -->
<project name="00str00der" default="compile-scad-to-stl" xmlns:fl="antlib:it.haefelinger.flaka">
<!-- initialize some props -->
<property name="proj" value="00str00der" />
<property name="build-tools-dir-name" value="tools/build" />
<property name="src-dir" value="${basedir}/src" />
<property name="dist-dir" value="${basedir}/dist/stl" />
<tstamp>
<format property="DATE_STAMP" pattern="yyyy-MM-dd" />
<format property="DATETIME_STAMP" pattern="yyyy-MM-dd_HHmm" />
</tstamp>
<!-- read props file -->
<condition property="isUnix" value="unix." else="">
<os family="unix" />
</condition>
<property file="${isUnix}settings.properties" />
<echo message="Load property file: ${isUnix}settings.properties" />
<fl:install-property-handler />
<target name="pkg-source-files" description="TAR and GZIP the /src fileset">
<property name="tar-filename" value="${dist-dir}/${proj}-source"/>
<delete file="${tar-filename}.tar" failonerror="true" />
<delete file="${tar-filename}.tgz" failonerror="true" />
<echo message="Pkg files..." />
<tar destfile="${tar-filename}.tar">
<tarfileset dir="./src/" prefix="">
<exclude name="**/*.svn" />
<exclude name="**/*.git" />
<exclude name="**/*.hg" />
<exclude name="**/*.tar" />
<exclude name="**/*.tgz" />
<exclude name="**/*.zip" />
</tarfileset>
</tar>
<gzip src="${tar-filename}.tar" destfile="${tar-filename}.tgz" />
<echo message="done pkg" />
</target>
<target name="pkg-dist-files" description="TAR and GZIP the /dist fileset">
<property name="tar-filename" value="${dist-dir}/${proj}-dist"/>
<delete file="${tar-filename}.tar" failonerror="true" />
<delete file="${tar-filename}.tgz" failonerror="true" />
<echo message="Pkg files..." />
<tar destfile="${tar-filename}.tar">
<tarfileset dir="${dist-dir}/" prefix="">
<exclude name="**/*.svn" />
<exclude name="**/*.git" />
<exclude name="**/*.hg" />
<exclude name="**/*.tar" />
<exclude name="**/*.tgz" />
<exclude name="**/*.zip" />
<include name="**/*.stl" />
<include name="**/*.png" />
</tarfileset>
</tar>
<gzip src="${tar-filename}.tar" destfile="${tar-filename}.tgz" />
<echo message="done pkg" />
</target>
<target name="zip-dist-files" depends="pkg-dist-files" description="ZIP the TAR distribution">
<property name="tar-filename" value="${dist-dir}/${proj}-dist"/>
<zip destfile="${dist-dir}/x_ends_misumi.zip">
<tarfileset src="${tar-filename}.tar"/>
</zip>
</target>
<target name="clean_dist">
<delete dir="./${dist-dir}"/>
<mkdir dir="./${dist-dir}"/>
</target>
<target name="compile-scad-to-stl" description="compile src/*.scad -> dist/*.stl">
<fl:let>
d = file('./src');
</fl:let>
<fl:for var="name" in="d.list">
<fl:switch value="#{name}">
<re expr="^(\./src)(.*)\.scad" var="m">
<echo message="compiling #{m} to STL :: " />
<exec executable="${exec.path.oscad}">
<arg line="-o ${dist-dir}/#{m[2]}.stl" />
<arg line="-D 'quality="production"'" />
<arg line="#{m}" />
</exec>
</re>
</fl:switch>
</fl:for>
</target>
</project>