forked from olabini/ioke
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ioke-ikc.build
198 lines (177 loc) · 6.81 KB
/
ioke-ikc.build
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?xml version="1.0"?>
<project name="ioke" default="build" basedir=".">
<description>
ioke is a next generation language, based on Io, Self, Smalltalk, Ruby and Lisp
</description>
<property name="src.raw.dir" value="src"/>
<property name="src.dir" value="src/ikc/main"/>
<property name="lib.dir" value="lib"/>
<property name="lib.build.dir" value="${lib.dir}/build"/>
<property name="bin.dir" value="bin"/>
<property name="release.dir" value="rels"/>
<property name="build.dir" value="build"/>
<property name="build.filtered.dir" value="${build.dir}/filtered"/>
<target name="prepare" description="Creates the directories needed for building">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.filtered.dir}"/>
<mkdir dir="${release.dir}"/>
</target>
<target name="generate_filters" depends="prepare" description="Generates source files">
<exec program="ruby" failonerror="false">
<arg value="generate_filter_data.rb"/>
</exec>
</target>
<target name="compile" depends="generate_filters" description="Compile the source files for the project.">
<csc target="library" output="${bin.dir}/Ioke.Math.dll" debug="true">
<sources>
<include name="${src.dir}/Ioke.Math/**/*.cs" />
</sources>
</csc>
<script language="C#" prefix="version">
<code>
<![CDATA[
[Function("extract-date")]
public static string ExtractDate() {
try {
string outp = System.IO.File.ReadAllText("version_data.properties");
string[] pieces = outp.Split('\n');
return pieces[0].Split('=')[1];
} catch(System.Exception) { return "???"; }
}
[Function("extract-commit")]
public static string ExtractCommit() {
try {
string outp = System.IO.File.ReadAllText("version_data.properties");
string[] pieces = outp.Split('\n');
return pieces[1].Split('=')[1];
} catch(System.Exception) { return "???"; }
}
]]>
</code>
</script>
<echo file="${build.filtered.dir}/Ioke.Lang.version.properties">ioke.build.version=E
ioke.build.runtimeVersion=0.4.1-SNAPSHOT
ioke.build.versionString=Ioke P ikc 0.4.1-SNAPSHOT
ioke.build.date=${version::extract-date()}
ioke.build.commit=${version::extract-commit()}
</echo>
<csc target="library" output="${bin.dir}/Ioke.Lang.dll" debug="true">
<sources>
<include name="${src.dir}/getline.cs" />
<include name="${src.dir}/Ioke.Lang/**/*.cs" />
<exclude name="${src.dir}/Ioke.Lang/Main.cs"/>
<exclude name="${src.dir}/Ioke.Lang/ISpecMain.cs"/>
<exclude name="${src.dir}/Ioke.Lang/DokgenMain.cs"/>
</sources>
<references basedir="${bin.dir}">
<include name="*.dll" />
<exclude name="Ioke.Lang.dll" />
</references>
<resources basedir="${src.raw.dir}" dynamicprefix="true">
<include name="builtin/**/*.ik" />
</resources>
<resources basedir="${src.raw.dir}/ikc" dynamicprefix="true">
<include name="builtin/**/*.ik" />
</resources>
<resources basedir="${build.filtered.dir}" dynamicprefix="true">
<include name="*.properties" />
</resources>
</csc>
<exec program="fsc">
<arg line="-a -o ${bin.dir}/Ioke.Lang.Parser.Functional.dll"/>
<arg line="-r ${bin.dir}/Ioke.Lang.dll"/>
<arg line="-r ${bin.dir}/Ioke.Math.dll"/>
<arg line="-r ${bin.dir}/FSharp.Core.dll"/>
<arg value="${src.dir}/Ioke.Lang/Parser/FunctionalOperatorShuffler.fs"/>
</exec>
<csc target="exe" output="${bin.dir}/ioke.exe" debug="true">
<sources>
<include name="${src.dir}/Ioke.Lang/Main.cs"/>
</sources>
<references basedir="${bin.dir}">
<include name="Ioke.Lang.dll" />
<include name="FSharp.Core.dll" />
<include name="Ioke.Lang.Parser.Functional.dll" />
</references>
</csc>
<csc target="exe" output="${bin.dir}/ispec.exe" debug="true">
<sources>
<include name="${src.dir}/Ioke.Lang/ISpecMain.cs"/>
</sources>
<references basedir="${bin.dir}">
<include name="ioke.exe" />
</references>
</csc>
<csc target="exe" output="${bin.dir}/dokgen.exe" debug="true">
<sources>
<include name="${src.dir}/Ioke.Lang/DokgenMain.cs"/>
</sources>
<references basedir="${bin.dir}">
<include name="ioke.exe" />
</references>
</csc>
</target>
<target name="test" depends="compile" description="Runs all ISpec tests">
<exec managed="true" program="bin/ispec.exe">
<arg line="test -fs"/>
</exec>
</target>
<target name="build" depends="test" description="Builds everything">
</target>
<target name="dist-bin">
<tar destfile="${release.dir}/ioke-P-ikc-0.4.1-SNAPSHOT.tar.gz" compression="GZip">
<fileset filemode="755" basedir="." prefix="ioke">
<include name="bin/*.dll"/>
<include name="bin/*.exe"/>
<include name="bin/ispec"/>
<include name="bin/dokgen"/>
</fileset>
<fileset basedir="." prefix="ioke">
<include name="lib/ioke/**"/>
<include name="dok/**"/>
<include name="share/**"/>
<include name="COPYING"/>
<include name="LICENSE"/>
<include name="LICENSE.kawa"/>
<include name="LICENSE.icu4j"/>
<include name="README"/>
</fileset>
</tar>
<zip zipfile="${release.dir}/ioke-P-ikc-0.4.1-SNAPSHOT.zip">
<fileset basedir="." prefix="ioke">
<include name="bin/*.dll"/>
<include name="bin/*.exe"/>
<include name="bin/ispec"/>
<include name="bin/dokgen"/>
</fileset>
<fileset basedir="." prefix="ioke">
<include name="lib/ioke/**"/>
<include name="dok/**"/>
<include name="share/**"/>
<include name="COPYING"/>
<include name="LICENSE"/>
<include name="LICENSE.kawa"/>
<include name="LICENSE.icu4j"/>
<include name="README"/>
</fileset>
</zip>
</target>
<target name="dist" depends="build, dist-bin"/>
<target name="dist-notest" depends="compile, dist-bin"/>
<target name="clean" description="clean almost everything">
<delete file="${bin.dir}/ioke.dll"/>
<delete file="${bin.dir}/ioke.dll.mdb"/>
<delete file="${bin.dir}/ioke.exe"/>
<delete file="${bin.dir}/ioke.exe.mdb"/>
<delete file="${bin.dir}/ispec.exe"/>
<delete file="${bin.dir}/ispec.exe.mdb"/>
<delete file="${bin.dir}/dokgen.exe"/>
<delete file="${bin.dir}/dokgen.exe.mdb"/>
<delete file="${bin.dir}/Ioke.Lang.dll"/>
<delete file="${bin.dir}/Ioke.Lang.dll.mdb"/>
<delete file="${bin.dir}/Ioke.Lang.Parser.Functional.dll"/>
<delete file="${bin.dir}/Ioke.Lang.Parser.Functional.dll.mdb"/>
<delete file="${bin.dir}/Ioke.Math.dll"/>
<delete file="${bin.dir}/Ioke.Math.dll.mdb"/>
</target>
</project>