Christian Fraß commited on 2016-08-09 01:17:44
Zeige 14 geänderte Dateien mit 3203 Einfügungen und 784 Löschungen.
... | ... |
@@ -1,105 +0,0 @@ |
1 |
-<project name="fs-draft" default="build"> |
|
2 |
- <property environment="env"> |
|
3 |
- </property> |
|
4 |
- <property name="dir.source" value="source"> |
|
5 |
- </property> |
|
6 |
- <property name="dir.source.structure" value="${dir.source}/structure"> |
|
7 |
- </property> |
|
8 |
- <property name="dir.source.style" value="${dir.source}/style"> |
|
9 |
- </property> |
|
10 |
- <property name="dir.source.logic" value="${dir.source}/logic"> |
|
11 |
- </property> |
|
12 |
- <property name="dir.source.logic.server" value="${dir.source.logic}/server"> |
|
13 |
- </property> |
|
14 |
- <property name="dir.source.logic.client" value="${dir.source.logic}/client"> |
|
15 |
- </property> |
|
16 |
- <property name="dir.source.media" value="${dir.source}/media"> |
|
17 |
- </property> |
|
18 |
- <property name="dir.temp" value="temp"> |
|
19 |
- </property> |
|
20 |
- <property name="dir.build" value="build"> |
|
21 |
- </property> |
|
22 |
- <property name="cmd.php" value="php"> |
|
23 |
- </property> |
|
24 |
- <property name="cmd.lessc" value="lessc"> |
|
25 |
- </property> |
|
26 |
- <target name="build" depends="build-structure,build-style,build-logic,build-media"> |
|
27 |
- </target> |
|
28 |
- <target name="build-structure"> |
|
29 |
- <mkdir dir="${dir.build}"> |
|
30 |
- </mkdir> |
|
31 |
- <exec executable="${cmd.php}" output="${dir.build}/draft.html"> |
|
32 |
- <arg value="${dir.source.structure}/draft.html.php"> |
|
33 |
- </arg> |
|
34 |
- </exec> |
|
35 |
- </target> |
|
36 |
- <target name="build-style"> |
|
37 |
- <mkdir dir="${dir.temp}"> |
|
38 |
- </mkdir> |
|
39 |
- <concat destfile="${dir.temp}/draft.less"> |
|
40 |
- <filelist dir="."> |
|
41 |
- <file name="${dir.source.style}/functions.less"> |
|
42 |
- </file> |
|
43 |
- <file name="${dir.source.style}/theme.less"> |
|
44 |
- </file> |
|
45 |
- <file name="${dir.source.style}/common.less"> |
|
46 |
- </file> |
|
47 |
- <file name="${dir.source.style}/concrete.less"> |
|
48 |
- </file> |
|
49 |
- </filelist> |
|
50 |
- </concat> |
|
51 |
- <mkdir dir="${dir.build}"> |
|
52 |
- </mkdir> |
|
53 |
- <exec executable="${cmd.lessc}"> |
|
54 |
- <arg value="${dir.temp}/draft.less"> |
|
55 |
- </arg> |
|
56 |
- <arg value="${dir.build}/draft.css"> |
|
57 |
- </arg> |
|
58 |
- </exec> |
|
59 |
- </target> |
|
60 |
- <target name="build-logic"> |
|
61 |
- <mkdir dir="${dir.build}"> |
|
62 |
- </mkdir> |
|
63 |
- <concat destfile="${dir.build}/draft.js"> |
|
64 |
- <filelist dir="."> |
|
65 |
- <file name="${dir.source.logic.client}/tools.js"> |
|
66 |
- </file> |
|
67 |
- <file name="${dir.source.logic.client}/table.js"> |
|
68 |
- </file> |
|
69 |
- <file name="${dir.source.logic.client}/toc.js"> |
|
70 |
- </file> |
|
71 |
- <file name="${dir.source.logic.client}/main.js"> |
|
72 |
- </file> |
|
73 |
- </filelist> |
|
74 |
- </concat> |
|
75 |
- </target> |
|
76 |
- <target name="build-media"> |
|
77 |
- <mkdir dir="${dir.build}"> |
|
78 |
- </mkdir> |
|
79 |
- <copy file="${dir.source.media}/logo.svg" tofile="${dir.build}/logo.svg"> |
|
80 |
- </copy> |
|
81 |
- <copy file="${dir.source.media}/folksprak_16x16.png" tofile="${dir.build}/favicon.png"> |
|
82 |
- </copy> |
|
83 |
- </target> |
|
84 |
- <target name="clean"> |
|
85 |
- <delete dir="${dir.temp}"> |
|
86 |
- </delete> |
|
87 |
- </target> |
|
88 |
- <target name="clear" depends="clean,clear-structure,clear-style,clear-logic"> |
|
89 |
- <delete dir="${dir.build}"> |
|
90 |
- </delete> |
|
91 |
- </target> |
|
92 |
- <target name="clear-structure"> |
|
93 |
- <delete file="${dir.build}/draft.html"> |
|
94 |
- </delete> |
|
95 |
- </target> |
|
96 |
- <target name="clear-style"> |
|
97 |
- <delete file="${dir.build}/draft.css"> |
|
98 |
- </delete> |
|
99 |
- </target> |
|
100 |
- <target name="clear-logic"> |
|
101 |
- <delete file="${dir.build}/draft.js"> |
|
102 |
- </delete> |
|
103 |
- </target> |
|
104 |
-</project> |
|
105 |
- |
... | ... |
@@ -1,282 +0,0 @@ |
1 |
-import os |
|
2 |
-import sys |
|
3 |
- |
|
4 |
- |
|
5 |
-class class_rule(object): |
|
6 |
- |
|
7 |
- def __init__(self, name, dependencies, commands, phony = False): |
|
8 |
- self.name = name |
|
9 |
- self.dependencies = dependencies |
|
10 |
- self.commands = commands |
|
11 |
- self.phony = phony |
|
12 |
- |
|
13 |
- |
|
14 |
- def __str__(self): |
|
15 |
- output = "" |
|
16 |
- output += "%s: %s\n" % (self.name, " ".join(self.dependencies)) |
|
17 |
- for command in self.commands: |
|
18 |
- output += ("\t@ %s\n" % (command.compile_unix())) |
|
19 |
- if (self.phony): output += (".PHONY: %s\n" % self.name) |
|
20 |
- return output |
|
21 |
- |
|
22 |
- |
|
23 |
- |
|
24 |
-class class_command(object): |
|
25 |
- def __init__(self, parameters): self.parameters = parameters |
|
26 |
- def compile_unix(self): raise NotImplementedError |
|
27 |
- def compile_ant(self): raise NotImplementedError |
|
28 |
- |
|
29 |
-class class_command_log(class_command): |
|
30 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
31 |
- def compile_unix(self): return ("echo -e '-- %s'" % (self.parameters["message"])) |
|
32 |
- |
|
33 |
-class class_command_directory_create(class_command): |
|
34 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
35 |
- def compile_unix(self): return ("mkdir --parents %s" % (self.parameters["path"])) |
|
36 |
- |
|
37 |
-class class_command_file_copy(class_command): |
|
38 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
39 |
- def compile_unix(self): return ("cp --recursive %s %s" % (self.parameters["path-from"], self.parameters["path-to"])) |
|
40 |
- |
|
41 |
-class class_command_file_concat(class_command): |
|
42 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
43 |
- def compile_unix(self): return ("cat %s > %s" % (" ".join(self.parameters["paths-from"]), self.parameters["path-to"])) |
|
44 |
- |
|
45 |
-class class_command_directory_remove(class_command): |
|
46 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
47 |
- def compile_unix(self): return ("rm --recursive --force %s" % (self.parameters["path"])) |
|
48 |
- |
|
49 |
-class class_command_image_convert(class_command): |
|
50 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
51 |
- def compile_unix(self): return ("convert %s %s" % (self.parameters["path-from"], self.parameters["path-to"])) |
|
52 |
- |
|
53 |
-class class_command_latex_compile(class_command): |
|
54 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
55 |
- def compile_unix(self): return ("xelatex -output-directory=%s %s > /dev/null" % (self.parameters["output"], self.parameters["path"])) |
|
56 |
- |
|
57 |
-class class_command_php_compile(class_command): |
|
58 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
59 |
- def compile_unix(self): return ("php %s > %s" % (self.parameters["path-from"], self.parameters["path-to"])) |
|
60 |
- |
|
61 |
-class class_command_lessc_compile(class_command): |
|
62 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
63 |
- def compile_unix(self): return ("lessc %s > %s" % (self.parameters["path-from"], self.parameters["path-to"])) |
|
64 |
- |
|
65 |
- |
|
66 |
- |
|
67 |
-def main(): |
|
68 |
- |
|
69 |
- dirs = { |
|
70 |
- "source": "source", |
|
71 |
- "temp": "temp", |
|
72 |
- "build": "build", |
|
73 |
- } |
|
74 |
- |
|
75 |
- parts_logic_server = [ |
|
76 |
- os.path.join(dirs["source"],"logic","server","misc.php"), |
|
77 |
- os.path.join(dirs["source"],"logic","server","data.php"), |
|
78 |
- os.path.join(dirs["source"],"logic","server","settings.php"), |
|
79 |
- os.path.join(dirs["source"],"logic","server","table.php"), |
|
80 |
- os.path.join(dirs["source"],"logic","server","sql.php"), |
|
81 |
- ] |
|
82 |
- |
|
83 |
- parts_content = [ |
|
84 |
- os.path.join(dirs["source"],"content","draft.html.php"), |
|
85 |
- os.path.join(dirs["source"],"content","meta.html.php"), |
|
86 |
- os.path.join(dirs["source"],"content","introduction.html.php"), |
|
87 |
- os.path.join(dirs["source"],"content","preface.html.php"), |
|
88 |
- os.path.join(dirs["source"],"content","key_parameters.html.php"), |
|
89 |
- os.path.join(dirs["source"],"content","toc.html.php"), |
|
90 |
- os.path.join(dirs["source"],"content","basics.html.php"), |
|
91 |
- os.path.join(dirs["source"],"content","phonology_and_orthography.html.php"), |
|
92 |
- os.path.join(dirs["source"],"content","grammar.html.php"), |
|
93 |
- os.path.join(dirs["source"],"content","personal_pronouns.html.php"), |
|
94 |
- os.path.join(dirs["source"],"content","correlatives.html.php"), |
|
95 |
- os.path.join(dirs["source"],"content","conjugation.html.php"), |
|
96 |
- os.path.join(dirs["source"],"content","infinite_verbforms.html.php"), |
|
97 |
- os.path.join(dirs["source"],"content","modal_verbs.html.php"), |
|
98 |
- os.path.join(dirs["source"],"content","tempora_and_modi.html.php"), |
|
99 |
- os.path.join(dirs["source"],"content","negation.html.php"), |
|
100 |
- os.path.join(dirs["source"],"content","declension.html.php"), |
|
101 |
- os.path.join(dirs["source"],"content","numeri.html.php"), |
|
102 |
- os.path.join(dirs["source"],"content","cases.html.php"), |
|
103 |
- os.path.join(dirs["source"],"content","definiteness.html.php"), |
|
104 |
- os.path.join(dirs["source"],"content","attributes.html.php"), |
|
105 |
- os.path.join(dirs["source"],"content","sentence_structure.html.php"), |
|
106 |
- os.path.join(dirs["source"],"content","vocabulary.html.php"), |
|
107 |
- os.path.join(dirs["source"],"content","principles.html.php"), |
|
108 |
- os.path.join(dirs["source"],"content","word_functions.html.php"), |
|
109 |
- os.path.join(dirs["source"],"content","adpositions.html.php"), |
|
110 |
- os.path.join(dirs["source"],"content","pronouns.html.php"), |
|
111 |
- os.path.join(dirs["source"],"content","dictionary.html.php"), |
|
112 |
- os.path.join(dirs["source"],"content","examples.html.php"), |
|
113 |
- os.path.join(dirs["source"],"content","example_sentences.html.php"), |
|
114 |
- os.path.join(dirs["source"],"content","example_texts.html.php"), |
|
115 |
- ] |
|
116 |
- |
|
117 |
- parts_data = [ |
|
118 |
- os.path.join(dirs["source"],"data","phonology_and_orthography.json"), |
|
119 |
- os.path.join(dirs["source"],"data","personal_pronouns.json"), |
|
120 |
- os.path.join(dirs["source"],"data","word_functions.json"), |
|
121 |
- os.path.join(dirs["source"],"data","timeforms.json"), |
|
122 |
- os.path.join(dirs["source"],"data","adpositions.json"), |
|
123 |
- os.path.join(dirs["source"],"data","correlatives.json"), |
|
124 |
- ] |
|
125 |
- |
|
126 |
- parts_logic_client = [ |
|
127 |
- os.path.join(dirs["source"],"logic","client","tools.js"), |
|
128 |
- os.path.join(dirs["source"],"logic","client","table.js"), |
|
129 |
- os.path.join(dirs["source"],"logic","client","toc.js"), |
|
130 |
- os.path.join(dirs["source"],"logic","client","main.js"), |
|
131 |
- ] |
|
132 |
- |
|
133 |
- parts_style = [ |
|
134 |
- os.path.join(dirs["source"],"style","functions.less"), |
|
135 |
- os.path.join(dirs["source"],"style","theme.less"), |
|
136 |
- os.path.join(dirs["source"],"style","common.less"), |
|
137 |
- os.path.join(dirs["source"],"style","concrete.less"), |
|
138 |
- ] |
|
139 |
- |
|
140 |
- rules = [] |
|
141 |
- rules.append( |
|
142 |
- class_rule( |
|
143 |
- "all", |
|
144 |
- [ |
|
145 |
- os.path.join(dirs["build"],"draft.html"), |
|
146 |
- os.path.join(dirs["build"],"draft.css"), |
|
147 |
- os.path.join(dirs["build"],"draft.js"), |
|
148 |
- os.path.join(dirs["build"],"logo.svg"), |
|
149 |
- os.path.join(dirs["build"],"favicon.png"), |
|
150 |
- ], |
|
151 |
- [], |
|
152 |
- True |
|
153 |
- ) |
|
154 |
- ) |
|
155 |
- rules.append( |
|
156 |
- class_rule( |
|
157 |
- "clean", |
|
158 |
- [], |
|
159 |
- [ |
|
160 |
- class_command_directory_remove({ |
|
161 |
- "path": dirs["temp"], |
|
162 |
- }), |
|
163 |
- ], |
|
164 |
- True |
|
165 |
- ) |
|
166 |
- ) |
|
167 |
- rules.append( |
|
168 |
- class_rule( |
|
169 |
- "clear", |
|
170 |
- ["clean"], |
|
171 |
- [ |
|
172 |
- class_command_directory_remove({ |
|
173 |
- "path": dirs["build"], |
|
174 |
- }), |
|
175 |
- ], |
|
176 |
- True |
|
177 |
- ) |
|
178 |
- ) |
|
179 |
- rules.append( |
|
180 |
- class_rule( |
|
181 |
- os.path.join(dirs["build"],"draft.html"), |
|
182 |
- parts_data + parts_logic_server + parts_content, |
|
183 |
- [ |
|
184 |
- class_command_log({ |
|
185 |
- "message": "composing document ..." |
|
186 |
- }), |
|
187 |
- class_command_directory_create({ |
|
188 |
- "path": dirs["build"], |
|
189 |
- }), |
|
190 |
- class_command_php_compile({ |
|
191 |
- "path-from": os.path.join(dirs["source"],"content","draft.html.php"), |
|
192 |
- "path-to": os.path.join(dirs["build"],"draft.html"), |
|
193 |
- }), |
|
194 |
- ] |
|
195 |
- ) |
|
196 |
- ) |
|
197 |
- rules.append( |
|
198 |
- class_rule( |
|
199 |
- os.path.join(dirs["build"],"draft.js"), |
|
200 |
- parts_logic_client, |
|
201 |
- [ |
|
202 |
- class_command_log({ |
|
203 |
- "message": "composing client-logic ..." |
|
204 |
- }), |
|
205 |
- class_command_directory_create({ |
|
206 |
- "path": dirs["build"], |
|
207 |
- }), |
|
208 |
- class_command_file_concat({ |
|
209 |
- "paths-from": parts_logic_client, |
|
210 |
- "path-to": os.path.join(dirs["build"],"draft.js"), |
|
211 |
- }), |
|
212 |
- ] |
|
213 |
- ) |
|
214 |
- ) |
|
215 |
- rules.append( |
|
216 |
- class_rule( |
|
217 |
- os.path.join(dirs["build"],"logo.svg"), |
|
218 |
- [os.path.join(dirs["source"],"media","logo.svg")], |
|
219 |
- [ |
|
220 |
- class_command_log({ |
|
221 |
- "message": "copying logo ..." |
|
222 |
- }), |
|
223 |
- class_command_directory_create({ |
|
224 |
- "path": dirs["build"], |
|
225 |
- }), |
|
226 |
- class_command_file_copy({ |
|
227 |
- "path-from": os.path.join(dirs["source"],"media","logo.svg"), |
|
228 |
- "path-to": os.path.join(dirs["build"],"logo.svg"), |
|
229 |
- }), |
|
230 |
- ] |
|
231 |
- ) |
|
232 |
- ) |
|
233 |
- rules.append( |
|
234 |
- class_rule( |
|
235 |
- os.path.join(dirs["build"],"favicon.png"), |
|
236 |
- [os.path.join(dirs["source"],"media","folksprak_16x16.png")], |
|
237 |
- [ |
|
238 |
- class_command_log({ |
|
239 |
- "message": "copying favicon ..." |
|
240 |
- }), |
|
241 |
- class_command_directory_create({ |
|
242 |
- "path": dirs["build"], |
|
243 |
- }), |
|
244 |
- class_command_file_copy({ |
|
245 |
- "path-from": os.path.join(dirs["source"],"media","folksprak_16x16.png"), |
|
246 |
- "path-to": os.path.join(dirs["build"],"favicon.png"), |
|
247 |
- }), |
|
248 |
- ] |
|
249 |
- ) |
|
250 |
- ) |
|
251 |
- rules.append( |
|
252 |
- class_rule( |
|
253 |
- os.path.join(dirs["build"],"draft.css"), |
|
254 |
- parts_style, |
|
255 |
- [ |
|
256 |
- class_command_log({ |
|
257 |
- "message": "compiling style ..." |
|
258 |
- }), |
|
259 |
- class_command_directory_create({ |
|
260 |
- "path": os.path.join(dirs["temp"]), |
|
261 |
- }), |
|
262 |
- class_command_file_concat({ |
|
263 |
- "paths-from": parts_style, |
|
264 |
- "path-to": os.path.join(dirs["temp"],"draft.less"), |
|
265 |
- }), |
|
266 |
- class_command_directory_create({ |
|
267 |
- "path": os.path.join(dirs["build"]), |
|
268 |
- }), |
|
269 |
- class_command_lessc_compile({ |
|
270 |
- "path-from": os.path.join(dirs["temp"],"draft.less"), |
|
271 |
- "path-to": os.path.join(dirs["build"],"draft.css"), |
|
272 |
- }), |
|
273 |
- ] |
|
274 |
- ) |
|
275 |
- ) |
|
276 |
- |
|
277 |
- for rule in rules: print(rule) |
|
278 |
- sys.stderr.write("\n[information]\tThe output of this script is meant to be redirected into a GNU-makefile\n") |
|
279 |
- |
|
280 |
- |
|
281 |
-main() |
|
282 |
- |
... | ... |
@@ -1,171 +0,0 @@ |
1 |
-import os |
|
2 |
-import sys |
|
3 |
- |
|
4 |
- |
|
5 |
-class class_rule(object): |
|
6 |
- |
|
7 |
- def __init__(self, name, dependencies, commands, phony = False): |
|
8 |
- self.name = name |
|
9 |
- self.dependencies = dependencies |
|
10 |
- self.commands = commands |
|
11 |
- self.phony = phony |
|
12 |
- |
|
13 |
- |
|
14 |
- def __str__(self): |
|
15 |
- output = "" |
|
16 |
- output += "%s: %s\n" % (self.name, " ".join(self.dependencies)) |
|
17 |
- for command in self.commands: |
|
18 |
- output += ("\t@ %s\n" % (command.compile_unix())) |
|
19 |
- if (self.phony): output += (".PHONY: %s\n" % self.name) |
|
20 |
- return output |
|
21 |
- |
|
22 |
- |
|
23 |
- |
|
24 |
-class class_command(object): |
|
25 |
- def __init__(self, parameters): self.parameters = parameters |
|
26 |
- def compile_unix(self): raise NotImplementedError |
|
27 |
- def compile_ant(self): raise NotImplementedError |
|
28 |
- |
|
29 |
-class class_command_log(class_command): |
|
30 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
31 |
- def compile_unix(self): return ("echo -e '-- %s'" % (self.parameters["message"])) |
|
32 |
- |
|
33 |
-class class_command_directory_create(class_command): |
|
34 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
35 |
- def compile_unix(self): return ("mkdir --parents %s" % (self.parameters["path"])) |
|
36 |
- |
|
37 |
-class class_command_file_copy(class_command): |
|
38 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
39 |
- def compile_unix(self): return ("cp --recursive %s %s" % (self.parameters["path-from"], self.parameters["path-to"])) |
|
40 |
- |
|
41 |
-class class_command_directory_remove(class_command): |
|
42 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
43 |
- def compile_unix(self): return ("rm --recursive --force %s" % (self.parameters["path"])) |
|
44 |
- |
|
45 |
-class class_command_image_convert(class_command): |
|
46 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
47 |
- def compile_unix(self): return ("convert %s %s" % (self.parameters["path-from"], self.parameters["path-to"])) |
|
48 |
- |
|
49 |
-class class_command_latex_compile(class_command): |
|
50 |
- def __init__(self, parameters): class_command.__init__(self, parameters) |
|
51 |
- def compile_unix(self): return ("xelatex -output-directory=%s %s > /dev/null" % (self.parameters["output"], self.parameters["path"])) |
|
52 |
- |
|
53 |
- |
|
54 |
- |
|
55 |
-def main(): |
|
56 |
- |
|
57 |
- dirs = { |
|
58 |
- "source": "source", |
|
59 |
- "temp": "temp", |
|
60 |
- "build": "build", |
|
61 |
- } |
|
62 |
- |
|
63 |
- texs = [ |
|
64 |
- os.path.join(dirs["source"],"tex","folksprak.tex"), |
|
65 |
- os.path.join(dirs["source"],"tex","packages.tex"), |
|
66 |
- os.path.join(dirs["source"],"tex","settings.tex"), |
|
67 |
- os.path.join(dirs["source"],"tex","meta.tex"), |
|
68 |
- os.path.join(dirs["source"],"tex","commands.tex"), |
|
69 |
- os.path.join(dirs["source"],"tex","preface.tex"), |
|
70 |
- os.path.join(dirs["source"],"tex","grammar.tex"), |
|
71 |
- os.path.join(dirs["source"],"tex","phonology_and_orthography.tex"), |
|
72 |
- os.path.join(dirs["source"],"tex","conjugation.tex"), |
|
73 |
- os.path.join(dirs["source"],"tex","declension.tex"), |
|
74 |
- os.path.join(dirs["source"],"tex","attributes.tex"), |
|
75 |
- ] |
|
76 |
- |
|
77 |
- rules = [] |
|
78 |
- rules.append( |
|
79 |
- class_rule( |
|
80 |
- "all", |
|
81 |
- [os.path.join(dirs["build"],"folksprak.pdf")], |
|
82 |
- [], |
|
83 |
- True |
|
84 |
- ) |
|
85 |
- ) |
|
86 |
- rules.append( |
|
87 |
- class_rule( |
|
88 |
- "clean", |
|
89 |
- [], |
|
90 |
- [ |
|
91 |
- class_command_directory_remove({ |
|
92 |
- "path": dirs["temp"], |
|
93 |
- }), |
|
94 |
- ], |
|
95 |
- True |
|
96 |
- ) |
|
97 |
- ) |
|
98 |
- rules.append( |
|
99 |
- class_rule( |
|
100 |
- "clear", |
|
101 |
- ["clean"], |
|
102 |
- [ |
|
103 |
- class_command_directory_remove({ |
|
104 |
- "path": dirs["build"], |
|
105 |
- }), |
|
106 |
- ], |
|
107 |
- True |
|
108 |
- ) |
|
109 |
- ) |
|
110 |
- rules.append( |
|
111 |
- class_rule( |
|
112 |
- os.path.join(dirs["temp"],"media","logo.pdf"), |
|
113 |
- [os.path.join(dirs["source"],"media","logo.svg")], |
|
114 |
- [ |
|
115 |
- class_command_log({ |
|
116 |
- "message": "converting logo ..." |
|
117 |
- }), |
|
118 |
- class_command_directory_create({ |
|
119 |
- "path": os.path.join(dirs["temp"],"media"), |
|
120 |
- }), |
|
121 |
- class_command_image_convert({ |
|
122 |
- "path-from": os.path.join(dirs["source"],"media","logo.svg"), |
|
123 |
- "path-to": os.path.join(dirs["temp"],"media","logo.pdf"), |
|
124 |
- }), |
|
125 |
- ] |
|
126 |
- ) |
|
127 |
- ) |
|
128 |
- rules.append( |
|
129 |
- class_rule( |
|
130 |
- os.path.join(dirs["temp"],"folksprak.pdf"), |
|
131 |
- texs + [os.path.join(dirs["temp"],"media","logo.pdf")], |
|
132 |
- [ |
|
133 |
- class_command_log({ |
|
134 |
- "message": "compiling document ..." |
|
135 |
- }), |
|
136 |
- class_command_directory_create({ |
|
137 |
- "path": dirs["temp"], |
|
138 |
- }), |
|
139 |
- class_command_latex_compile({ |
|
140 |
- "path": os.path.join(dirs["source"],"tex","folksprak.tex"), |
|
141 |
- "output": os.path.join(dirs["temp"]), |
|
142 |
- }), |
|
143 |
- class_command_latex_compile({ |
|
144 |
- "path": os.path.join(dirs["source"],"tex","folksprak.tex"), |
|
145 |
- "output": os.path.join(dirs["temp"]), |
|
146 |
- }), |
|
147 |
- ] |
|
148 |
- ) |
|
149 |
- ) |
|
150 |
- rules.append( |
|
151 |
- class_rule( |
|
152 |
- os.path.join(dirs["build"],"folksprak.pdf"), |
|
153 |
- [os.path.join(dirs["temp"],"folksprak.pdf")], |
|
154 |
- [ |
|
155 |
- class_command_directory_create({ |
|
156 |
- "path": os.path.join(dirs["build"]), |
|
157 |
- }), |
|
158 |
- class_command_file_copy({ |
|
159 |
- "path-from": os.path.join(dirs["temp"],"folksprak.pdf"), |
|
160 |
- "path-to": os.path.join(dirs["build"],"folksprak.pdf"), |
|
161 |
- }), |
|
162 |
- ] |
|
163 |
- ) |
|
164 |
- ) |
|
165 |
- |
|
166 |
- for rule in rules: print(rule) |
|
167 |
- sys.stderr.write("\n[information]\tThe output of this script is meant to be redirected into a GNU-makefile\n") |
|
168 |
- |
|
169 |
- |
|
170 |
-main() |
|
171 |
- |
... | ... |
@@ -1,38 +0,0 @@ |
1 |
-all: build/draft.html build/draft.css build/draft.js build/logo.svg build/favicon.png |
|
2 |
-.PHONY: all |
|
3 |
- |
|
4 |
-clean: |
|
5 |
- @ rm --recursive --force temp |
|
6 |
-.PHONY: clean |
|
7 |
- |
|
8 |
-clear: clean |
|
9 |
- @ rm --recursive --force build |
|
10 |
-.PHONY: clear |
|
11 |
- |
|
12 |
-build/draft.html: source/data/phonology_and_orthography.json source/data/personal_pronouns.json source/data/word_functions.json source/data/timeforms.json source/data/adpositions.json source/data/correlatives.json source/logic/server/misc.php source/logic/server/data.php source/logic/server/settings.php source/logic/server/table.php source/logic/server/sql.php source/content/draft.html.php source/content/meta.html.php source/content/introduction.html.php source/content/preface.html.php source/content/key_parameters.html.php source/content/toc.html.php source/content/basics.html.php source/content/phonology_and_orthography.html.php source/content/grammar.html.php source/content/personal_pronouns.html.php source/content/correlatives.html.php source/content/conjugation.html.php source/content/infinite_verbforms.html.php source/content/modal_verbs.html.php source/content/tempora_and_modi.html.php source/content/negation.html.php source/content/declension.html.php source/content/numeri.html.php source/content/cases.html.php source/content/definiteness.html.php source/content/attributes.html.php source/content/sentence_structure.html.php source/content/vocabulary.html.php source/content/principles.html.php source/content/word_functions.html.php source/content/adpositions.html.php source/content/pronouns.html.php source/content/dictionary.html.php source/content/examples.html.php source/content/example_sentences.html.php source/content/example_texts.html.php |
|
13 |
- @ echo -e '-- composing document ...' |
|
14 |
- @ mkdir --parents build |
|
15 |
- @ php source/content/draft.html.php > build/draft.html |
|
16 |
- |
|
17 |
-build/draft.js: source/logic/client/tools.js source/logic/client/table.js source/logic/client/toc.js source/logic/client/main.js |
|
18 |
- @ echo -e '-- composing client-logic ...' |
|
19 |
- @ mkdir --parents build |
|
20 |
- @ cat source/logic/client/tools.js source/logic/client/table.js source/logic/client/toc.js source/logic/client/main.js > build/draft.js |
|
21 |
- |
|
22 |
-build/logo.svg: source/media/logo.svg |
|
23 |
- @ echo -e '-- copying logo ...' |
|
24 |
- @ mkdir --parents build |
|
25 |
- @ cp --recursive source/media/logo.svg build/logo.svg |
|
26 |
- |
|
27 |
-build/favicon.png: source/media/folksprak_16x16.png |
|
28 |
- @ echo -e '-- copying favicon ...' |
|
29 |
- @ mkdir --parents build |
|
30 |
- @ cp --recursive source/media/folksprak_16x16.png build/favicon.png |
|
31 |
- |
|
32 |
-build/draft.css: source/style/functions.less source/style/theme.less source/style/common.less source/style/concrete.less |
|
33 |
- @ echo -e '-- compiling style ...' |
|
34 |
- @ mkdir --parents temp |
|
35 |
- @ cat source/style/functions.less source/style/theme.less source/style/common.less source/style/concrete.less > temp/draft.less |
|
36 |
- @ mkdir --parents build |
|
37 |
- @ lessc temp/draft.less > build/draft.css |
|
38 |
- |
... | ... |
@@ -0,0 +1,103 @@ |
1 |
+{ |
|
2 |
+ "name": "fs-draft", |
|
3 |
+ "version": "0.0.1", |
|
4 |
+ "roottask": { |
|
5 |
+ "name": "build", |
|
6 |
+ "type": "group", |
|
7 |
+ "sub": [ |
|
8 |
+ { |
|
9 |
+ "name": "structure", |
|
10 |
+ "type": "php", |
|
11 |
+ "parameters": { |
|
12 |
+ "inputs": [ |
|
13 |
+ "source/content/draft.html.php", |
|
14 |
+ "source/data/phonology_and_orthography.json", |
|
15 |
+ "source/data/personal_pronouns.json", |
|
16 |
+ "source/data/word_functions.json", |
|
17 |
+ "source/data/timeforms.json", |
|
18 |
+ "source/data/adpositions.json", |
|
19 |
+ "source/data/correlatives.json", |
|
20 |
+ "source/logic/server/misc.php", |
|
21 |
+ "source/logic/server/data.php", |
|
22 |
+ "source/logic/server/settings.php", |
|
23 |
+ "source/logic/server/table.php", |
|
24 |
+ "source/logic/server/sql.php", |
|
25 |
+ "source/content/meta.html.php", |
|
26 |
+ "source/content/introduction.html.php", |
|
27 |
+ "source/content/preface.html.php", |
|
28 |
+ "source/content/key_parameters.html.php", |
|
29 |
+ "source/content/toc.html.php", |
|
30 |
+ "source/content/basics.html.php", |
|
31 |
+ "source/content/phonology_and_orthography.html.php", |
|
32 |
+ "source/content/grammar.html.php", |
|
33 |
+ "source/content/personal_pronouns.html.php", |
|
34 |
+ "source/content/correlatives.html.php", |
|
35 |
+ "source/content/conjugation.html.php", |
|
36 |
+ "source/content/infinite_verbforms.html.php", |
|
37 |
+ "source/content/modal_verbs.html.php", |
|
38 |
+ "source/content/tempora_and_modi.html.php", |
|
39 |
+ "source/content/negation.html.php", |
|
40 |
+ "source/content/declension.html.php", |
|
41 |
+ "source/content/numeri.html.php", |
|
42 |
+ "source/content/cases.html.php", |
|
43 |
+ "source/content/definiteness.html.php", |
|
44 |
+ "source/content/attributes.html.php", |
|
45 |
+ "source/content/sentence_structure.html.php", |
|
46 |
+ "source/content/vocabulary.html.php", |
|
47 |
+ "source/content/principles.html.php", |
|
48 |
+ "source/content/word_functions.html.php", |
|
49 |
+ "source/content/adpositions.html.php", |
|
50 |
+ "source/content/pronouns.html.php", |
|
51 |
+ "source/content/dictionary.html.php", |
|
52 |
+ "source/content/examples.html.php", |
|
53 |
+ "source/content/example_sentences.html.php", |
|
54 |
+ "source/content/example_texts.html.php" |
|
55 |
+ ], |
|
56 |
+ "output": "build/draft.html", |
|
57 |
+ "only_first": true |
|
58 |
+ } |
|
59 |
+ }, |
|
60 |
+ { |
|
61 |
+ "name": "logic", |
|
62 |
+ "type": "concat", |
|
63 |
+ "parameters": { |
|
64 |
+ "inputs": [ |
|
65 |
+ "source/logic/client/tools.js", |
|
66 |
+ "source/logic/client/table.js", |
|
67 |
+ "source/logic/client/toc.js", |
|
68 |
+ "source/logic/client/main.js" |
|
69 |
+ ], |
|
70 |
+ "output": "build/draft.js" |
|
71 |
+ } |
|
72 |
+ }, |
|
73 |
+ { |
|
74 |
+ "name": "style", |
|
75 |
+ "type": "lesscss", |
|
76 |
+ "parameters": { |
|
77 |
+ "inputs": [ |
|
78 |
+ "source/style/functions.less", |
|
79 |
+ "source/style/theme.less", |
|
80 |
+ "source/style/common.less", |
|
81 |
+ "source/style/concrete.less" |
|
82 |
+ ], |
|
83 |
+ "output": "build/draft.css" |
|
84 |
+ } |
|
85 |
+ }, |
|
86 |
+ { |
|
87 |
+ "name": "media", |
|
88 |
+ "type": "group", |
|
89 |
+ "sub": [ |
|
90 |
+ { |
|
91 |
+ "name": "logo", |
|
92 |
+ "type": "copy", |
|
93 |
+ "parameters": { |
|
94 |
+ "input": "source/media/logo.svg", |
|
95 |
+ "output": "build/logo.svg" |
|
96 |
+ } |
|
97 |
+ } |
|
98 |
+ ] |
|
99 |
+ } |
|
100 |
+ ] |
|
101 |
+ } |
|
102 |
+} |
|
103 |
+ |
... | ... |
@@ -3,12 +3,12 @@ |
3 | 3 |
<section class="subsection pseudo" id="de_grot_diktator"> |
4 | 4 |
<header>De grot diktator</header> |
5 | 5 |
<span class="text lang_fs"> |
6 |
- <p>Ek bid fur fargivung, dok ek vil nit are de verlds herskar — ek ar nit solk en man. Ek vil nit beherske odar neddrüke et man, insted ek vil helpe de maner alvan önd alvar: De judisk, de hejdisk, de fargig, de vit, …. Vi al skal helpe en de ander fur at vi kön leve ine en beter verld. Vi vil nit hate odar farakte us. Dis verld hav plats fur al maner önd ur erd ar so rik, at vi al kön spise nok. De levrid kön are so fri önd skön; dok vi hav farlatet de veg.</p> |
|
7 |
- <p>Gridhed hav sükent de maners seler önd hav fült de verld med hatrid; het hav ledet us to elend önd blutsketrid. Vi hav utvikelt raskhed, dok ur gester stan stil. Vi lat makiner verke fur us; ur vetrid hav makt us hokmudig önd ur klughed hard önd unfrendlik; vi denk altu mang önd föl altu lit. Dok mer den makiner vi treng manlikhed; mer den klughed vi treng frendlikhed önd gudhed. An dis egenheder, ur levrid ar frükridig önd al ding ar lost.</p> |
|
8 |
- <p>Med de helprid av flütüger önd de radio vi ar narer en to de ander den et tid ruk. De manskap treng enhed önd en alvar arend bruderlikhed fur tu bruke dis utfindunger gud. Selv no mang tused in der verld kön höre min stem, mang tusend fartvivelt verer, kviner önd smal kinder — ofarunger av en sistem, vilk fang önd kvel unskuldig maner. Ek rup to al, vilk kön hör mig no: Fartvivel nit! De elend skal farsvinde, van de gridhed farsvind önd de biterhed av maner, vilk frük de manskaps forskritrid. De Maners hatrid skal farsvinde önd diktarorer skal döe. Dan de kraft, vilk di hav takt fra de folk, skal kome bak to de folk. Selv ef mang blud ar sketet: Tu kempe fur de frihed ar en gud sak.</p> |
|
9 |
- <p>Kemparer: Kemp nit fur tiraner; maner, vilk farakt ju önd mak ju to sklaver; vilk vertskat nit jur levrid, vilk seg to ju, vat je skal make, true önd föle! Di skend ju, föd ju, behandel ju lik kanon-födung. Kemp nit fur dis fardervt maner — makin-maner med makin-hövder önd makin-herter! Je ar nit makiner, je ar nit direr, je ar maner. Lat de manlikhed blive ine jur herter! Je skal nit hate; bar de unlivt hat, de unlivt önd de fardervt.</p> |
|
10 |
- <p>Kemperar: Kemp nit fur de sklavskap! Kemp fur de frihed! Ine de 17. avsnidung av de hajlig Lukas ar skrivt: ‚God ar ine al maner.‘ — nit bar ine en grup av maner, insted ine al maner, ine ju. Je, de folk, hav de kraft; de kraft fur tu bue vapener, dok ok de kraft fur tu sprede gladhed. Je, de folk, hav de kraft fur tu make dis levrid fri önd skön, fur tu make dis levrid en vunderfült sak. Darfur: Ine de nam av folkherskrid: Lat us bruke dis kraft! Lat us verde en! Lat us kempe fur en nü verld, fur en beter verld, vilk giv to de maner magrid tu verke, vilk giv en eftertid to de jung önd sikerhed to de old. Ok de tiraner hav truent dis to us fur tu foe de vold, dok di hav lügt. Di mak nit sant dir luvung, di ing tid vil. Tiraner frien bar dim selv, dok de folk skal blive sklaver.</p> |
|
11 |
- <p>Lat us no kempe fur tu upfüle dis luvung. Lat us kempe fur tu make de verld fri, fur tu uvervinde landmarker, gridhed, hatrid önd de untillatrid. Lat us kempe fur en verld med farstanrid, en verld, var vetridskap önd forskritrid skal lede to al mans gladhed.</p> |
|
6 |
+ <p>Ek bid fur fargivung, dok ek vil nit are de verlds herskar — ek ar nit solk en man. Ek vil nit beherske odar neddrüke et man, insted ek vil helpe de maner alvan and alvar: De judisk, de hejdisk, de fargig, de vit, …. Vi al skal helpe en de ander fur at vi kön leve ine en beter verld. Vi vil nit hate odar farakte us. Dis verld hav plats fur al maner and ur erd ar so rik, at vi al kön spise nok. De levrid kön are so fri and skön; dok vi hav farlatet de veg.</p> |
|
7 |
+ <p>Gridhed hav sükent de maners seler and hav fült de verld med hatrid; hit hav ledet us to elend and blutsketrid. Vi hav utvikelt raskhed, dok ur gester stan stil. Vi lat makiner verke fur us; ur vetrid hav makt us hokmudig and ur klughed hard and unfrendlik; vi denk altu mang and föl altu lit. Dok mer den makiner vi treng manlikhed; mer den klughed vi treng frendlikhed and gudhed. An dis egenheder, ur levrid ar frükridig and al ding ar lost.</p> |
|
8 |
+ <p>Med de helprid av flügtüger and de radio vi ar narer en to de ander den et tid ruk. De manskap treng enhed and en alvar arend bruderlikhed fur tu bruke dis utfindunger gud. Selv no mang tused in der verld kön höre min stem, mang tusend fartvivelt verer, kviner and smal kinder — ofarunger av en sistem, vilk fang and kvel unskuldig maner. Ek rup to al, vilk kön hör mek no: Fartvivel nit! De elend skal farsvinde, van de gridhed farsvind and de biterhed av maner, vilk frük de manskaps forskritrid. De Maners hatrid skal farsvinde and diktarorer skal döe. Dan de kraft, vilk di hav takt fra de folk, skal kome bak to de folk. Selv ef mang blud ar sketet: Tu kempe fur de frihed ar en gud sak.</p> |
|
9 |
+ <p>Kemparer: Kemp nit fur tiraner; maner, vilk farakt ju and mak ju to sklaver; vilk vertskat nit jer levrid, vilk seg to ju, vat je skal make, true and föle! Di skend ju, föd ju, behandel ju lik kanon-födung. Kemp nit fur dis fardervt maner — makin-maner med makin-hövder and makin-herter! Je ar nit makiner, je ar nit direr, je ar maner. Lat de manlikhed blive ine jer herter! Je skal nit hate; bar de unlivt hat, de unlivt and de fardervt.</p> |
|
10 |
+ <p>Kemperar: Kemp nit fur de sklavskap! Kemp fur de frihed! Ine de 17. avsnidung av de hajlig Lukas ar skrivt: ‚God ar ine al maner.‘ — nit bar ine en grup av maner, insted ine al maner, ine ju. Je, de folk, hav de kraft; de kraft fur tu bue vapener, dok ok de kraft fur tu sprede gladhed. Je, de folk, hav de kraft fur tu make dis levrid fri and skön, fur tu make dis levrid en vunderfült sak. Darfur: Ine de nam av folkherskrid: Lat us bruke dis kraft! Lat us verde en! Lat us kempe fur en nü verld, fur en beter verld, vilk giv to de maner magrid tu verke, vilk giv en eftertid to de jung and sikerhed to de old. Ok de tiraner hav truent dis to us fur tu foe de vold, dok di hav lügt. Di mak nit sant dir luvung, di ing tid vil. Tiraner frien bar sek selv, dok de folk skal blive sklaver.</p> |
|
11 |
+ <p>Lat us no kempe fur tu upfüle dis luvung. Lat us kempe fur tu make de verld fri, fur tu uvervinde landmarker, gridhed, hatrid and de untillatrid. Lat us kempe fur en verld med farstanrid, en verld, var vetridskap and forskritrid skal lede to al mans gladhed.</p> |
|
12 | 12 |
<p>Kemparer: Ine de nam av folkherskrid: Lat us al verde en!</p> |
13 | 13 |
</span> |
14 | 14 |
<p>An attempt to translate the final speech from the famous Charlie Chaplin movie "The great dictator" (with some passages inspired by the German translation); the English original can be listened to <a href="https://www.youtube.com/watch?v=ibVpDhW6kDQ">on youtube</a>; or in case you'd like to hear a more heart-wrenching version: <a href="https://www.youtube.com/watch?v=Gaq62VCcnew">accompanied by "Hans Zimmer - Time"</a>.</p> |
... | ... |
@@ -71,7 +71,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f |
71 | 71 |
} |
72 | 72 |
} |
73 | 73 |
{ |
74 |
- if (false) |
|
74 |
+ if (true) |
|
75 | 75 |
{ |
76 | 76 |
$data = sql_cross($data, $data_common["cases"]); |
77 | 77 |
$data = sql_select($data, function ($row) {return ($row["case_id"] == $row["id"]);}); |
... | ... |
@@ -87,6 +87,7 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f |
87 | 87 |
|
88 | 88 |
{ |
89 | 89 |
// $data = sql_select($data, function ($row) {return ($row["case_name"] != "pos");}); |
90 |
+ $data = sql_select($data, function ($row) {global $configuration; return (($row["language_id"] == "fs") or ($row["language_id"] == $configuration["target"]));}); |
|
90 | 91 |
} |
91 | 92 |
|
92 | 93 |
$table = new class_table |
... | ... |
@@ -103,12 +104,13 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f |
103 | 104 |
$data |
104 | 105 |
); |
105 | 106 |
|
106 |
- $table = $table->snap |
|
107 |
+ $table->snap |
|
107 | 108 |
( |
108 | 109 |
[ |
109 | 110 |
"label_vertical" => function ($column) {return "";}, |
110 | 111 |
"columns_vertical" => |
111 | 112 |
[ |
113 |
+ $table->columns_get()[4], |
|
112 | 114 |
$table->columns_get()[1], |
113 | 115 |
$table->columns_get()[2], |
114 | 116 |
$table->columns_get()[3], |
... | ... |
@@ -116,7 +118,6 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f |
116 | 118 |
"label_horizontal" => function ($column, $value) {return $value;}, |
117 | 119 |
"columns_horizontal" => |
118 | 120 |
[ |
119 |
- $table->columns_get()[4], |
|
120 | 121 |
$table->columns_get()[5], |
121 | 122 |
], |
122 | 123 |
"columns_data" => |
... | ... |
@@ -139,12 +140,27 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f |
139 | 140 |
} |
140 | 141 |
case 1: |
141 | 142 |
{ |
143 |
+ global $configuration; |
|
144 |
+ $value_ = []; |
|
145 |
+ foreach (["fs",$configuration["target"]] as $language_id) |
|
146 |
+ { |
|
147 |
+ $value_[$language_id] = array_reduce |
|
148 |
+ ( |
|
149 |
+ array_map |
|
150 |
+ ( |
|
151 |
+ function ($dataset) {return $dataset["words"];}, |
|
152 |
+ array_filter($value, function ($dataset) use (&$language_id) {return ($dataset["language_id"] == $language_id);}) |
|
153 |
+ ), |
|
154 |
+ function ($x, $y) {return array_merge($x, $y);}, |
|
155 |
+ [] |
|
156 |
+ ); |
|
157 |
+ } |
|
142 | 158 |
return ( |
143 | 159 |
_bar("word") |
144 | 160 |
( |
145 | 161 |
[ |
146 |
- "original" => $value[0]["words"], |
|
147 |
- "translated" => $value[1]["words"], |
|
162 |
+ "original" => $value_["fs"], |
|
163 |
+ "translated" => $value_[$configuration["target"]], |
|
148 | 164 |
] |
149 | 165 |
) |
150 | 166 |
); |
... | ... |
@@ -158,9 +174,10 @@ function convert_genus($genus) {return [0 => "common", 1 => "masculine", 2 => "f |
158 | 174 |
} |
159 | 175 |
}, |
160 | 176 |
] |
161 |
- ); |
|
162 |
- $table->generate(); |
|
177 |
+ )->generate(); |
|
163 | 178 |
?> |
164 |
- <p>For the flected and otherwise related forms of the personal pronouns see the section <a href="#declension">Declension</a>.</p> |
|
179 |
+ <p>Since the word <span class="word lang_fs">man</span> simply means <span class="word lang_en">human being</span>, it can be understood as an implicit way to express an abstract actor; similar words like <span class="word lang_fs">lüd</span> (<span class="word lang_en">people</span>) or <span class="word lang_fs">di</span> can be used as well.</p> |
|
180 |
+ <div class="note_information">The honorific salutation is expressed by the plural form <span class="word lang_fs">je</span>; however it should be avoided in usual speech in favor of the singular form <span class="word lang_fs">du</span>.</div> |
|
181 |
+ <div class="note_information">A reflexive genitive can be formed by inserting the word <span class="word lang_fs">egen</span> (<span class="word lang_en">own</span>), for example <span class="sentence lang_fs">Han[A] hav givt to ham[B] hans egen buk.</span> ~ <span class="sentence lang_en">He[A] has given (to) him[B] his own book.</span> (A's book was given to B).</div> |
|
165 | 182 |
</section> |
166 | 183 |
|
... | ... |
@@ -19,9 +19,9 @@ |
19 | 19 |
{"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["man"]}, |
20 | 20 |
{"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["mek"]}, |
21 | 21 |
{"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["dek"]}, |
22 |
- {"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": ["hen"]}, |
|
23 |
- {"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["han"]}, |
|
24 |
- {"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["hun"]}, |
|
22 |
+ {"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": ["hem"]}, |
|
23 |
+ {"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["ham"]}, |
|
24 |
+ {"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["hum"]}, |
|
25 | 25 |
{"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["hit"]}, |
26 | 26 |
{"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["maner"]}, |
27 | 27 |
{"language_id": "fs", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["us"]}, |
... | ... |
@@ -30,9 +30,9 @@ |
30 | 30 |
{"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["to man"]}, |
31 | 31 |
{"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["to mek"]}, |
32 | 32 |
{"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["to dek"]}, |
33 |
- {"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": ["to hen"]}, |
|
34 |
- {"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["to han"]}, |
|
35 |
- {"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["to hun"]}, |
|
33 |
+ {"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": ["to hem"]}, |
|
34 |
+ {"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["to ham"]}, |
|
35 |
+ {"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["to hum"]}, |
|
36 | 36 |
{"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["to hit"]}, |
37 | 37 |
{"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["to maner"]}, |
38 | 38 |
{"language_id": "fs", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["to us"]}, |
... | ... |
@@ -126,17 +126,17 @@ |
126 | 126 |
{"language_id": "en", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["us"]}, |
127 | 127 |
{"language_id": "en", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["you (all)"]}, |
128 | 128 |
{"language_id": "en", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["them"]}, |
129 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["to one","to you"]}, |
|
130 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["to me"]}, |
|
131 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["to you","to thee"]}, |
|
129 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["(to) one","(to) you"]}, |
|
130 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["(to) me"]}, |
|
131 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["(to) you","(to) thee"]}, |
|
132 | 132 |
{"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
133 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["to him"]}, |
|
134 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["to her"]}, |
|
135 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["to it"]}, |
|
136 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["to you","to them"]}, |
|
137 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["to us"]}, |
|
138 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["to you (all)"]}, |
|
139 |
- {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["to them"]}, |
|
133 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["(to) him"]}, |
|
134 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["(to) her"]}, |
|
135 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["(to) it"]}, |
|
136 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["(to) you","(to) them"]}, |
|
137 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["(to) us"]}, |
|
138 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["(to) you (all)"]}, |
|
139 |
+ {"language_id": "en", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["(to) them"]}, |
|
140 | 140 |
{"language_id": "en", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["oneself","yourself"]}, |
141 | 141 |
{"language_id": "en", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["myself"]}, |
142 | 142 |
{"language_id": "en", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["yourself"]}, |
... | ... |
@@ -148,61 +148,160 @@ |
148 | 148 |
{"language_id": "en", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["ourselves"]}, |
149 | 149 |
{"language_id": "en", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["yourselves"]}, |
150 | 150 |
{"language_id": "en", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["themselves"]}, |
151 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["to oneself","to yourself"]}, |
|
152 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["to myself"]}, |
|
153 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["to yourself"]}, |
|
151 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["(to) oneself","(to) yourself"]}, |
|
152 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["(to) myself"]}, |
|
153 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["(to) yourself"]}, |
|
154 | 154 |
{"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
155 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["to himself"]}, |
|
156 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["to herself"]}, |
|
157 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["to itself"]}, |
|
158 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["to themselves","to yourselves"]}, |
|
159 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["to ourselves"]}, |
|
160 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["to yourselves"]}, |
|
161 |
- {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["to themselves"]}, |
|
162 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["ones","your"]}, |
|
163 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["my"]}, |
|
164 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["your"]}, |
|
155 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["(to) himself"]}, |
|
156 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["(to) herself"]}, |
|
157 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["(to) itself"]}, |
|
158 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["(to) themselves","(to)to yourselves"]}, |
|
159 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["(to) ourselves"]}, |
|
160 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["(to) yourselves"]}, |
|
161 |
+ {"language_id": "en", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["(to) themselves"]}, |
|
162 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["one's","your"]}, |
|
163 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["my/mine"]}, |
|
164 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["your/yours","thy/thine"]}, |
|
165 | 165 |
{"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
166 | 166 |
{"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["his"]}, |
167 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["her"]}, |
|
167 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["her/hers"]}, |
|
168 | 168 |
{"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["its"]}, |
169 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["their","your"]}, |
|
170 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["our"]}, |
|
171 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["your"]}, |
|
172 |
- {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["their"]}, |
|
173 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["ones","your"]}, |
|
174 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["my"]}, |
|
175 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["your"]}, |
|
169 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["their/theirs","your/yours"]}, |
|
170 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["our/ours"]}, |
|
171 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["your/yours"]}, |
|
172 |
+ {"language_id": "en", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["their/theirs"]}, |
|
173 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["one's","your/yours"]}, |
|
174 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["my/mine"]}, |
|
175 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["your/yours","thy/thine"]}, |
|
176 | 176 |
{"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
177 | 177 |
{"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["his"]}, |
178 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["her"]}, |
|
178 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["her/hers"]}, |
|
179 | 179 |
{"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["its"]}, |
180 | 180 |
{"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["their","your"]}, |
181 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["our"]}, |
|
182 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["your"]}, |
|
183 |
- {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["their"]}, |
|
184 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["to ones","to your"]}, |
|
185 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["to my"]}, |
|
186 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["to your"]}, |
|
181 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["our/ours"]}, |
|
182 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["your/yours"]}, |
|
183 |
+ {"language_id": "en", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["their/theirs"]}, |
|
184 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["(to) one's","(to) your/yours"]}, |
|
185 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["(to) my/mine"]}, |
|
186 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["(to) your/yours","(to) thy/thine"]}, |
|
187 | 187 |
{"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
188 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["to his"]}, |
|
189 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["to her"]}, |
|
190 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["to its"]}, |
|
191 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["to their","to your"]}, |
|
192 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["to our"]}, |
|
193 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["to your"]}, |
|
194 |
- {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["to their"]}, |
|
195 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["of ones","of your"]}, |
|
196 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["of my"]}, |
|
197 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["of your"]}, |
|
188 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["(to) his"]}, |
|
189 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["(to) her/hers"]}, |
|
190 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["(to) its"]}, |
|
191 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["(to) their/theirs","(to) your/yours"]}, |
|
192 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["(to) our/ours"]}, |
|
193 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["(to) your/yours"]}, |
|
194 |
+ {"language_id": "en", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["(to) their/theirs"]}, |
|
195 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["of one's","of your/yours"]}, |
|
196 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["of my/mine"]}, |
|
197 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["of your/yours"]}, |
|
198 | 198 |
{"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
199 | 199 |
{"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["of his"]}, |
200 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["of her"]}, |
|
200 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["of her/hers"]}, |
|
201 | 201 |
{"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["of its"]}, |
202 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["of their","of your"]}, |
|
203 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["of our"]}, |
|
204 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["of your"]}, |
|
205 |
- {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["of their"]} |
|
202 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["of their/theirs","of your/yours"]}, |
|
203 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["of our/ours"]}, |
|
204 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["of your/yours"]}, |
|
205 |
+ {"language_id": "en", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["of their/theirs"]}, |
|
206 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["man"]}, |
|
207 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["ich"]}, |
|
208 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["du"]}, |
|
209 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
210 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["er"]}, |
|
211 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["sie"]}, |
|
212 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["es"]}, |
|
213 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": ["man"]}, |
|
214 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["wir"]}, |
|
215 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["ihr"]}, |
|
216 |
+ {"language_id": "de", "type_id": "nor", "case_id": "nom", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["sie"]}, |
|
217 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["einen"]}, |
|
218 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["mich"]}, |
|
219 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["dich"]}, |
|
220 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
221 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["ihn"]}, |
|
222 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["sie"]}, |
|
223 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["es"]}, |
|
224 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
225 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["uns"]}, |
|
226 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["euch"]}, |
|
227 |
+ {"language_id": "de", "type_id": "nor", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["sie"]}, |
|
228 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["einem"]}, |
|
229 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["mir"]}, |
|
230 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["dir"]}, |
|
231 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
232 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["ihm"]}, |
|
233 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["ihr"]}, |
|
234 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["ihm"]}, |
|
235 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
236 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["uns"]}, |
|
237 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["euch"]}, |
|
238 |
+ {"language_id": "de", "type_id": "nor", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["ihnen"]}, |
|
239 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["sich"]}, |
|
240 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["mich"]}, |
|
241 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["dich"]}, |
|
242 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": ["sich"]}, |
|
243 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["sich"]}, |
|
244 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["sich"]}, |
|
245 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["sich"]}, |
|
246 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
247 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["uns"]}, |
|
248 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["euch"]}, |
|
249 |
+ {"language_id": "de", "type_id": "ref", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["sich"]}, |
|
250 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": ["(zu) sich"]}, |
|
251 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["(zu) mir"]}, |
|
252 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["(zu) dir"]}, |
|
253 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
254 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["(zu) sich"]}, |
|
255 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["(zu) sich"]}, |
|
256 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["(zu) sich"]}, |
|
257 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
258 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["(zu) uns"]}, |
|
259 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["(zu) euch"]}, |
|
260 |
+ {"language_id": "de", "type_id": "ref", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["(zu) sich"]}, |
|
261 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": []}, |
|
262 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["mein"]}, |
|
263 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["dein"]}, |
|
264 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
265 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["sein/seine/sein"]}, |
|
266 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["ihr/ihre/ihr"]}, |
|
267 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["sein/seine/sein"]}, |
|
268 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
269 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["unser/unser/unser"]}, |
|
270 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["euer/eure/euer"]}, |
|
271 |
+ {"language_id": "de", "type_id": "pos", "case_id": "nom", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["ihr/ihre/ihr","deren"]}, |
|
272 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": []}, |
|
273 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["meinen/meine/mein"]}, |
|
274 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["deinen/deine/dein"]}, |
|
275 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
276 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["seinen/seine/sein"]}, |
|
277 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["ihren/ihre/ihr"]}, |
|
278 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["seinen/seine/sein"]}, |
|
279 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
280 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["unseren/unsere/unser"]}, |
|
281 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["euren/eure/euer"]}, |
|
282 |
+ {"language_id": "de", "type_id": "pos", "case_id": "acc", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["ihren/ihre/ihr","deren"]}, |
|
283 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": []}, |
|
284 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["(zu) meinem/meiner/meinem"]}, |
|
285 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["(zu) deinem/deiner/deinem"]}, |
|
286 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
287 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["(zu) seinem/seiner/seinem"]}, |
|
288 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["(zu) ihrem/ihrer/ihrem"]}, |
|
289 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["(zu) seinem/seiner/seinem"]}, |
|
290 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
291 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["(zu) unserem/unserer/unserem"]}, |
|
292 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["(zu) eurem/eurer/eurem"]}, |
|
293 |
+ {"language_id": "de", "type_id": "pos", "case_id": "dat", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["(zu) ihrem/ihrer/ihrem","(zu) deren"]}, |
|
294 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "imp", "gender_id": "com", "words": []}, |
|
295 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "1st", "gender_id": "com", "words": ["von meinem/meiner/meinem","meines"]}, |
|
296 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "2nd", "gender_id": "com", "words": ["von deinem/deiner/deinem","deines"]}, |
|
297 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "com", "words": []}, |
|
298 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "mas", "words": ["von seinem/seiner/seinem","seines"]}, |
|
299 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "fem", "words": ["von ihrem/ihrer/ihrem","ihres"]}, |
|
300 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "sin", "person_id": "3rd", "gender_id": "neu", "words": ["von seinem/seiner/seinem","seines"]}, |
|
301 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "imp", "gender_id": "com", "words": []}, |
|
302 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "1st", "gender_id": "com", "words": ["von unserem/unserer/unserem","unseres"]}, |
|
303 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "2nd", "gender_id": "com", "words": ["von eurem/eurer/eurem"]}, |
|
304 |
+ {"language_id": "de", "type_id": "pos", "case_id": "gen", "count_id": "plu", "person_id": "3rd", "gender_id": "com", "words": ["von ihrem/ihrer/ihrem","von deren"]} |
|
206 | 305 |
] |
207 | 306 |
} |
208 | 307 |
|
... | ... |
@@ -166,116 +166,5 @@ |
166 | 166 |
return $table_result; |
167 | 167 |
} |
168 | 168 |
|
169 |
- /* |
|
170 |
- |
|
171 |
- +------+------+------+ |
|
172 |
- | xA | xB | xC | |
|
173 |
- +------+------+------+ |
|
174 |
- | a2 | b1 | c3 | |
|
175 |
- +------+------+------+ |
|
176 |
- | a1 | b1 | c0 | |
|
177 |
- +------+------+------+ |
|
178 |
- | a1 | b3 | c2 | |
|
179 |
- +------+------+------+ |
|
180 |
- | a2 | b2 | c4 | |
|
181 |
- +------+------+------+ |
|
182 |
- | a1 | b2 | c1 | |
|
183 |
- +------+------+------+ |
|
184 |
- | a2 | b4 | c5 | |
|
185 |
- +------+------+------+ |
|
186 |
- |
|
187 |
- +------+------+------+ |
|
188 |
- | xA | xB | xC | |
|
189 |
- +------+------+------+ |
|
190 |
- | a1 | b1 | c0 | |
|
191 |
- +------+------+------+ |
|
192 |
- | a1 | b2 | c1 | |
|
193 |
- +------+------+------+ |
|
194 |
- | a1 | b3 | c2 | |
|
195 |
- +------+------+------+ |
|
196 |
- | a2 | b1 | c3 | |
|
197 |
- +------+------+------+ |
|
198 |
- | a2 | b2 | c4 | |
|
199 |
- +------+------+------+ |
|
200 |
- | a2 | b4 | c5 | |
|
201 |
- +------+------+------+ |
|
202 |
- |
|
203 |
- +------+------+------+ |
|
204 |
- | xA | xB | xC | |
|
205 |
- +------+------+------+ |
|
206 |
- | a1 | b1 | c0 | |
|
207 |
- | +------+------+ |
|
208 |
- | | b2 | c1 | |
|
209 |
- | +------+------+ |
|
210 |
- | | b3 | c2 | |
|
211 |
- +------+------+------+ |
|
212 |
- | a2 | b1 | c3 | |
|
213 |
- | +------+------+ |
|
214 |
- | | b2 | c4 | |
|
215 |
- | +------+------+ |
|
216 |
- | | b4 | c5 | |
|
217 |
- +------+------+------+ |
|
218 |
- |
|
219 |
- +------+------+------+------+------+ |
|
220 |
- | xA | xB:b1| xB:b2| xB:b3| xB:b4| |
|
221 |
- +------+------+------+------+------+ |
|
222 |
- | a1 | c0 | c1 | c2 | -- | |
|
223 |
- +------+------+------+------+------+ |
|
224 |
- | a2 | c3 | c4 | -- | c5 | |
|
225 |
- +------+------+------+------+------+ |
|
226 |
- |
|
227 |
- */ |
|
228 |
- function sql_snap($table_source, $column_vertical, $column_horizontal, $column_data) |
|
229 |
- { |
|
230 |
- $values = []; |
|
231 |
- array_map |
|
232 |
- ( |
|
233 |
- function ($row) use (&$values,&$column_horizontal) |
|
234 |
- { |
|
235 |
- $value = $row[$column_horizontal]; |
|
236 |
- if (array_search($value, $values) === false) array_push($values, $value); |
|
237 |
- }, |
|
238 |
- $table_source |
|
239 |
- ); |
|
240 |
- $groups = sql_groups($table_source, $column_vertical); |
|
241 |
- // print(json_encode(array_slice($groups, 0, 2)) . "\n"); |
|
242 |
- $table_result = array_map |
|
243 |
- ( |
|
244 |
- function ($group) use (&$column_vertical,&$column_horizontal,&$column_data,&$values) |
|
245 |
- { |
|
246 |
- $row = []; |
|
247 |
- $row[$column_vertical] = $group["value"]; |
|
248 |
- array_map |
|
249 |
- ( |
|
250 |
- function ($value) use (&$row) |
|
251 |
- { |
|
252 |
- $row[$value] = []; |
|
253 |
- }, |
|
254 |
- $values |
|
255 |
- ); |
|
256 |
- array_map |
|
257 |
- ( |
|
258 |
- function ($member) use (&$column_horizontal,&$column_data,&$row) |
|
259 |
- { |
|
260 |
- $value = $member[$column_horizontal]; |
|
261 |
- $data = $member[$column_data]; |
|
262 |
- // print("-- adding value " . json_encode($data) . " for field " . $value . " to dataset " . json_encode($row) . "\n"); |
|
263 |
- array_push($row[$value], $data); |
|
264 |
- }, |
|
265 |
- $group["members"] |
|
266 |
- ); |
|
267 |
- return $row; |
|
268 |
- }, |
|
269 |
- $groups |
|
270 |
- ); |
|
271 |
- return $table_result; |
|
272 |
- } |
|
273 |
- |
|
274 |
- /* |
|
275 |
- function sql_sort($table_source, $column) |
|
276 |
- { |
|
277 |
- |
|
278 |
- } |
|
279 |
- */ |
|
280 | 169 |
?> |
281 | 170 |
|
... | ... |
@@ -63,6 +63,63 @@ class class_table |
63 | 63 |
); |
64 | 64 |
} |
65 | 65 |
|
66 |
+ /* |
|
67 |
+ +------+------+------+ |
|
68 |
+ | xA | xB | xC | |
|
69 |
+ +------+------+------+ |
|
70 |
+ | a2 | b1 | c3 | |
|
71 |
+ +------+------+------+ |
|
72 |
+ | a1 | b1 | c0 | |
|
73 |
+ +------+------+------+ |
|
74 |
+ | a1 | b3 | c2 | |
|
75 |
+ +------+------+------+ |
|
76 |
+ | a2 | b2 | c4 | |
|
77 |
+ +------+------+------+ |
|
78 |
+ | a1 | b2 | c1 | |
|
79 |
+ +------+------+------+ |
|
80 |
+ | a2 | b4 | c5 | |
|
81 |
+ +------+------+------+ |
|
82 |
+ |
|
83 |
+ +------+------+------+ |
|
84 |
+ | xA | xB | xC | |
|
85 |
+ +------+------+------+ |
|
86 |
+ | a1 | b1 | c0 | |
|
87 |
+ +------+------+------+ |
|
88 |
+ | a1 | b2 | c1 | |
|
89 |
+ +------+------+------+ |
|
90 |
+ | a1 | b3 | c2 | |
|
91 |
+ +------+------+------+ |
|
92 |
+ | a2 | b1 | c3 | |
|
93 |
+ +------+------+------+ |
|
94 |
+ | a2 | b2 | c4 | |
|
95 |
+ +------+------+------+ |
|
96 |
+ | a2 | b4 | c5 | |
|
97 |
+ +------+------+------+ |
|
98 |
+ |
|
99 |
+ +------+------+------+ |
|
100 |
+ | xA | xB | xC | |
|
101 |
+ +------+------+------+ |
|
102 |
+ | a1 | b1 | c0 | |
|
103 |
+ | +------+------+ |
|
104 |
+ | | b2 | c1 | |
|
105 |
+ | +------+------+ |
|
106 |
+ | | b3 | c2 | |
|
107 |
+ +------+------+------+ |
|
108 |
+ | a2 | b1 | c3 | |
|
109 |
+ | +------+------+ |
|
110 |
+ | | b2 | c4 | |
|
111 |
+ | +------+------+ |
|
112 |
+ | | b4 | c5 | |
|
113 |
+ +------+------+------+ |
|
114 |
+ |
|
115 |
+ +------+------+------+------+------+ |
|
116 |
+ | xA | xB:b1| xB:b2| xB:b3| xB:b4| |
|
117 |
+ +------+------+------+------+------+ |
|
118 |
+ | a1 | c0 | c1 | c2 | -- | |
|
119 |
+ +------+------+------+------+------+ |
|
120 |
+ | a2 | c3 | c4 | -- | c5 | |
|
121 |
+ +------+------+------+------+------+ |
|
122 |
+ */ |
|
66 | 123 |
public function snap($configuration) |
67 | 124 |
{ |
68 | 125 |
$columns_vertical = fetch($configuration, "columns_vertical", null, 2); |
... | ... |
@@ -0,0 +1,2848 @@ |
1 |
+var __extends = (this && this.__extends) || function (d, b) { |
|
2 |
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; |
|
3 |
+ function __() { this.constructor = d; } |
|
4 |
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
|
5 |
+}; |
|
6 |
+var _child_process = require("child_process"); |
|
7 |
+var _fs = require("fs"); |
|
8 |
+var configuration = {}; |
|
9 |
+/** |
|
10 |
+ * @author fenris |
|
11 |
+ */ |
|
12 |
+function indentation(depth, symbol) { |
|
13 |
+ if (symbol === void 0) { symbol = "\t"; } |
|
14 |
+ return ((depth == 0) ? "" : (symbol + indentation(depth - 1, symbol))); |
|
15 |
+} |
|
16 |
+/** |
|
17 |
+ * @author fenris |
|
18 |
+ */ |
|
19 |
+var class_message = (function () { |
|
20 |
+ /** |
|
21 |
+ * @author fenris |
|
22 |
+ */ |
|
23 |
+ function class_message(content, parameters) { |
|
24 |
+ if (parameters === void 0) { parameters = {}; } |
|
25 |
+ /** |
|
26 |
+ * @author fenris |
|
27 |
+ */ |
|
28 |
+ this.depth = 0; |
|
29 |
+ if (parameters.prefix == undefined) |
|
30 |
+ parameters.prefix = null; |
|
31 |
+ if (parameters.type == undefined) |
|
32 |
+ parameters.type = null; |
|
33 |
+ if (parameters.depth == undefined) |
|
34 |
+ parameters.depth = 0; |
|
35 |
+ if (parameters.linebreak == undefined) |
|
36 |
+ parameters.linebreak = false; |
|
37 |
+ this.content = content; |
|
38 |
+ this.type = parameters.type; |
|
39 |
+ this.depth = parameters.depth; |
|
40 |
+ this.prefix = parameters.prefix; |
|
41 |
+ this.linebreak = parameters.linebreak; |
|
42 |
+ } |
|
43 |
+ /** |
|
44 |
+ * @author fenris |
|
45 |
+ */ |
|
46 |
+ class_message.prototype.generate = function (with_type) { |
|
47 |
+ if (with_type === void 0) { with_type = true; } |
|
48 |
+ var output = ""; |
|
49 |
+ output += indentation(this.depth); |
|
50 |
+ if (with_type) { |
|
51 |
+ if (this.type != null) { |
|
52 |
+ output += ("[" + this.type + "]" + " "); |
|
53 |
+ } |
|
54 |
+ } |
|
55 |
+ if (this.prefix != null) { |
|
56 |
+ output += ("<" + this.prefix + ">" + " "); |
|
57 |
+ } |
|
58 |
+ output += this.content; |
|
59 |
+ if (this.linebreak) { |
|
60 |
+ output += "\n"; |
|
61 |
+ } |
|
62 |
+ return output; |
|
63 |
+ }; |
|
64 |
+ /** |
|
65 |
+ * @author fenris |
|
66 |
+ */ |
|
67 |
+ class_message.prototype.stdout = function () { |
|
68 |
+ console.log(this.generate(true)); |
|
69 |
+ }; |
|
70 |
+ /** |
|
71 |
+ * @author fenris |
|
72 |
+ */ |
|
73 |
+ class_message.prototype.stderr = function () { |
|
74 |
+ console.error(this.generate(true)); |
|
75 |
+ }; |
|
76 |
+ /** |
|
77 |
+ * @author fenris |
|
78 |
+ */ |
|
79 |
+ class_message.prototype.console = function () { |
|
80 |
+ switch (this.type) { |
|
81 |
+ case "log": { |
|
82 |
+ console.log(this.generate(false)); |
|
83 |
+ break; |
|
84 |
+ } |
|
85 |
+ case "information": { |
|
86 |
+ console.info(this.generate(false)); |
|
87 |
+ break; |
|
88 |
+ } |
|
89 |
+ case "warning": { |
|
90 |
+ console.warn(this.generate(false)); |
|
91 |
+ break; |
|
92 |
+ } |
|
93 |
+ case "error": { |
|
94 |
+ console.error(this.generate(false)); |
|
95 |
+ break; |
|
96 |
+ } |
|
97 |
+ default: { |
|
98 |
+ throw (new Error("unhandled type '" + this.type + "'")); |
|
99 |
+ } |
|
100 |
+ } |
|
101 |
+ }; |
|
102 |
+ return class_message; |
|
103 |
+}()); |
|
104 |
+/** |
|
105 |
+ * @author fenris |
|
106 |
+ */ |
|
107 |
+var class_cliout = (function () { |
|
108 |
+ function class_cliout() { |
|
109 |
+ } |
|
110 |
+ /** |
|
111 |
+ * @author fenris |
|
112 |
+ */ |
|
113 |
+ class_cliout.stdout = function (content, depth) { |
|
114 |
+ if (depth === void 0) { depth = 0; } |
|
115 |
+ console.log(indentation(depth) + content); |
|
116 |
+ }; |
|
117 |
+ /** |
|
118 |
+ * @author fenris |
|
119 |
+ */ |
|
120 |
+ class_cliout.stderr = function (content, depth) { |
|
121 |
+ if (depth === void 0) { depth = 0; } |
|
122 |
+ console.error(indentation(depth) + content); |
|
123 |
+ }; |
|
124 |
+ /** |
|
125 |
+ * @author fenris |
|
126 |
+ */ |
|
127 |
+ class_cliout.log = function (content, depth) { |
|
128 |
+ if (depth === void 0) { depth = 0; } |
|
129 |
+ this.stderr("-- " + content, depth); |
|
130 |
+ }; |
|
131 |
+ /** |
|
132 |
+ * @author fenris |
|
133 |
+ */ |
|
134 |
+ class_cliout.info = function (content, depth) { |
|
135 |
+ if (depth === void 0) { depth = 0; } |
|
136 |
+ this.stderr(">> " + content, depth); |
|
137 |
+ }; |
|
138 |
+ /** |
|
139 |
+ * @author fenris |
|
140 |
+ */ |
|
141 |
+ class_cliout.warn = function (content, depth) { |
|
142 |
+ if (depth === void 0) { depth = 0; } |
|
143 |
+ this.stderr(">> " + content, depth); |
|
144 |
+ }; |
|
145 |
+ /** |
|
146 |
+ * @author fenris |
|
147 |
+ */ |
|
148 |
+ class_cliout.error = function (content, depth) { |
|
149 |
+ if (depth === void 0) { depth = 0; } |
|
150 |
+ this.stderr(">> " + content, depth); |
|
151 |
+ }; |
|
152 |
+ return class_cliout; |
|
153 |
+}()); |
|
154 |
+/** |
|
155 |
+ * @author fenris |
|
156 |
+ */ |
|
157 |
+var class_graph = (function () { |
|
158 |
+ /** |
|
159 |
+ * @author fenris |
|
160 |
+ */ |
|
161 |
+ function class_graph(nodes, edges) { |
|
162 |
+ if (nodes === void 0) { nodes = []; } |
|
163 |
+ if (edges === void 0) { edges = []; } |
|
164 |
+ this.nodes = nodes; |
|
165 |
+ this.edges = edges; |
|
166 |
+ } |
|
167 |
+ /** |
|
168 |
+ * @author fenris |
|
169 |
+ */ |
|
170 |
+ class_graph.prototype.without = function (pivot) { |
|
171 |
+ return (new class_graph(this.nodes.filter(function (node) { return (node != pivot); }), this.edges.filter(function (edge) { return ((edge.from != pivot) && (edge.to != pivot)); }))); |
|
172 |
+ }; |
|
173 |
+ return class_graph; |
|
174 |
+}()); |
|
175 |
+/** |
|
176 |
+ * @author fenris |
|
177 |
+ */ |
|
178 |
+function topsort(graph) { |
|
179 |
+ if (graph.nodes.length == 0) { |
|
180 |
+ return []; |
|
181 |
+ } |
|
182 |
+ else { |
|
183 |
+ var pivot_1; |
|
184 |
+ var found = graph.nodes.some(function (node) { |
|
185 |
+ var count = graph.edges.filter(function (edge) { return (edge.to == node); }).length; |
|
186 |
+ if (count == 0) { |
|
187 |
+ pivot_1 = node; |
|
188 |
+ return true; |
|
189 |
+ } |
|
190 |
+ else { |
|
191 |
+ // console.info("'" + String(node) + "' has " + count.toString() + " incoming edges"); |
|
192 |
+ return false; |
|
193 |
+ } |
|
194 |
+ }); |
|
195 |
+ if (found) { |
|
196 |
+ return [pivot_1].concat(topsort(graph.without(pivot_1))); |
|
197 |
+ } |
|
198 |
+ else { |
|
199 |
+ throw (new Error("circular dependencies found")); |
|
200 |
+ } |
|
201 |
+ } |
|
202 |
+} |
|
203 |
+/** |
|
204 |
+ * @author fenris |
|
205 |
+ */ |
|
206 |
+var lib_xml; |
|
207 |
+(function (lib_xml) { |
|
208 |
+ /** |
|
209 |
+ * @author fenris |
|
210 |
+ */ |
|
211 |
+ var class_node = (function () { |
|
212 |
+ function class_node() { |
|
213 |
+ } |
|
214 |
+ return class_node; |
|
215 |
+ }()); |
|
216 |
+ lib_xml.class_node = class_node; |
|
217 |
+ /** |
|
218 |
+ * @author fenris |
|
219 |
+ */ |
|
220 |
+ var class_node_text = (function (_super) { |
|
221 |
+ __extends(class_node_text, _super); |
|
222 |
+ /** |
|
223 |
+ * @author fenris |
|
224 |
+ */ |
|
225 |
+ function class_node_text(content) { |
|
226 |
+ _super.call(this); |
|
227 |
+ this.content = content; |
|
228 |
+ } |
|
229 |
+ /** |
|
230 |
+ * @author fenris |
|
231 |
+ */ |
|
232 |
+ class_node_text.prototype.compile = function (depth) { |
|
233 |
+ if (depth === void 0) { depth = 0; } |
|
234 |
+ return (indentation(depth) + this.content + "\n"); |
|
235 |
+ }; |
|
236 |
+ return class_node_text; |
|
237 |
+ }(class_node)); |
|
238 |
+ lib_xml.class_node_text = class_node_text; |
|
239 |
+ /** |
|
240 |
+ * @author fenris |
|
241 |
+ */ |
|
242 |
+ var class_node_comment = (function (_super) { |
|
243 |
+ __extends(class_node_comment, _super); |
|
244 |
+ /** |
|
245 |
+ * @author fenris |
|
246 |
+ */ |
|
247 |
+ function class_node_comment(content) { |
|
248 |
+ _super.call(this); |
|
249 |
+ this.content = content; |
|
250 |
+ } |
|
251 |
+ /** |
|
252 |
+ * @author fenris |
|
253 |
+ */ |
|
254 |
+ class_node_comment.prototype.compile = function (depth) { |
|
255 |
+ if (depth === void 0) { depth = 0; } |
|
256 |
+ return (indentation(depth) + "<!-- " + this.content + " -->" + "\n"); |
|
257 |
+ }; |
|
258 |
+ return class_node_comment; |
|
259 |
+ }(class_node)); |
|
260 |
+ lib_xml.class_node_comment = class_node_comment; |
|
261 |
+ /** |
|
262 |
+ * @author fenris |
|
263 |
+ */ |
|
264 |
+ var class_node_complex = (function (_super) { |
|
265 |
+ __extends(class_node_complex, _super); |
|
266 |
+ /** |
|
267 |
+ * @author fenris |
|
268 |
+ */ |
|
269 |
+ function class_node_complex(name, attributes, children) { |
|
270 |
+ if (attributes === void 0) { attributes = {}; } |
|
271 |
+ if (children === void 0) { children = []; } |
|
272 |
+ _super.call(this); |
|
273 |
+ this.name = name; |
|
274 |
+ this.attributes = attributes; |
|
275 |
+ this.children = children; |
|
276 |
+ } |
|
277 |
+ /** |
|
278 |
+ * @author fenris |
|
279 |
+ */ |
|
280 |
+ class_node_complex.prototype.compile = function (depth) { |
|
281 |
+ var _this = this; |
|
282 |
+ if (depth === void 0) { depth = 0; } |
|
283 |
+ var output = ""; |
|
284 |
+ var attributes = Object.keys(this.attributes).map(function (key) { return (" " + key + "=" + ("\"" + _this.attributes[key] + "\"")); }).join(""); |
|
285 |
+ output += (indentation(depth) + "<" + this.name + attributes + ">" + "\n"); |
|
286 |
+ this.children.forEach(function (child) { return (output += child.compile(depth + 1)); }); |
|
287 |
+ output += (indentation(depth) + "</" + this.name + ">" + "\n"); |
|
288 |
+ return output; |
|
289 |
+ }; |
|
290 |
+ return class_node_complex; |
|
291 |
+ }(class_node)); |
|
292 |
+ lib_xml.class_node_complex = class_node_complex; |
|
293 |
+})(lib_xml || (lib_xml = {})); |
|
294 |
+/** |
|
295 |
+ * @author fenris |
|
296 |
+ */ |
|
297 |
+var lib_gnumake; |
|
298 |
+(function (lib_gnumake) { |
|
299 |
+ /** |
|
300 |
+ * @author fenris |
|
301 |
+ */ |
|
302 |
+ var class_rule = (function () { |
|
303 |
+ /** |
|
304 |
+ * @author fenris |
|
305 |
+ */ |
|
306 |
+ // public constructor(name : string, dependencies : Array<string>, actions : Array<string>, phony : boolean = false) { |
|
307 |
+ function class_rule(parameters) { |
|
308 |
+ if (parameters === void 0) { parameters = {}; } |
|
309 |
+ this.name = fetch(parameters, "name", null, 2); |
|
310 |
+ this.dependencies = fetch(parameters, "dependencies", [], 0); |
|
311 |
+ this.actions = fetch(parameters, "actions", [], 0); |
|
312 |
+ this.phony = fetch(parameters, "phony", false, 0); |
|
313 |
+ } |
|
314 |
+ /** |
|
315 |
+ * @author fenris |
|
316 |
+ */ |
|
317 |
+ class_rule.prototype.actions_get = function () { |
|
318 |
+ return this.actions; |
|
319 |
+ }; |
|
320 |
+ /** |
|
321 |
+ * @author fenris |
|
322 |
+ */ |
|
323 |
+ class_rule.prototype.compile = function (silent) { |
|
324 |
+ if (silent === void 0) { silent = false; } |
|
325 |
+ var output = ""; |
|
326 |
+ output += (this.name + ":" + this.dependencies.map(function (dependency) { return (" " + dependency); }).join("") + "\n"); |
|
327 |
+ this.actions.forEach(function (action) { return (output += "\t" + (silent ? "@ " : "") + action + "\n"); }); |
|
328 |
+ if (this.phony) |
|
329 |
+ output += (".PHONY: " + this.name + "\n"); |
|
330 |
+ return output; |
|
331 |
+ }; |
|
332 |
+ return class_rule; |
|
333 |
+ }()); |
|
334 |
+ lib_gnumake.class_rule = class_rule; |
|
335 |
+ /** |
|
336 |
+ * @author fenris |
|
337 |
+ */ |
|
338 |
+ var class_sheet = (function () { |
|
339 |
+ /** |
|
340 |
+ * @author fenris |
|
341 |
+ */ |
|
342 |
+ function class_sheet(rules, comments) { |
|
343 |
+ if (comments === void 0) { comments = []; } |
|
344 |
+ this.rules = rules; |
|
345 |
+ this.comments = comments; |
|
346 |
+ } |
|
347 |
+ /** |
|
348 |
+ * @author fenris |
|
349 |
+ */ |
|
350 |
+ class_sheet.prototype.compile = function (silent) { |
|
351 |
+ if (silent === void 0) { silent = false; } |
|
352 |
+ return ([] |
|
353 |
+ .concat(this.comments.map(function (comment) { return ("# " + comment); })) |
|
354 |
+ .concat([""]) |
|
355 |
+ .concat(this.rules.map(function (rule) { return rule.compile(silent); })) |
|
356 |
+ .join("\n")); |
|
357 |
+ }; |
|
358 |
+ return class_sheet; |
|
359 |
+ }()); |
|
360 |
+ lib_gnumake.class_sheet = class_sheet; |
|
361 |
+})(lib_gnumake || (lib_gnumake = {})); |
|
362 |
+/** |
|
363 |
+ * @author fenris |
|
364 |
+ */ |
|
365 |
+var lib_ant; |
|
366 |
+(function (lib_ant) { |
|
367 |
+ /** |
|
368 |
+ * @author fenris |
|
369 |
+ */ |
|
370 |
+ var class_comment = (function () { |
|
371 |
+ /** |
|
372 |
+ * @author fenris |
|
373 |
+ */ |
|
374 |
+ function class_comment(content) { |
|
375 |
+ this.content = content; |
|
376 |
+ } |
|
377 |
+ /** |
|
378 |
+ * @author fenris |
|
379 |
+ */ |
|
380 |
+ class_comment.prototype.compile = function () { |
|
381 |
+ return (new lib_xml.class_node_comment(this.content)); |
|
382 |
+ }; |
|
383 |
+ return class_comment; |
|
384 |
+ }()); |
|
385 |
+ lib_ant.class_comment = class_comment; |
|
386 |
+ /** |
|
387 |
+ * @author fenris |
|
388 |
+ */ |
|
389 |
+ var class_action = (function () { |
|
390 |
+ /** |
|
391 |
+ * @author fenris |
|
392 |
+ */ |
|
393 |
+ function class_action(representation) { |
|
394 |
+ this.representation = representation; |
|
395 |
+ } |
|
396 |
+ /** |
|
397 |
+ * @author fenris |
|
398 |
+ */ |
|
399 |
+ class_action.prototype.compile = function () { |
|
400 |
+ return this.representation; |
|
401 |
+ }; |
|
402 |
+ return class_action; |
|
403 |
+ }()); |
|
404 |
+ lib_ant.class_action = class_action; |
|
405 |
+ /** |
|
406 |
+ * @author fenris |
|
407 |
+ */ |
|
408 |
+ var class_target = (function () { |
|
409 |
+ /** |
|
410 |
+ * @author fenris |
|
411 |
+ */ |
|
412 |
+ function class_target(parameters) { |
|
413 |
+ if (parameters === void 0) { parameters = {}; } |
|
414 |
+ this.name = fetch(parameters, "name", null, 2); |
|
415 |
+ this.dependencies = fetch(parameters, "dependencies", [], 1); |
|
416 |
+ this.actions = fetch(parameters, "actions", [], 0); |
|
417 |
+ } |
|
418 |
+ /** |
|
419 |
+ * @author fenris |
|
420 |
+ */ |
|
421 |
+ class_target.prototype.actions_get = function () { |
|
422 |
+ return this.actions; |
|
423 |
+ }; |
|
424 |
+ /** |
|
425 |
+ * @author fenris |
|
426 |
+ */ |
|
427 |
+ class_target.prototype.compile = function () { |
|
428 |
+ return (new lib_xml.class_node_complex("target", { |
|
429 |
+ "name": this.name, |
|
430 |
+ "depends": this.dependencies.join(",") |
|
431 |
+ }, this.actions.map(function (action) { return action.compile(); }))); |
|
432 |
+ }; |
|
433 |
+ return class_target; |
|
434 |
+ }()); |
|
435 |
+ lib_ant.class_target = class_target; |
|
436 |
+ /** |
|
437 |
+ * @author fenris |
|
438 |
+ */ |
|
439 |
+ var class_project = (function () { |
|
440 |
+ /** |
|
441 |
+ * @author fenris |
|
442 |
+ */ |
|
443 |
+ function class_project(parameters) { |
|
444 |
+ if (parameters === void 0) { parameters = {}; } |
|
445 |
+ this.name = fetch(parameters, "name", null, 2); |
|
446 |
+ this.default_ = fetch(parameters, "default", null, 2); |
|
447 |
+ this.targets = fetch(parameters, "targets", [], 1); |
|
448 |
+ this.comments = fetch(parameters, "comments", [], 0); |
|
449 |
+ } |
|
450 |
+ /** |
|
451 |
+ * @author fenris |
|
452 |
+ */ |
|
453 |
+ class_project.prototype.compile = function () { |
|
454 |
+ return (new lib_xml.class_node_complex("project", { |
|
455 |
+ "name": this.name, |
|
456 |
+ "default": this.default_, |
|
457 |
+ }, ([] |
|
458 |
+ .concat(this.comments.map(function (comment) { return comment.compile(); })) |
|
459 |
+ .concat(this.targets.map(function (target) { return target.compile(); }))))); |
|
460 |
+ }; |
|
461 |
+ return class_project; |
|
462 |
+ }()); |
|
463 |
+ lib_ant.class_project = class_project; |
|
464 |
+})(lib_ant || (lib_ant = {})); |
|
465 |
+/** |
|
466 |
+ * @author fenris |
|
467 |
+ */ |
|
468 |
+var __idcounter = 0; |
|
469 |
+/** |
|
470 |
+ * @author fenris |
|
471 |
+ */ |
|
472 |
+function genid(prefix) { |
|
473 |
+ if (prefix === void 0) { prefix = ""; } |
|
474 |
+ return (prefix + (__idcounter++).toString(16)); |
|
475 |
+} |
|
476 |
+/** |
|
477 |
+ * @author fenris |
|
478 |
+ */ |
|
479 |
+function wait(dependencies, action) { |
|
480 |
+ if (dependencies.length > 0) { |
|
481 |
+ dependencies[0](function () { wait(dependencies.slice(1), action); }); |
|
482 |
+ } |
|
483 |
+ else { |
|
484 |
+ action(); |
|
485 |
+ } |
|
486 |
+} |
|
487 |
+/** |
|
488 |
+ * @author fenris |
|
489 |
+ */ |
|
490 |
+function executor_chain(state, executors) { |
|
491 |
+ if (state === void 0) { state = null; } |
|
492 |
+ return (function (resolve, reject) { |
|
493 |
+ if (executors.length == 0) { |
|
494 |
+ resolve(state); |
|
495 |
+ } |
|
496 |
+ else { |
|
497 |
+ executors[0](state)(function resolve_(state_) { |
|
498 |
+ executor_chain(state_, executors.slice(1))(resolve, reject); |
|
499 |
+ }, function reject_(reason_) { |
|
500 |
+ reject(reason_); |
|
501 |
+ }); |
|
502 |
+ } |
|
503 |
+ }); |
|
504 |
+} |
|
505 |
+/** |
|
506 |
+ * @author fenris |
|
507 |
+ */ |
|
508 |
+function fetch(structure, fieldname, fallback, escalation) { |
|
509 |
+ if (fallback === void 0) { fallback = undefined; } |
|
510 |
+ if (escalation === void 0) { escalation = 1; } |
|
511 |
+ if (fieldname in structure) { |
|
512 |
+ return structure[fieldname]; |
|
513 |
+ } |
|
514 |
+ else { |
|
515 |
+ var message = "field '" + fieldname + "' missing in structure"; |
|
516 |
+ switch (escalation) { |
|
517 |
+ case 0: { |
|
518 |
+ return fallback; |
|
519 |
+ break; |
|
520 |
+ } |
|
521 |
+ case 1: { |
|
522 |
+ message += ("; using fallback-value '" + String(fallback) + "'"); |
|
523 |
+ (new class_message(message, { "type": "warning", "prefix": "koralle" })).stderr(); |
|
524 |
+ return fallback; |
|
525 |
+ break; |
|
526 |
+ } |
|
527 |
+ case 2: { |
|
528 |
+ throw (new Error(message)); |
|
529 |
+ break; |
|
530 |
+ } |
|
531 |
+ default: { |
|
532 |
+ break; |
|
533 |
+ } |
|
534 |
+ } |
|
535 |
+ } |
|
536 |
+} |
|
537 |
+/** |
|
538 |
+ * @author fenris |
|
539 |
+ */ |
|
540 |
+function read_json(path) { |
|
541 |
+ return (function (resolve, reject) { |
|
542 |
+ _fs.readFile(path, { |
|
543 |
+ "encoding": "utf-8", |
|
544 |
+ "flag": "r", |
|
545 |
+ }, function (error, content) { |
|
546 |
+ if (error != null) { |
|
547 |
+ reject(error); |
|
548 |
+ } |
|
549 |
+ else { |
|
550 |
+ try { |
|
551 |
+ var data = JSON.parse(content); |
|
552 |
+ resolve(data); |
|
553 |
+ } |
|
554 |
+ catch (exception) { |
|
555 |
+ reject((exception)); |
|
556 |
+ } |
|
557 |
+ } |
|
558 |
+ }); |
|
559 |
+ }); |
|
560 |
+} |
|
561 |
+/** |
|
562 |
+ * @author fenris |
|
563 |
+ */ |
|
564 |
+var class_error = (function (_super) { |
|
565 |
+ __extends(class_error, _super); |
|
566 |
+ /** |
|
567 |
+ * @author fenris |
|
568 |
+ */ |
|
569 |
+ function class_error(text, sub) { |
|
570 |
+ if (sub === void 0) { sub = []; } |
|
571 |
+ _super.call(this, text); |
|
572 |
+ this.text = text; |
|
573 |
+ this.sub = sub; |
|
574 |
+ } |
|
575 |
+ /** |
|
576 |
+ * @author fenris |
|
577 |
+ */ |
|
578 |
+ class_error.prototype.toString = function () { |
|
579 |
+ return (this.text + " / " + this.sub.map(function (error) { return error.toString(); }).join(" ; ")); |
|
580 |
+ }; |
|
581 |
+ return class_error; |
|
582 |
+}(Error)); |
|
583 |
+/** |
|
584 |
+ * @author fenris |
|
585 |
+ */ |
|
586 |
+var lib_path; |
|
587 |
+(function (lib_path) { |
|
588 |
+ /** |
|
589 |
+ * @author fenris |
|
590 |
+ */ |
|
591 |
+ var class_step = (function () { |
|
592 |
+ function class_step() { |
|
593 |
+ } |
|
594 |
+ return class_step; |
|
595 |
+ }()); |
|
596 |
+ /** |
|
597 |
+ * @author fenris |
|
598 |
+ */ |
|
599 |
+ var class_step_stay = (function (_super) { |
|
600 |
+ __extends(class_step_stay, _super); |
|
601 |
+ function class_step_stay() { |
|
602 |
+ _super.apply(this, arguments); |
|
603 |
+ } |
|
604 |
+ /** |
|
605 |
+ * @author fenris |
|
606 |
+ */ |
|
607 |
+ class_step_stay.prototype.toString = function () { |
|
608 |
+ return "."; |
|
609 |
+ }; |
|
610 |
+ return class_step_stay; |
|
611 |
+ }(class_step)); |
|
612 |
+ /** |
|
613 |
+ * @author fenris |
|
614 |
+ */ |
|
615 |
+ var class_step_back = (function (_super) { |
|
616 |
+ __extends(class_step_back, _super); |
|
617 |
+ function class_step_back() { |
|
618 |
+ _super.apply(this, arguments); |
|
619 |
+ } |
|
620 |
+ /** |
|
621 |
+ * @author fenris |
|
622 |
+ */ |
|
623 |
+ class_step_back.prototype.toString = function () { |
|
624 |
+ return ".."; |
|
625 |
+ }; |
|
626 |
+ return class_step_back; |
|
627 |
+ }(class_step)); |
|
628 |
+ /** |
|
629 |
+ * @author fenris |
|
630 |
+ */ |
|
631 |
+ var class_step_regular = (function (_super) { |
|
632 |
+ __extends(class_step_regular, _super); |
|
633 |
+ /** |
|
634 |
+ * @author fenris |
|
635 |
+ */ |
|
636 |
+ function class_step_regular(name) { |
|
637 |
+ _super.call(this); |
|
638 |
+ this.name = name; |
|
639 |
+ } |
|
640 |
+ /** |
|
641 |
+ * @author fenris |
|
642 |
+ */ |
|
643 |
+ class_step_regular.prototype.toString = function () { |
|
644 |
+ return this.name; |
|
645 |
+ }; |
|
646 |
+ return class_step_regular; |
|
647 |
+ }(class_step)); |
|
648 |
+ /** |
|
649 |
+ * @author fenris |
|
650 |
+ */ |
|
651 |
+ function step_read(s) { |
|
652 |
+ switch (s) { |
|
653 |
+ case ".": { |
|
654 |
+ return (new class_step_stay()); |
|
655 |
+ } |
|
656 |
+ case "..": { |
|
657 |
+ return (new class_step_back()); |
|
658 |
+ } |
|
659 |
+ default: { |
|
660 |
+ return (new class_step_regular(s)); |
|
661 |
+ } |
|
662 |
+ } |
|
663 |
+ } |
|
664 |
+ /** |
|
665 |
+ * @author fenris |
|
666 |
+ */ |
|
667 |
+ var class_path = (function () { |
|
668 |
+ /** |
|
669 |
+ * @author fenris |
|
670 |
+ */ |
|
671 |
+ function class_path(steps) { |
|
672 |
+ if (steps === void 0) { steps = []; } |
|
673 |
+ this.steps = steps; |
|
674 |
+ } |
|
675 |
+ /** |
|
676 |
+ * @author fenris |
|
677 |
+ */ |
|
678 |
+ class_path.prototype.add = function (step) { |
|
679 |
+ return (new class_path(this.steps.concat([step]))).normalize(); |
|
680 |
+ }; |
|
681 |
+ /** |
|
682 |
+ * @author fenris |
|
683 |
+ */ |
|
684 |
+ class_path.prototype.extend = function (path) { |
|
685 |
+ return (new class_path(this.steps.concat(path.steps))).normalize(); |
|
686 |
+ }; |
|
687 |
+ /** |
|
688 |
+ * @author fenris |
|
689 |
+ */ |
|
690 |
+ class_path.prototype.normalize = function () { |
|
691 |
+ var steps = this.steps; |
|
692 |
+ // filter "stay" |
|
693 |
+ { |
|
694 |
+ steps = steps.filter(function (step) { return !(step instanceof class_step_stay); }); |
|
695 |
+ } |
|
696 |
+ // filter "regular-back" |
|
697 |
+ { |
|
698 |
+ var _loop_1 = function() { |
|
699 |
+ // console.info(new class_path(steps).toString()); |
|
700 |
+ if (steps.length < 1) { |
|
701 |
+ return "break"; |
|
702 |
+ } |
|
703 |
+ else { |
|
704 |
+ var last_1 = steps[0]; |
|
705 |
+ var found = steps.slice(1).some(function (step, index) { |
|
706 |
+ // console.info("--", step.toString()); |
|
707 |
+ if (step instanceof class_step_back) { |
|
708 |
+ if (last_1 instanceof class_step_regular) { |
|
709 |
+ steps.splice(index, 2); |
|
710 |
+ return true; |
|
711 |
+ } |
|
712 |
+ } |
|
713 |
+ last_1 = step; |
|
714 |
+ return false; |
|
715 |
+ }); |
|
716 |
+ if (!found) { |
|
717 |
+ return "break"; |
|
718 |
+ } |
|
719 |
+ } |
|
720 |
+ }; |
|
721 |
+ while (true) { |
|
722 |
+ var state_1 = _loop_1(); |
|
723 |
+ if (state_1 === "break") break; |
|
724 |
+ } |
|
725 |
+ } |
|
726 |
+ return (new class_path(steps)); |
|
727 |
+ }; |
|
728 |
+ /** |
|
729 |
+ * @author fenris |
|
730 |
+ */ |
|
731 |
+ class_path.prototype.toString = function () { |
|
732 |
+ return ((this.steps.length == 0) ? "./" : this.steps.map(function (step) { return (step.toString() + "/"); }).join("")); |
|
733 |
+ }; |
|
734 |
+ /** |
|
735 |
+ * @author fenris |
|
736 |
+ */ |
|
737 |
+ class_path.read = function (s) { |
|
738 |
+ var parts = s.split("/"); |
|
739 |
+ if (parts[parts.length - 1] == "") |
|
740 |
+ parts.pop(); |
|
741 |
+ return (new class_path(parts.map(step_read))); |
|
742 |
+ }; |
|
743 |
+ return class_path; |
|
744 |
+ }()); |
|
745 |
+ lib_path.class_path = class_path; |
|
746 |
+ /** |
|
747 |
+ * @author fenris |
|
748 |
+ */ |
|
749 |
+ function path_read(s) { |
|
750 |
+ return class_path.read(s); |
|
751 |
+ } |
|
752 |
+ lib_path.path_read = path_read; |
|
753 |
+ /** |
|
754 |
+ * @author fenris |
|
755 |
+ */ |
|
756 |
+ var class_location = (function () { |
|
757 |
+ /** |
|
758 |
+ * @author fenris |
|
759 |
+ */ |
|
760 |
+ function class_location(anchor, path) { |
|
761 |
+ this.anchor = anchor; |
|
762 |
+ this.path = path; |
|
763 |
+ } |
|
764 |
+ /** |
|
765 |
+ * @author fenris |
|
766 |
+ */ |
|
767 |
+ class_location.prototype.extend = function (path) { |
|
768 |
+ return (new class_location(this.anchor, this.path.extend(path))); |
|
769 |
+ }; |
|
770 |
+ /** |
|
771 |
+ * @author fenris |
|
772 |
+ */ |
|
773 |
+ class_location.prototype.go_thither = function () { |
|
774 |
+ process.chdir(this.toString()); |
|
775 |
+ }; |
|
776 |
+ /** |
|
777 |
+ * @author fenris |
|
778 |
+ */ |
|
779 |
+ class_location.prototype.expedition = function (core) { |
|
780 |
+ var that = this; |
|
781 |
+ var current = location_read(process.cwd()); |
|
782 |
+ function begin() { |
|
783 |
+ // (new class_message("changing directory to '" + that.toString() + "'")).stderr(); |
|
784 |
+ that.go_thither(); |
|
785 |
+ } |
|
786 |
+ function end() { |
|
787 |
+ // (new class_message("changing directory to '" + current.toString() + "'")).stderr(); |
|
788 |
+ current.go_thither(); |
|
789 |
+ } |
|
790 |
+ begin(); |
|
791 |
+ core(end); |
|
792 |
+ }; |
|
793 |
+ /** |
|
794 |
+ * @author fenris |
|
795 |
+ */ |
|
796 |
+ class_location.prototype.toString = function () { |
|
797 |
+ return (((this.anchor != null) ? this.anchor : "") + this.path.toString()); |
|
798 |
+ }; |
|
799 |
+ /** |
|
800 |
+ * @author fenris |
|
801 |
+ */ |
|
802 |
+ class_location.read = function (s) { |
|
803 |
+ if (s[0] == "/") { |
|
804 |
+ return (new class_location("/", path_read(s.slice(1)))); |
|
805 |
+ } |
|
806 |
+ else { |
|
807 |
+ return (new class_location(null, path_read(s))); |
|
808 |
+ } |
|
809 |
+ }; |
|
810 |
+ /** |
|
811 |
+ * @author fenris |
|
812 |
+ */ |
|
813 |
+ class_location.current = function () { |
|
814 |
+ return class_location.read(process.cwd()); |
|
815 |
+ }; |
|
816 |
+ return class_location; |
|
817 |
+ }()); |
|
818 |
+ lib_path.class_location = class_location; |
|
819 |
+ /** |
|
820 |
+ * @author fenris |
|
821 |
+ */ |
|
822 |
+ function location_read(s) { |
|
823 |
+ return class_location.read(s); |
|
824 |
+ } |
|
825 |
+ lib_path.location_read = location_read; |
|
826 |
+ /** |
|
827 |
+ * @author fenris |
|
828 |
+ */ |
|
829 |
+ var class_filepointer = (function () { |
|
830 |
+ /** |
|
831 |
+ * @author fenris |
|
832 |
+ */ |
|
833 |
+ function class_filepointer(location, filename) { |
|
834 |
+ this.location = location; |
|
835 |
+ this.filename = filename; |
|
836 |
+ } |
|
837 |
+ /** |
|
838 |
+ * @author fenris |
|
839 |
+ */ |
|
840 |
+ class_filepointer.prototype.foo = function (filepointer) { |
|
841 |
+ return (new class_filepointer(this.location.extend(filepointer.location.path), filepointer.filename)); |
|
842 |
+ }; |
|
843 |
+ /** |
|
844 |
+ * @author fenris |
|
845 |
+ */ |
|
846 |
+ class_filepointer.prototype.toString = function () { |
|
847 |
+ return (this.location.toString() /* + "/"*/ + ((this.filename == null) ? "" : this.filename)); |
|
848 |
+ }; |
|
849 |
+ /** |
|
850 |
+ * @author fenris |
|
851 |
+ */ |
|
852 |
+ class_filepointer.read = function (s) { |
|
853 |
+ var parts = s.split("/"); |
|
854 |
+ var last = parts[parts.length - 1]; |
|
855 |
+ if (last == "") { |
|
856 |
+ return (new class_filepointer(location_read(parts.join("/")), null)); |
|
857 |
+ } |
|
858 |
+ else { |
|
859 |
+ return (new class_filepointer(location_read(parts.slice(0, parts.length - 1).join("/")), last)); |
|
860 |
+ } |
|
861 |
+ }; |
|
862 |
+ return class_filepointer; |
|
863 |
+ }()); |
|
864 |
+ lib_path.class_filepointer = class_filepointer; |
|
865 |
+ /** |
|
866 |
+ * @author fenris |
|
867 |
+ */ |
|
868 |
+ function filepointer_read(s) { |
|
869 |
+ return class_filepointer.read(s); |
|
870 |
+ } |
|
871 |
+ lib_path.filepointer_read = filepointer_read; |
|
872 |
+})(lib_path || (lib_path = {})); |
|
873 |
+/** |
|
874 |
+ * @author fenris |
|
875 |
+ */ |
|
876 |
+var class_action = (function () { |
|
877 |
+ /** |
|
878 |
+ * @author fenris |
|
879 |
+ */ |
|
880 |
+ function class_action() { |
|
881 |
+ } |
|
882 |
+ return class_action; |
|
883 |
+}()); |
|
884 |
+/** |
|
885 |
+ * @author fenris |
|
886 |
+ */ |
|
887 |
+var class_action_adhoc = (function (_super) { |
|
888 |
+ __extends(class_action_adhoc, _super); |
|
889 |
+ /** |
|
890 |
+ * @author fenris |
|
891 |
+ */ |
|
892 |
+ function class_action_adhoc() { |
|
893 |
+ _super.call(this); |
|
894 |
+ } |
|
895 |
+ return class_action_adhoc; |
|
896 |
+}(class_action)); |
|
897 |
+/** |
|
898 |
+ * @author fenris |
|
899 |
+ */ |
|
900 |
+var class_action_exec = (function (_super) { |
|
901 |
+ __extends(class_action_exec, _super); |
|
902 |
+ /** |
|
903 |
+ * @author fenris |
|
904 |
+ */ |
|
905 |
+ function class_action_exec(paths_input, paths_output, path_script, path_interpreter) { |
|
906 |
+ _super.call(this); |
|
907 |
+ this.paths_input = paths_input; |
|
908 |
+ this.paths_output = paths_output; |
|
909 |
+ this.path_script = path_script; |
|
910 |
+ this.path_interpreter = path_interpreter; |
|
911 |
+ } |
|
912 |
+ /** |
|
913 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
914 |
+ * @author fenris |
|
915 |
+ */ |
|
916 |
+ class_action_exec.prototype.compilation = function (target_identifier) { |
|
917 |
+ switch (target_identifier) { |
|
918 |
+ case "gnumake": { |
|
919 |
+ switch (configuration["system"]) { |
|
920 |
+ case "unix": { |
|
921 |
+ var parts = []; |
|
922 |
+ if (this.path_interpreter != null) |
|
923 |
+ parts.push(this.path_interpreter.toString()); |
|
924 |
+ parts.push(this.path_script.toString()); |
|
925 |
+ parts.push(this.paths_input.map(function (filepointer) { return filepointer.toString(); }).join(",")); |
|
926 |
+ parts.push(this.paths_output.map(function (filepointer) { return filepointer.toString(); }).join(",")); |
|
927 |
+ return parts.join(" "); |
|
928 |
+ break; |
|
929 |
+ } |
|
930 |
+ default: { |
|
931 |
+ throw (new Error("not implemented")); |
|
932 |
+ break; |
|
933 |
+ } |
|
934 |
+ } |
|
935 |
+ break; |
|
936 |
+ } |
|
937 |
+ case "ant": { |
|
938 |
+ if (this.path_interpreter == null) { |
|
939 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("exec", { "executable": this.path_script.toString() }, [ |
|
940 |
+ new lib_xml.class_node_complex("arg", { "value": "'" + this.paths_input.map(function (filepointer) { return filepointer.toString(); }).join(",") + "'" }), |
|
941 |
+ new lib_xml.class_node_complex("arg", { "value": "'" + this.paths_output.map(function (filepointer) { return filepointer.toString(); }).join(",") + "'" }), |
|
942 |
+ ]))); |
|
943 |
+ } |
|
944 |
+ else { |
|
945 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("exec", { "executable": this.path_interpreter.toString() }, [ |
|
946 |
+ new lib_xml.class_node_complex("arg", { "value": this.path_script.toString() }), |
|
947 |
+ new lib_xml.class_node_complex("arg", { "value": "'" + this.paths_input.map(function (filepointer) { return filepointer.toString(); }).join(",") + "'" }), |
|
948 |
+ new lib_xml.class_node_complex("arg", { "value": "'" + this.paths_output.map(function (filepointer) { return filepointer.toString(); }).join(",") + "'" }), |
|
949 |
+ ]))); |
|
950 |
+ } |
|
951 |
+ break; |
|
952 |
+ } |
|
953 |
+ default: { |
|
954 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
955 |
+ break; |
|
956 |
+ } |
|
957 |
+ } |
|
958 |
+ }; |
|
959 |
+ return class_action_exec; |
|
960 |
+}(class_action_adhoc)); |
|
961 |
+/** |
|
962 |
+ * @author fenris |
|
963 |
+ */ |
|
964 |
+var class_action_echo = (function (_super) { |
|
965 |
+ __extends(class_action_echo, _super); |
|
966 |
+ /** |
|
967 |
+ * @author fenris |
|
968 |
+ */ |
|
969 |
+ function class_action_echo(message) { |
|
970 |
+ _super.call(this); |
|
971 |
+ this.message = message; |
|
972 |
+ } |
|
973 |
+ /** |
|
974 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
975 |
+ * @todo escape message |
|
976 |
+ * @author fenris |
|
977 |
+ */ |
|
978 |
+ class_action_echo.prototype.compilation = function (target_identifier) { |
|
979 |
+ switch (target_identifier) { |
|
980 |
+ case "gnumake": { |
|
981 |
+ switch (configuration["system"]) { |
|
982 |
+ case "unix": { |
|
983 |
+ var parts = []; |
|
984 |
+ parts.push("echo"); |
|
985 |
+ parts.push("'" + this.message + "'"); |
|
986 |
+ return parts.join(" "); |
|
987 |
+ break; |
|
988 |
+ } |
|
989 |
+ default: { |
|
990 |
+ throw (new Error("not implemented")); |
|
991 |
+ break; |
|
992 |
+ } |
|
993 |
+ } |
|
994 |
+ break; |
|
995 |
+ } |
|
996 |
+ case "ant": { |
|
997 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("echo", { "message": this.message }))); |
|
998 |
+ break; |
|
999 |
+ } |
|
1000 |
+ default: { |
|
1001 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1002 |
+ break; |
|
1003 |
+ } |
|
1004 |
+ } |
|
1005 |
+ }; |
|
1006 |
+ return class_action_echo; |
|
1007 |
+}(class_action_adhoc)); |
|
1008 |
+/** |
|
1009 |
+ * @author fenris |
|
1010 |
+ */ |
|
1011 |
+var class_action_koralle = (function (_super) { |
|
1012 |
+ __extends(class_action_koralle, _super); |
|
1013 |
+ /** |
|
1014 |
+ * @author fenris |
|
1015 |
+ */ |
|
1016 |
+ function class_action_koralle(filepointer_in, filepointer_out, target, raw) { |
|
1017 |
+ _super.call(this); |
|
1018 |
+ this.filepointer_in = filepointer_in; |
|
1019 |
+ this.filepointer_out = filepointer_out; |
|
1020 |
+ this.target = target; |
|
1021 |
+ this.raw = raw; |
|
1022 |
+ } |
|
1023 |
+ /** |
|
1024 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1025 |
+ * @author fenris |
|
1026 |
+ */ |
|
1027 |
+ class_action_koralle.prototype.compilation = function (target_identifier) { |
|
1028 |
+ switch (target_identifier) { |
|
1029 |
+ case "gnumake": { |
|
1030 |
+ switch (configuration["system"]) { |
|
1031 |
+ case "unix": { |
|
1032 |
+ var parts = []; |
|
1033 |
+ parts.push("koralle"); |
|
1034 |
+ parts.push("--target=" + this.target); |
|
1035 |
+ if (this.raw) |
|
1036 |
+ parts.push("--raw"); |
|
1037 |
+ parts.push(this.filepointer_in.toString()); |
|
1038 |
+ return (parts.join(" ") + " > " + this.filepointer_out.toString()); |
|
1039 |
+ } |
|
1040 |
+ default: { |
|
1041 |
+ throw (new Error("not implemented")); |
|
1042 |
+ } |
|
1043 |
+ } |
|
1044 |
+ break; |
|
1045 |
+ } |
|
1046 |
+ case "ant": { |
|
1047 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("exec", { |
|
1048 |
+ "executable": "koralle", |
|
1049 |
+ "output": this.filepointer_out.toString(), |
|
1050 |
+ }, ([] |
|
1051 |
+ .concat([ |
|
1052 |
+ new lib_xml.class_node_complex("arg", { "value": "--target=" + this.target }) |
|
1053 |
+ ]) |
|
1054 |
+ .concat(this.raw |
|
1055 |
+ ? |
|
1056 |
+ [ |
|
1057 |
+ new lib_xml.class_node_complex("arg", { "value": "--raw" }), |
|
1058 |
+ ] |
|
1059 |
+ : |
|
1060 |
+ []) |
|
1061 |
+ .concat([ |
|
1062 |
+ new lib_xml.class_node_complex("arg", { "value": this.filepointer_in.toString() }) |
|
1063 |
+ ]))))); |
|
1064 |
+ } |
|
1065 |
+ default: { |
|
1066 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1067 |
+ } |
|
1068 |
+ } |
|
1069 |
+ }; |
|
1070 |
+ return class_action_koralle; |
|
1071 |
+}(class_action_adhoc)); |
|
1072 |
+/** |
|
1073 |
+ * @author fenris |
|
1074 |
+ */ |
|
1075 |
+var class_action_build = (function (_super) { |
|
1076 |
+ __extends(class_action_build, _super); |
|
1077 |
+ /** |
|
1078 |
+ * @author fenris |
|
1079 |
+ */ |
|
1080 |
+ function class_action_build(filepointer, workdir) { |
|
1081 |
+ _super.call(this); |
|
1082 |
+ this.filepointer = filepointer; |
|
1083 |
+ this.workdir = workdir; |
|
1084 |
+ } |
|
1085 |
+ return class_action_build; |
|
1086 |
+}(class_action_adhoc)); |
|
1087 |
+/** |
|
1088 |
+ * @author fenris |
|
1089 |
+ */ |
|
1090 |
+var class_action_gnumake = (function (_super) { |
|
1091 |
+ __extends(class_action_gnumake, _super); |
|
1092 |
+ /** |
|
1093 |
+ * @author fenris |
|
1094 |
+ */ |
|
1095 |
+ function class_action_gnumake(filepointer, workdir) { |
|
1096 |
+ _super.call(this, filepointer, workdir); |
|
1097 |
+ } |
|
1098 |
+ /** |
|
1099 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1100 |
+ * @author fenris |
|
1101 |
+ */ |
|
1102 |
+ class_action_gnumake.prototype.compilation = function (target_identifier) { |
|
1103 |
+ switch (target_identifier) { |
|
1104 |
+ case "gnumake": { |
|
1105 |
+ switch (configuration["system"]) { |
|
1106 |
+ case "unix": { |
|
1107 |
+ // cmd_cd1 |
|
1108 |
+ var cmd_cd1 = void 0; |
|
1109 |
+ { |
|
1110 |
+ var parts = []; |
|
1111 |
+ parts.push("cd"); |
|
1112 |
+ parts.push(this.workdir.toString()); |
|
1113 |
+ cmd_cd1 = parts.join(" "); |
|
1114 |
+ } |
|
1115 |
+ // cmd_cd2 |
|
1116 |
+ var cmd_cd2 = void 0; |
|
1117 |
+ { |
|
1118 |
+ var parts = []; |
|
1119 |
+ parts.push("cd"); |
|
1120 |
+ parts.push("-"); |
|
1121 |
+ cmd_cd2 = parts.join(" ") + " > /dev/null"; |
|
1122 |
+ } |
|
1123 |
+ // cmd_make |
|
1124 |
+ var cmd_make = void 0; |
|
1125 |
+ { |
|
1126 |
+ var parts = []; |
|
1127 |
+ parts.push("make"); |
|
1128 |
+ parts.push("--no-print-directory"); |
|
1129 |
+ parts.push("--file=" + this.filepointer.toString()); |
|
1130 |
+ cmd_make = parts.join(" "); |
|
1131 |
+ } |
|
1132 |
+ return ((this.workdir == null) ? [cmd_make] : [cmd_cd1, cmd_make, cmd_cd2]).join(" && "); |
|
1133 |
+ } |
|
1134 |
+ default: { |
|
1135 |
+ throw (new Error("not implemented")); |
|
1136 |
+ } |
|
1137 |
+ } |
|
1138 |
+ break; |
|
1139 |
+ } |
|
1140 |
+ case "ant": { |
|
1141 |
+ return (new lib_ant.class_action((this.workdir == null) |
|
1142 |
+ ? |
|
1143 |
+ new lib_xml.class_node_complex("exec", { |
|
1144 |
+ "executable": "make", |
|
1145 |
+ }, [ |
|
1146 |
+ new lib_xml.class_node_complex("arg", { "value": "--no-print-directory" }), |
|
1147 |
+ new lib_xml.class_node_complex("arg", { "value": "--file=" + this.filepointer.toString() }), |
|
1148 |
+ ]) |
|
1149 |
+ : |
|
1150 |
+ new lib_xml.class_node_complex("exec", { |
|
1151 |
+ "executable": "make", |
|
1152 |
+ "dir": this.workdir.toString(), |
|
1153 |
+ }, [ |
|
1154 |
+ new lib_xml.class_node_complex("arg", { "value": "--no-print-directory" }), |
|
1155 |
+ new lib_xml.class_node_complex("arg", { "value": "--file=" + this.filepointer.toString() }), |
|
1156 |
+ ]))); |
|
1157 |
+ } |
|
1158 |
+ default: { |
|
1159 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1160 |
+ } |
|
1161 |
+ } |
|
1162 |
+ }; |
|
1163 |
+ return class_action_gnumake; |
|
1164 |
+}(class_action_build)); |
|
1165 |
+/** |
|
1166 |
+ * @author fenris |
|
1167 |
+ */ |
|
1168 |
+var class_action_ant = (function (_super) { |
|
1169 |
+ __extends(class_action_ant, _super); |
|
1170 |
+ /** |
|
1171 |
+ * @author fenris |
|
1172 |
+ */ |
|
1173 |
+ function class_action_ant(filepointer, workdir) { |
|
1174 |
+ _super.call(this, filepointer, workdir); |
|
1175 |
+ } |
|
1176 |
+ /** |
|
1177 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1178 |
+ * @author fenris |
|
1179 |
+ */ |
|
1180 |
+ class_action_ant.prototype.compilation = function (target_identifier) { |
|
1181 |
+ switch (target_identifier) { |
|
1182 |
+ case "gnumake": { |
|
1183 |
+ switch (configuration["system"]) { |
|
1184 |
+ case "unix": { |
|
1185 |
+ // cmd_cd1 |
|
1186 |
+ var cmd_cd1 = void 0; |
|
1187 |
+ { |
|
1188 |
+ var parts = []; |
|
1189 |
+ parts.push("cd"); |
|
1190 |
+ parts.push(this.workdir.toString()); |
|
1191 |
+ cmd_cd1 = parts.join(" "); |
|
1192 |
+ } |
|
1193 |
+ // cmd_cd2 |
|
1194 |
+ var cmd_cd2 = void 0; |
|
1195 |
+ { |
|
1196 |
+ var parts = []; |
|
1197 |
+ parts.push("cd"); |
|
1198 |
+ parts.push("-"); |
|
1199 |
+ cmd_cd2 = parts.join(" ") + " > /dev/null"; |
|
1200 |
+ } |
|
1201 |
+ // cmd_ant |
|
1202 |
+ var cmd_ant = void 0; |
|
1203 |
+ { |
|
1204 |
+ var parts = []; |
|
1205 |
+ parts.push("ant"); |
|
1206 |
+ parts.push(this.filepointer.toString()); |
|
1207 |
+ cmd_ant = parts.join(" "); |
|
1208 |
+ } |
|
1209 |
+ return ((this.workdir == null) ? [cmd_ant] : [cmd_cd1, cmd_ant, cmd_cd2]).join(" && "); |
|
1210 |
+ } |
|
1211 |
+ default: { |
|
1212 |
+ throw (new Error("not implemented")); |
|
1213 |
+ } |
|
1214 |
+ } |
|
1215 |
+ break; |
|
1216 |
+ } |
|
1217 |
+ case "ant": { |
|
1218 |
+ return (new lib_ant.class_action((this.workdir == null) |
|
1219 |
+ ? |
|
1220 |
+ new lib_xml.class_node_complex("ant", { |
|
1221 |
+ "antfile": this.filepointer.toString(), |
|
1222 |
+ }) |
|
1223 |
+ : |
|
1224 |
+ new lib_xml.class_node_complex("ant", { |
|
1225 |
+ "antfile": this.filepointer.toString(), |
|
1226 |
+ "dir": this.workdir.toString(), |
|
1227 |
+ }))); |
|
1228 |
+ } |
|
1229 |
+ default: { |
|
1230 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1231 |
+ } |
|
1232 |
+ } |
|
1233 |
+ }; |
|
1234 |
+ return class_action_ant; |
|
1235 |
+}(class_action_build)); |
|
1236 |
+/** |
|
1237 |
+ * @author fenris |
|
1238 |
+ */ |
|
1239 |
+var class_action_mkdir = (function (_super) { |
|
1240 |
+ __extends(class_action_mkdir, _super); |
|
1241 |
+ /** |
|
1242 |
+ * @author fenris |
|
1243 |
+ */ |
|
1244 |
+ function class_action_mkdir(location) { |
|
1245 |
+ _super.call(this); |
|
1246 |
+ this.location = location; |
|
1247 |
+ } |
|
1248 |
+ /** |
|
1249 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1250 |
+ * @author fenris |
|
1251 |
+ */ |
|
1252 |
+ class_action_mkdir.prototype.compilation = function (target_identifier) { |
|
1253 |
+ switch (target_identifier) { |
|
1254 |
+ case "gnumake": { |
|
1255 |
+ switch (configuration["system"]) { |
|
1256 |
+ case "unix": { |
|
1257 |
+ var parts = []; |
|
1258 |
+ parts.push("mkdir"); |
|
1259 |
+ parts.push("--parents"); |
|
1260 |
+ parts.push(this.location.toString()); |
|
1261 |
+ return parts.join(" "); |
|
1262 |
+ break; |
|
1263 |
+ } |
|
1264 |
+ default: { |
|
1265 |
+ throw (new Error("not implemented")); |
|
1266 |
+ break; |
|
1267 |
+ } |
|
1268 |
+ } |
|
1269 |
+ break; |
|
1270 |
+ } |
|
1271 |
+ case "ant": { |
|
1272 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("mkdir", { "dir": this.location.toString() }))); |
|
1273 |
+ break; |
|
1274 |
+ } |
|
1275 |
+ default: { |
|
1276 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1277 |
+ break; |
|
1278 |
+ } |
|
1279 |
+ } |
|
1280 |
+ }; |
|
1281 |
+ return class_action_mkdir; |
|
1282 |
+}(class_action_adhoc)); |
|
1283 |
+/** |
|
1284 |
+ * @author fenris |
|
1285 |
+ */ |
|
1286 |
+var class_action_touch = (function (_super) { |
|
1287 |
+ __extends(class_action_touch, _super); |
|
1288 |
+ /** |
|
1289 |
+ * @author fenris |
|
1290 |
+ */ |
|
1291 |
+ function class_action_touch(filepointer) { |
|
1292 |
+ _super.call(this); |
|
1293 |
+ this.filepointer = filepointer; |
|
1294 |
+ } |
|
1295 |
+ /** |
|
1296 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1297 |
+ * @author fenris |
|
1298 |
+ */ |
|
1299 |
+ class_action_touch.prototype.compilation = function (target_identifier) { |
|
1300 |
+ switch (target_identifier) { |
|
1301 |
+ case "gnumake": { |
|
1302 |
+ switch (configuration["system"]) { |
|
1303 |
+ case "unix": { |
|
1304 |
+ var parts = []; |
|
1305 |
+ parts.push("touch"); |
|
1306 |
+ parts.push(this.filepointer.toString()); |
|
1307 |
+ return parts.join(" "); |
|
1308 |
+ } |
|
1309 |
+ default: { |
|
1310 |
+ throw (new Error("not implemented")); |
|
1311 |
+ } |
|
1312 |
+ } |
|
1313 |
+ } |
|
1314 |
+ case "ant": { |
|
1315 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("touch", { "file": this.filepointer.toString() }))); |
|
1316 |
+ } |
|
1317 |
+ default: { |
|
1318 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1319 |
+ break; |
|
1320 |
+ } |
|
1321 |
+ } |
|
1322 |
+ }; |
|
1323 |
+ return class_action_touch; |
|
1324 |
+}(class_action_adhoc)); |
|
1325 |
+/** |
|
1326 |
+ * @author fenris |
|
1327 |
+ */ |
|
1328 |
+var class_action_copy = (function (_super) { |
|
1329 |
+ __extends(class_action_copy, _super); |
|
1330 |
+ /** |
|
1331 |
+ * @author fenris |
|
1332 |
+ */ |
|
1333 |
+ function class_action_copy(filepointer_from, filepointer_to, folder) { |
|
1334 |
+ _super.call(this); |
|
1335 |
+ this.filepointer_from = filepointer_from; |
|
1336 |
+ this.filepointer_to = filepointer_to; |
|
1337 |
+ this.folder = folder; |
|
1338 |
+ } |
|
1339 |
+ /** |
|
1340 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1341 |
+ * @author fenris |
|
1342 |
+ */ |
|
1343 |
+ class_action_copy.prototype.compilation = function (target_identifier) { |
|
1344 |
+ switch (target_identifier) { |
|
1345 |
+ case "gnumake": { |
|
1346 |
+ switch (configuration["system"]) { |
|
1347 |
+ case "unix": { |
|
1348 |
+ var parts = []; |
|
1349 |
+ parts.push("cp"); |
|
1350 |
+ if (this.folder) { |
|
1351 |
+ parts.push("--recursive"); |
|
1352 |
+ parts.push("--update"); |
|
1353 |
+ parts.push("--verbose"); |
|
1354 |
+ parts.push((new lib_path.class_filepointer(this.filepointer_from.location, "*")).toString()); |
|
1355 |
+ } |
|
1356 |
+ else { |
|
1357 |
+ parts.push(this.filepointer_from.toString()); |
|
1358 |
+ } |
|
1359 |
+ parts.push(this.filepointer_to.toString()); |
|
1360 |
+ return parts.join(" "); |
|
1361 |
+ break; |
|
1362 |
+ } |
|
1363 |
+ default: { |
|
1364 |
+ throw (new Error("not implemented")); |
|
1365 |
+ break; |
|
1366 |
+ } |
|
1367 |
+ } |
|
1368 |
+ break; |
|
1369 |
+ } |
|
1370 |
+ case "ant": { |
|
1371 |
+ if (!this.folder) { |
|
1372 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("copy", { |
|
1373 |
+ "file": this.filepointer_from.toString(), |
|
1374 |
+ "tofile": this.filepointer_to.toString(), |
|
1375 |
+ }))); |
|
1376 |
+ } |
|
1377 |
+ else { |
|
1378 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("copy", { |
|
1379 |
+ "todir": this.filepointer_to.toString(), |
|
1380 |
+ }, [ |
|
1381 |
+ new lib_xml.class_node_complex("fileset", { |
|
1382 |
+ "dir": this.filepointer_from.toString(), |
|
1383 |
+ }) |
|
1384 |
+ ]))); |
|
1385 |
+ } |
|
1386 |
+ break; |
|
1387 |
+ } |
|
1388 |
+ default: { |
|
1389 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1390 |
+ break; |
|
1391 |
+ } |
|
1392 |
+ } |
|
1393 |
+ }; |
|
1394 |
+ return class_action_copy; |
|
1395 |
+}(class_action_adhoc)); |
|
1396 |
+/** |
|
1397 |
+ * @author fenris |
|
1398 |
+ */ |
|
1399 |
+var class_action_concat = (function (_super) { |
|
1400 |
+ __extends(class_action_concat, _super); |
|
1401 |
+ /** |
|
1402 |
+ * @author fenris |
|
1403 |
+ */ |
|
1404 |
+ function class_action_concat(filepointers_from, filepointer_to) { |
|
1405 |
+ _super.call(this); |
|
1406 |
+ this.filepointers_from = filepointers_from; |
|
1407 |
+ this.filepointer_to = filepointer_to; |
|
1408 |
+ } |
|
1409 |
+ /** |
|
1410 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1411 |
+ * @author fenris |
|
1412 |
+ */ |
|
1413 |
+ class_action_concat.prototype.compilation = function (target_identifier) { |
|
1414 |
+ switch (target_identifier) { |
|
1415 |
+ case "gnumake": { |
|
1416 |
+ switch (configuration["system"]) { |
|
1417 |
+ case "unix": { |
|
1418 |
+ var parts_1 = []; |
|
1419 |
+ parts_1.push("cat"); |
|
1420 |
+ this.filepointers_from.forEach(function (filepointer) { return parts_1.push(filepointer.toString()); }); |
|
1421 |
+ parts_1.push(">"); |
|
1422 |
+ parts_1.push(this.filepointer_to.toString()); |
|
1423 |
+ return parts_1.join(" "); |
|
1424 |
+ } |
|
1425 |
+ default: { |
|
1426 |
+ throw (new Error("not implemented")); |
|
1427 |
+ } |
|
1428 |
+ } |
|
1429 |
+ } |
|
1430 |
+ case "ant": { |
|
1431 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("concat", { "destfile": this.filepointer_to.toString() }, [ |
|
1432 |
+ new lib_xml.class_node_complex("filelist", { "dir": "." }, this.filepointers_from.map(function (filepointer) { |
|
1433 |
+ return (new lib_xml.class_node_complex("file", { "name": filepointer.toString() })); |
|
1434 |
+ })) |
|
1435 |
+ ]))); |
|
1436 |
+ } |
|
1437 |
+ default: { |
|
1438 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1439 |
+ } |
|
1440 |
+ } |
|
1441 |
+ }; |
|
1442 |
+ return class_action_concat; |
|
1443 |
+}(class_action_adhoc)); |
|
1444 |
+/** |
|
1445 |
+ * @author fenris |
|
1446 |
+ */ |
|
1447 |
+var class_action_lessc = (function (_super) { |
|
1448 |
+ __extends(class_action_lessc, _super); |
|
1449 |
+ /** |
|
1450 |
+ * @author fenris |
|
1451 |
+ */ |
|
1452 |
+ function class_action_lessc(filepointer_from, filepointer_to) { |
|
1453 |
+ _super.call(this); |
|
1454 |
+ this.filepointer_from = filepointer_from; |
|
1455 |
+ this.filepointer_to = filepointer_to; |
|
1456 |
+ } |
|
1457 |
+ /** |
|
1458 |
+ * @author fenris |
|
1459 |
+ */ |
|
1460 |
+ class_action_lessc.prototype.compilation = function (target_identifier) { |
|
1461 |
+ switch (target_identifier) { |
|
1462 |
+ case "gnumake": { |
|
1463 |
+ switch (configuration["system"]) { |
|
1464 |
+ case "unix": { |
|
1465 |
+ var parts = []; |
|
1466 |
+ parts.push("lessc"); |
|
1467 |
+ parts.push(this.filepointer_from.toString()); |
|
1468 |
+ parts.push(this.filepointer_to.toString()); |
|
1469 |
+ return parts.join(" "); |
|
1470 |
+ break; |
|
1471 |
+ } |
|
1472 |
+ default: { |
|
1473 |
+ throw (new Error("not implemented")); |
|
1474 |
+ break; |
|
1475 |
+ } |
|
1476 |
+ } |
|
1477 |
+ break; |
|
1478 |
+ } |
|
1479 |
+ case "ant": { |
|
1480 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("exec", { |
|
1481 |
+ "executable": "lessc", |
|
1482 |
+ "output": this.filepointer_to.toString(), |
|
1483 |
+ }, [ |
|
1484 |
+ new lib_xml.class_node_complex("arg", { "value": this.filepointer_from.toString() }), |
|
1485 |
+ ]))); |
|
1486 |
+ break; |
|
1487 |
+ } |
|
1488 |
+ default: { |
|
1489 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1490 |
+ break; |
|
1491 |
+ } |
|
1492 |
+ } |
|
1493 |
+ }; |
|
1494 |
+ return class_action_lessc; |
|
1495 |
+}(class_action_adhoc)); |
|
1496 |
+/** |
|
1497 |
+ * @author fenris |
|
1498 |
+ */ |
|
1499 |
+var class_action_tsc = (function (_super) { |
|
1500 |
+ __extends(class_action_tsc, _super); |
|
1501 |
+ /** |
|
1502 |
+ * @author fenris |
|
1503 |
+ */ |
|
1504 |
+ function class_action_tsc(paths_input, path_output, target, allowUnreachableCode, declaration) { |
|
1505 |
+ _super.call(this); |
|
1506 |
+ this.paths_input = paths_input; |
|
1507 |
+ this.path_output = path_output; |
|
1508 |
+ this.target = target; |
|
1509 |
+ this.allowUnreachableCode = allowUnreachableCode; |
|
1510 |
+ this.declaration = declaration; |
|
1511 |
+ } |
|
1512 |
+ /** |
|
1513 |
+ * @author fenris |
|
1514 |
+ */ |
|
1515 |
+ class_action_tsc.prototype.compilation = function (target_identifier) { |
|
1516 |
+ switch (target_identifier) { |
|
1517 |
+ case "gnumake": { |
|
1518 |
+ switch (configuration["system"]) { |
|
1519 |
+ case "unix": { |
|
1520 |
+ var parts_2 = []; |
|
1521 |
+ parts_2.push("tsc"); |
|
1522 |
+ if (this.allowUnreachableCode) |
|
1523 |
+ parts_2.push("--allowUnreachableCode"); |
|
1524 |
+ if (this.declaration) |
|
1525 |
+ parts_2.push("--declaration"); |
|
1526 |
+ if (this.target != null) |
|
1527 |
+ parts_2.push("--target"); |
|
1528 |
+ parts_2.push(this.target); |
|
1529 |
+ this.paths_input.forEach(function (filepointer) { return parts_2.push(filepointer.toString()); }); |
|
1530 |
+ parts_2.push("--outFile"); |
|
1531 |
+ parts_2.push(this.path_output.toString()); |
|
1532 |
+ return parts_2.join(" "); |
|
1533 |
+ break; |
|
1534 |
+ } |
|
1535 |
+ default: { |
|
1536 |
+ throw (new Error("not implemented")); |
|
1537 |
+ break; |
|
1538 |
+ } |
|
1539 |
+ } |
|
1540 |
+ break; |
|
1541 |
+ } |
|
1542 |
+ case "ant": { |
|
1543 |
+ return (new lib_ant.class_action(new lib_xml.class_node_complex("exec", { "executable": "tsc" }, ([] |
|
1544 |
+ .concat(this.paths_input.map(function (filepointer) { |
|
1545 |
+ return (new lib_xml.class_node_complex("arg", { "value": filepointer.toString() })); |
|
1546 |
+ })) |
|
1547 |
+ .concat(this.allowUnreachableCode |
|
1548 |
+ ? |
|
1549 |
+ [ |
|
1550 |
+ new lib_xml.class_node_complex("arg", { "value": "--allowUnreachableCode" }), |
|
1551 |
+ ] |
|
1552 |
+ : |
|
1553 |
+ []) |
|
1554 |
+ .concat((this.target != null) |
|
1555 |
+ ? |
|
1556 |
+ [ |
|
1557 |
+ new lib_xml.class_node_complex("arg", { "value": "--target" }), |
|
1558 |
+ new lib_xml.class_node_complex("arg", { "value": this.target }), |
|
1559 |
+ ] |
|
1560 |
+ : |
|
1561 |
+ []) |
|
1562 |
+ .concat([ |
|
1563 |
+ new lib_xml.class_node_complex("arg", { "value": "--outFile" }), |
|
1564 |
+ new lib_xml.class_node_complex("arg", { "value": this.path_output.toString() }), |
|
1565 |
+ ]))))); |
|
1566 |
+ break; |
|
1567 |
+ } |
|
1568 |
+ default: { |
|
1569 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1570 |
+ break; |
|
1571 |
+ } |
|
1572 |
+ } |
|
1573 |
+ }; |
|
1574 |
+ return class_action_tsc; |
|
1575 |
+}(class_action_adhoc)); |
|
1576 |
+/** |
|
1577 |
+ * @author fenris |
|
1578 |
+ */ |
|
1579 |
+var class_action_php = (function (_super) { |
|
1580 |
+ __extends(class_action_php, _super); |
|
1581 |
+ /** |
|
1582 |
+ * @author fenris |
|
1583 |
+ */ |
|
1584 |
+ function class_action_php(filepointers_from, filepointer_to, only_first) { |
|
1585 |
+ _super.call(this); |
|
1586 |
+ this.filepointers_from = filepointers_from; |
|
1587 |
+ this.filepointer_to = filepointer_to; |
|
1588 |
+ this.only_first = only_first; |
|
1589 |
+ } |
|
1590 |
+ /** |
|
1591 |
+ * @desc for defining directly how the action is to be converted into a target-piece |
|
1592 |
+ * @author fenris |
|
1593 |
+ */ |
|
1594 |
+ class_action_php.prototype.compilation = function (target_identifier) { |
|
1595 |
+ switch (target_identifier) { |
|
1596 |
+ case "gnumake": { |
|
1597 |
+ switch (configuration["system"]) { |
|
1598 |
+ case "unix": { |
|
1599 |
+ var parts_3 = []; |
|
1600 |
+ parts_3.push("php"); |
|
1601 |
+ if (this.only_first) { |
|
1602 |
+ parts_3.push(this.filepointers_from[0].toString()); |
|
1603 |
+ } |
|
1604 |
+ else { |
|
1605 |
+ this.filepointers_from.forEach(function (filepointer) { return parts_3.push(filepointer.toString()); }); |
|
1606 |
+ } |
|
1607 |
+ parts_3.push(">"); |
|
1608 |
+ parts_3.push(this.filepointer_to.toString()); |
|
1609 |
+ return parts_3.join(" "); |
|
1610 |
+ break; |
|
1611 |
+ } |
|
1612 |
+ default: { |
|
1613 |
+ throw (new Error("not implemented")); |
|
1614 |
+ break; |
|
1615 |
+ } |
|
1616 |
+ } |
|
1617 |
+ break; |
|
1618 |
+ } |
|
1619 |
+ case "ant": { |
|
1620 |
+ throw (new Error("not implemented")); |
|
1621 |
+ break; |
|
1622 |
+ } |
|
1623 |
+ default: { |
|
1624 |
+ throw (new Error("unhandled target '" + target_identifier + "'")); |
|
1625 |
+ break; |
|
1626 |
+ } |
|
1627 |
+ } |
|
1628 |
+ }; |
|
1629 |
+ return class_action_php; |
|
1630 |
+}(class_action_adhoc)); |
|
1631 |
+/** |
|
1632 |
+ * @author fenris |
|
1633 |
+ */ |
|
1634 |
+var class_task = (function () { |
|
1635 |
+ /** |
|
1636 |
+ * @author fenris |
|
1637 |
+ */ |
|
1638 |
+ function class_task(name, sub, active, parameters) { |
|
1639 |
+ if (sub === void 0) { sub = []; } |
|
1640 |
+ if (active === void 0) { active = true; } |
|
1641 |
+ if (parameters === void 0) { parameters = {}; } |
|
1642 |
+ this.identifier = genid("task_"); |
|
1643 |
+ this.name = (name != null) ? name : this.identifier; |
|
1644 |
+ this.sub = sub; |
|
1645 |
+ this.active = active; |
|
1646 |
+ this.parameters = parameters; |
|
1647 |
+ } |
|
1648 |
+ /** |
|
1649 |
+ * @author fenris |
|
1650 |
+ */ |
|
1651 |
+ class_task.prototype.identifier_get = function () { |
|
1652 |
+ return this.identifier; |
|
1653 |
+ }; |
|
1654 |
+ /** |
|
1655 |
+ * @author fenris |
|
1656 |
+ */ |
|
1657 |
+ class_task.prototype.name_get = function () { |
|
1658 |
+ return this.name; |
|
1659 |
+ }; |
|
1660 |
+ /** |
|
1661 |
+ * @author fenris |
|
1662 |
+ */ |
|
1663 |
+ class_task.prototype.sub_get = function () { |
|
1664 |
+ return this.sub; |
|
1665 |
+ }; |
|
1666 |
+ /** |
|
1667 |
+ * @author fenris |
|
1668 |
+ */ |
|
1669 |
+ class_task.prototype.active_get = function () { |
|
1670 |
+ return this.active; |
|
1671 |
+ }; |
|
1672 |
+ /** |
|
1673 |
+ * @returns the subgraph of all active tasks |
|
1674 |
+ * @author fenris |
|
1675 |
+ */ |
|
1676 |
+ class_task.prototype.clean = function (root) { |
|
1677 |
+ if (root === void 0) { root = true; } |
|
1678 |
+ if (root && (!this.active)) { |
|
1679 |
+ throw (new Error("cant't clean inactive root")); |
|
1680 |
+ } |
|
1681 |
+ else { |
|
1682 |
+ this.sub = this.sub.filter(function (task_) { return task_.active; }); |
|
1683 |
+ this.sub.forEach(function (task_) { return task_.clean(false); }); |
|
1684 |
+ } |
|
1685 |
+ }; |
|
1686 |
+ /** |
|
1687 |
+ * @author fenris |
|
1688 |
+ */ |
|
1689 |
+ class_task.register = function (id, factory) { |
|
1690 |
+ this.pool[id] = factory; |
|
1691 |
+ }; |
|
1692 |
+ /** |
|
1693 |
+ * @author fenris |
|
1694 |
+ */ |
|
1695 |
+ class_task.get = function (id) { |
|
1696 |
+ return this.pool[id]; |
|
1697 |
+ }; |
|
1698 |
+ /** |
|
1699 |
+ * @author fenris |
|
1700 |
+ */ |
|
1701 |
+ class_task.pool = {}; |
|
1702 |
+ return class_task; |
|
1703 |
+}()); |
|
1704 |
+/** |
|
1705 |
+ * @author fenris |
|
1706 |
+ */ |
|
1707 |
+var class_task_group = (function (_super) { |
|
1708 |
+ __extends(class_task_group, _super); |
|
1709 |
+ function class_task_group() { |
|
1710 |
+ _super.apply(this, arguments); |
|
1711 |
+ } |
|
1712 |
+ /** |
|
1713 |
+ * @author fenris |
|
1714 |
+ */ |
|
1715 |
+ class_task_group.create = function (name, sub, active, parameters) { |
|
1716 |
+ return (new class_task_group(name, sub, active)); |
|
1717 |
+ }; |
|
1718 |
+ /** |
|
1719 |
+ * @override |
|
1720 |
+ * @author fenris |
|
1721 |
+ */ |
|
1722 |
+ class_task_group.prototype.inputs = function () { |
|
1723 |
+ return []; |
|
1724 |
+ }; |
|
1725 |
+ /** |
|
1726 |
+ * @override |
|
1727 |
+ * @author fenris |
|
1728 |
+ */ |
|
1729 |
+ class_task_group.prototype.outputs = function () { |
|
1730 |
+ return []; |
|
1731 |
+ }; |
|
1732 |
+ /** |
|
1733 |
+ * @override |
|
1734 |
+ * @author fenris |
|
1735 |
+ */ |
|
1736 |
+ class_task_group.prototype.actions = function () { |
|
1737 |
+ return []; |
|
1738 |
+ }; |
|
1739 |
+ return class_task_group; |
|
1740 |
+}(class_task)); |
|
1741 |
+class_task.register("group", /*(name, sub, active, parameters) => */ class_task_group.create /*(name, sub, active, parameters)*/); |
|
1742 |
+/** |
|
1743 |
+ * @author fenris |
|
1744 |
+ */ |
|
1745 |
+var class_task_dependency = (function (_super) { |
|
1746 |
+ __extends(class_task_dependency, _super); |
|
1747 |
+ /** |
|
1748 |
+ * @author fenris |
|
1749 |
+ */ |
|
1750 |
+ function class_task_dependency(name, sub, active, filepointer_project, target, raw, workdir // = null |
|
1751 |
+ ) { |
|
1752 |
+ if (name === void 0) { name = null; } |
|
1753 |
+ if (sub === void 0) { sub = []; } |
|
1754 |
+ if (active === void 0) { active = true; } |
|
1755 |
+ if (filepointer_project === void 0) { filepointer_project = null; } |
|
1756 |
+ if (target === void 0) { target = configuration["target"]; } |
|
1757 |
+ if (raw === void 0) { raw = true; } |
|
1758 |
+ if (workdir === void 0) { workdir = filepointer_project.location; } |
|
1759 |
+ _super.call(this, name, sub, active); |
|
1760 |
+ this.filepointer_project = filepointer_project; |
|
1761 |
+ this.target = target; |
|
1762 |
+ this.raw = raw; |
|
1763 |
+ this.workdir = workdir; |
|
1764 |
+ } |
|
1765 |
+ /** |
|
1766 |
+ * @override |
|
1767 |
+ * @author fenris |
|
1768 |
+ */ |
|
1769 |
+ class_task_dependency.prototype.inputs = function () { |
|
1770 |
+ return [this.filepointer_project]; |
|
1771 |
+ }; |
|
1772 |
+ /** |
|
1773 |
+ * @override |
|
1774 |
+ * @author fenris |
|
1775 |
+ */ |
|
1776 |
+ class_task_dependency.prototype.outputs = function () { |
|
1777 |
+ return []; |
|
1778 |
+ }; |
|
1779 |
+ /** |
|
1780 |
+ * @author fenris |
|
1781 |
+ */ |
|
1782 |
+ class_task_dependency.prototype.actions = function () { |
|
1783 |
+ switch (this.target) { |
|
1784 |
+ case "gnumake": { |
|
1785 |
+ var filepointer_buildfile = new lib_path.class_filepointer(configuration["tempfolder"], "makefile"); |
|
1786 |
+ return [ |
|
1787 |
+ new class_action_koralle(this.filepointer_project, filepointer_buildfile, this.target, this.raw), |
|
1788 |
+ new class_action_gnumake(filepointer_buildfile, this.workdir), |
|
1789 |
+ ]; |
|
1790 |
+ } |
|
1791 |
+ case "ant": { |
|
1792 |
+ var filepointer_buildfile = new lib_path.class_filepointer(configuration["tempfolder"], "build.xml"); |
|
1793 |
+ return [ |
|
1794 |
+ new class_action_koralle(this.filepointer_project, filepointer_buildfile, this.target, this.raw), |
|
1795 |
+ new class_action_ant(filepointer_buildfile, this.workdir), |
|
1796 |
+ ]; |
|
1797 |
+ } |
|
1798 |
+ default: { |
|
1799 |
+ throw (new Error("unhandled target '" + this.target + "'")); |
|
1800 |
+ break; |
|
1801 |
+ } |
|
1802 |
+ } |
|
1803 |
+ }; |
|
1804 |
+ return class_task_dependency; |
|
1805 |
+}(class_task)); |
|
1806 |
+/** |
|
1807 |
+ * @author fenris |
|
1808 |
+ */ |
|
1809 |
+var class_task_script = (function (_super) { |
|
1810 |
+ __extends(class_task_script, _super); |
|
1811 |
+ /** |
|
1812 |
+ * @author fenris |
|
1813 |
+ */ |
|
1814 |
+ function class_task_script(name, sub, active, inputs_, outputs_, path, interpreter) { |
|
1815 |
+ if (name === void 0) { name = null; } |
|
1816 |
+ if (sub === void 0) { sub = []; } |
|
1817 |
+ if (active === void 0) { active = true; } |
|
1818 |
+ if (interpreter === void 0) { interpreter = null; } |
|
1819 |
+ _super.call(this, name, sub, active); |
|
1820 |
+ this.inputs_ = inputs_; |
|
1821 |
+ this.outputs_ = outputs_; |
|
1822 |
+ this.path = path; |
|
1823 |
+ this.interpreter = interpreter; |
|
1824 |
+ } |
|
1825 |
+ /** |
|
1826 |
+ * @author fenris |
|
1827 |
+ */ |
|
1828 |
+ class_task_script.create = function (name, sub, active, parameters) { |
|
1829 |
+ var interpreter_raw = fetch(parameters, "interpreter", null, 1); |
|
1830 |
+ var interpreter = ((interpreter_raw == null) ? null : lib_path.class_filepointer.read(interpreter_raw)); |
|
1831 |
+ return (new class_task_script(name, sub, active, fetch(parameters, "inputs", [], 1).map(function (s) { return lib_path.class_filepointer.read(s); }), fetch(parameters, "outputs", [], 1).map(function (s) { return lib_path.class_filepointer.read(s); }), lib_path.class_filepointer.read(fetch(parameters, "path", null, 2)), interpreter)); |
|
1832 |
+ }; |
|
1833 |
+ /** |
|
1834 |
+ * @override |
|
1835 |
+ * @author fenris |
|
1836 |
+ */ |
|
1837 |
+ class_task_script.prototype.inputs = function () { |
|
1838 |
+ return this.inputs_; |
|
1839 |
+ }; |
|
1840 |
+ /** |
|
1841 |
+ * @override |
|
1842 |
+ * @author fenris |
|
1843 |
+ */ |
|
1844 |
+ class_task_script.prototype.outputs = function () { |
|
1845 |
+ return this.outputs_; |
|
1846 |
+ }; |
|
1847 |
+ /** |
|
1848 |
+ * @author fenris |
|
1849 |
+ */ |
|
1850 |
+ class_task_script.prototype.actions = function () { |
|
1851 |
+ return ([] |
|
1852 |
+ .concat(this.outputs_.map(function (output) { return new class_action_mkdir(output.location); })) |
|
1853 |
+ .concat([ |
|
1854 |
+ new class_action_exec(this.inputs_, this.outputs_, this.path, this.interpreter), |
|
1855 |
+ ])); |
|
1856 |
+ }; |
|
1857 |
+ return class_task_script; |
|
1858 |
+}(class_task)); |
|
1859 |
+class_task.register("script", /*(name, sub, active, parameters) => */ class_task_script.create /*(name, sub, active, parameters)*/); |
|
1860 |
+/** |
|
1861 |
+ * @author fenris |
|
1862 |
+ */ |
|
1863 |
+var class_task_empty = (function (_super) { |
|
1864 |
+ __extends(class_task_empty, _super); |
|
1865 |
+ /** |
|
1866 |
+ * @author fenris |
|
1867 |
+ */ |
|
1868 |
+ function class_task_empty(name, sub, active, output_) { |
|
1869 |
+ if (name === void 0) { name = null; } |
|
1870 |
+ if (sub === void 0) { sub = []; } |
|
1871 |
+ if (active === void 0) { active = true; } |
|
1872 |
+ if (output_ === void 0) { output_ = null; } |
|
1873 |
+ _super.call(this, name, sub, active); |
|
1874 |
+ this.output_ = output_; |
|
1875 |
+ } |
|
1876 |
+ /** |
|
1877 |
+ * @author fenris |
|
1878 |
+ */ |
|
1879 |
+ class_task_empty.create = function (name, sub, active, parameters) { |
|
1880 |
+ return (new class_task_empty(name, sub, active, lib_path.class_filepointer.read(fetch(parameters, "output", null, 2)))); |
|
1881 |
+ }; |
|
1882 |
+ /** |
|
1883 |
+ * @override |
|
1884 |
+ * @author fenris |
|
1885 |
+ */ |
|
1886 |
+ class_task_empty.prototype.inputs = function () { |
|
1887 |
+ return []; |
|
1888 |
+ }; |
|
1889 |
+ /** |
|
1890 |
+ * @override |
|
1891 |
+ * @author fenris |
|
1892 |
+ */ |
|
1893 |
+ class_task_empty.prototype.outputs = function () { |
|
1894 |
+ return [this.output_]; |
|
1895 |
+ }; |
|
1896 |
+ /** |
|
1897 |
+ * @override |
|
1898 |
+ * @author fenris |
|
1899 |
+ */ |
|
1900 |
+ class_task_empty.prototype.actions = function () { |
|
1901 |
+ return [ |
|
1902 |
+ new class_action_mkdir(this.output_.location), |
|
1903 |
+ new class_action_touch(this.output_), |
|
1904 |
+ ]; |
|
1905 |
+ }; |
|
1906 |
+ return class_task_empty; |
|
1907 |
+}(class_task)); |
|
1908 |
+class_task.register("empty", /*(name, sub, active, parameters) => */ class_task_empty.create /*(name, sub, active, parameters)*/); |
|
1909 |
+/** |
|
1910 |
+ * @author fenris |
|
1911 |
+ */ |
|
1912 |
+var class_task_copy = (function (_super) { |
|
1913 |
+ __extends(class_task_copy, _super); |
|
1914 |
+ /** |
|
1915 |
+ * @author fenris |
|
1916 |
+ */ |
|
1917 |
+ function class_task_copy(name, sub, active, input_, output_, folder) { |
|
1918 |
+ if (name === void 0) { name = null; } |
|
1919 |
+ if (sub === void 0) { sub = []; } |
|
1920 |
+ if (active === void 0) { active = true; } |
|
1921 |
+ if (input_ === void 0) { input_ = null; } |
|
1922 |
+ if (output_ === void 0) { output_ = null; } |
|
1923 |
+ if (folder === void 0) { folder = null; } |
|
1924 |
+ _super.call(this, name, sub, active); |
|
1925 |
+ this.input_ = input_; |
|
1926 |
+ this.output_ = output_; |
|
1927 |
+ this.folder = folder; |
|
1928 |
+ } |
|
1929 |
+ /** |
|
1930 |
+ * @author fenris |
|
1931 |
+ */ |
|
1932 |
+ class_task_copy.create = function (name, sub, active, parameters) { |
|
1933 |
+ return (new class_task_copy(name, sub, active, lib_path.class_filepointer.read(fetch(parameters, "input", null, 2)), lib_path.class_filepointer.read(fetch(parameters, "output", null, 2)), fetch(parameters, "folder", false, 0))); |
|
1934 |
+ }; |
|
1935 |
+ /** |
|
1936 |
+ * @override |
|
1937 |
+ * @author fenris |
|
1938 |
+ */ |
|
1939 |
+ class_task_copy.prototype.inputs = function () { |
|
1940 |
+ return [this.input_]; |
|
1941 |
+ }; |
|
1942 |
+ /** |
|
1943 |
+ * @override |
|
1944 |
+ * @author fenris |
|
1945 |
+ */ |
|
1946 |
+ class_task_copy.prototype.outputs = function () { |
|
1947 |
+ return [this.output_]; |
|
1948 |
+ }; |
|
1949 |
+ /** |
|
1950 |
+ * @author fenris |
|
1951 |
+ */ |
|
1952 |
+ class_task_copy.prototype.actions = function () { |
|
1953 |
+ return [ |
|
1954 |
+ new class_action_mkdir(this.output_.location), |
|
1955 |
+ new class_action_copy(this.input_, this.output_, this.folder), |
|
1956 |
+ ]; |
|
1957 |
+ }; |
|
1958 |
+ return class_task_copy; |
|
1959 |
+}(class_task)); |
|
1960 |
+class_task.register("copy", /*(name, sub, active, parameters) => */ class_task_copy.create /*(name, sub, active, parameters)*/); |
|
1961 |
+/** |
|
1962 |
+ * @author fenris |
|
1963 |
+ */ |
|
1964 |
+var class_task_concat = (function (_super) { |
|
1965 |
+ __extends(class_task_concat, _super); |
|
1966 |
+ /** |
|
1967 |
+ * @author fenris |
|
1968 |
+ */ |
|
1969 |
+ function class_task_concat(name, sub, active, inputs_, output_) { |
|
1970 |
+ if (name === void 0) { name = null; } |
|
1971 |
+ if (sub === void 0) { sub = []; } |
|
1972 |
+ if (active === void 0) { active = true; } |
|
1973 |
+ if (inputs_ === void 0) { inputs_ = null; } |
|
1974 |
+ if (output_ === void 0) { output_ = null; } |
|
1975 |
+ _super.call(this, name, sub, active); |
|
1976 |
+ this.inputs_ = inputs_; |
|
1977 |
+ this.output_ = output_; |
|
1978 |
+ } |
|
1979 |
+ /** |
|
1980 |
+ * @author fenris |
|
1981 |
+ */ |
|
1982 |
+ class_task_concat.create = function (name, sub, active, parameters) { |
|
1983 |
+ return (new class_task_concat(name, sub, active, fetch(parameters, "inputs", [], 2).map(function (s) { return lib_path.class_filepointer.read(s); }), lib_path.class_filepointer.read(fetch(parameters, "output", null, 2)))); |
|
1984 |
+ }; |
|
1985 |
+ /** |
|
1986 |
+ * @override |
|
1987 |
+ * @author fenris |
|
1988 |
+ */ |
|
1989 |
+ class_task_concat.prototype.inputs = function () { |
|
1990 |
+ return this.inputs_; |
|
1991 |
+ }; |
|
1992 |
+ /** |
|
1993 |
+ * @override |
|
1994 |
+ * @author fenris |
|
1995 |
+ */ |
|
1996 |
+ class_task_concat.prototype.outputs = function () { |
|
1997 |
+ return [this.output_]; |
|
1998 |
+ }; |
|
1999 |
+ /** |
|
2000 |
+ * @override |
|
2001 |
+ * @author fenris |
|
2002 |
+ */ |
|
2003 |
+ class_task_concat.prototype.actions = function () { |
|
2004 |
+ return [ |
|
2005 |
+ new class_action_mkdir(this.output_.location), |
|
2006 |
+ new class_action_concat(this.inputs_, this.output_), |
|
2007 |
+ ]; |
|
2008 |
+ }; |
|
2009 |
+ return class_task_concat; |
|
2010 |
+}(class_task)); |
|
2011 |
+class_task.register("concat", /*(name, sub, active, parameters) => */ class_task_concat.create /*(name, sub, active, parameters)*/); |
|
2012 |
+/** |
|
2013 |
+ * @author fenris |
|
2014 |
+ */ |
|
2015 |
+var class_task_lesscss = (function (_super) { |
|
2016 |
+ __extends(class_task_lesscss, _super); |
|
2017 |
+ /** |
|
2018 |
+ * @author fenris |
|
2019 |
+ */ |
|
2020 |
+ function class_task_lesscss(name, sub, active, inputs_, output_) { |
|
2021 |
+ if (name === void 0) { name = null; } |
|
2022 |
+ if (sub === void 0) { sub = []; } |
|
2023 |
+ if (active === void 0) { active = true; } |
|
2024 |
+ if (inputs_ === void 0) { inputs_ = null; } |
|
2025 |
+ if (output_ === void 0) { output_ = null; } |
|
2026 |
+ _super.call(this, name, sub, active); |
|
2027 |
+ this.inputs_ = inputs_; |
|
2028 |
+ this.output_ = output_; |
|
2029 |
+ } |
|
2030 |
+ /** |
|
2031 |
+ * @author fenris |
|
2032 |
+ */ |
|
2033 |
+ class_task_lesscss.create = function (name, sub, active, parameters) { |
|
2034 |
+ return (new class_task_lesscss(name, sub, active, fetch(parameters, "inputs", null, 2).map(function (s) { return lib_path.class_filepointer.read(s); }), lib_path.class_filepointer.read(fetch(parameters, "output", null, 2)))); |
|
2035 |
+ }; |
|
2036 |
+ /** |
|
2037 |
+ * @override |
|
2038 |
+ * @author fenris |
|
2039 |
+ */ |
|
2040 |
+ class_task_lesscss.prototype.inputs = function () { |
|
2041 |
+ return this.inputs_; |
|
2042 |
+ }; |
|
2043 |
+ /** |
|
2044 |
+ * @override |
|
2045 |
+ * @author fenris |
|
2046 |
+ */ |
|
2047 |
+ class_task_lesscss.prototype.outputs = function () { |
|
2048 |
+ return [this.output_]; |
|
2049 |
+ }; |
|
2050 |
+ /** |
|
2051 |
+ * @author fenris |
|
2052 |
+ */ |
|
2053 |
+ class_task_lesscss.prototype.actions = function () { |
|
2054 |
+ var filepointer_temp = new lib_path.class_filepointer(lib_path.class_location.read(configuration["tempfolder"]), "_.less"); |
|
2055 |
+ return [ |
|
2056 |
+ new class_action_mkdir(this.output_.location), |
|
2057 |
+ new class_action_concat(this.inputs_, filepointer_temp), |
|
2058 |
+ new class_action_lessc(filepointer_temp, this.output_), |
|
2059 |
+ ]; |
|
2060 |
+ }; |
|
2061 |
+ return class_task_lesscss; |
|
2062 |
+}(class_task)); |
|
2063 |
+class_task.register("lesscss", /*(name, sub, active, parameters) => */ class_task_lesscss.create /*(name, sub, active, parameters)*/); |
|
2064 |
+/** |
|
2065 |
+ * @author fenris |
|
2066 |
+ */ |
|
2067 |
+var class_task_typescript = (function (_super) { |
|
2068 |
+ __extends(class_task_typescript, _super); |
|
2069 |
+ /** |
|
2070 |
+ * @author fenris |
|
2071 |
+ */ |
|
2072 |
+ function class_task_typescript(name, sub, active, inputs_, output_, target, allowUnreachableCode, declaration) { |
|
2073 |
+ if (name === void 0) { name = null; } |
|
2074 |
+ if (sub === void 0) { sub = []; } |
|
2075 |
+ if (active === void 0) { active = true; } |
|
2076 |
+ if (inputs_ === void 0) { inputs_ = null; } |
|
2077 |
+ if (output_ === void 0) { output_ = null; } |
|
2078 |
+ if (target === void 0) { target = null; } |
|
2079 |
+ if (allowUnreachableCode === void 0) { allowUnreachableCode = null; } |
|
2080 |
+ if (declaration === void 0) { declaration = null; } |
|
2081 |
+ _super.call(this, name, sub, active); |
|
2082 |
+ this.inputs_ = inputs_; |
|
2083 |
+ this.output_ = output_; |
|
2084 |
+ this.target = target; |
|
2085 |
+ this.allowUnreachableCode = allowUnreachableCode; |
|
2086 |
+ this.declaration = declaration; |
|
2087 |
+ } |
|
2088 |
+ /** |
|
2089 |
+ * @author fenris |
|
2090 |
+ */ |
|
2091 |
+ class_task_typescript.create = function (name, sub, active, parameters) { |
|
2092 |
+ return (new class_task_typescript(name, sub, active, fetch(parameters, "inputs", [], 1).map(function (s) { return lib_path.class_filepointer.read(s); }), lib_path.class_filepointer.read(fetch(parameters, "output", null, 2)), fetch(parameters, "target", null, 0), fetch(parameters, "allowUnreachableCode", false, 0), fetch(parameters, "declaration", false, 0))); |
|
2093 |
+ }; |
|
2094 |
+ /** |
|
2095 |
+ * @override |
|
2096 |
+ * @author fenris |
|
2097 |
+ */ |
|
2098 |
+ class_task_typescript.prototype.inputs = function () { |
|
2099 |
+ return this.inputs_; |
|
2100 |
+ }; |
|
2101 |
+ /** |
|
2102 |
+ * @override |
|
2103 |
+ * @author fenris |
|
2104 |
+ */ |
|
2105 |
+ class_task_typescript.prototype.outputs = function () { |
|
2106 |
+ return [this.output_]; |
|
2107 |
+ }; |
|
2108 |
+ /** |
|
2109 |
+ * @author fenris |
|
2110 |
+ */ |
|
2111 |
+ class_task_typescript.prototype.actions = function () { |
|
2112 |
+ return [ |
|
2113 |
+ new class_action_mkdir(this.output_.location), |
|
2114 |
+ new class_action_tsc(this.inputs_, this.output_, this.target, this.allowUnreachableCode, this.declaration), |
|
2115 |
+ ]; |
|
2116 |
+ }; |
|
2117 |
+ return class_task_typescript; |
|
2118 |
+}(class_task)); |
|
2119 |
+class_task.register("typescript", /*(name, sub, active, parameters) => */ class_task_typescript.create /*(name, sub, active, parameters)*/); |
|
2120 |
+/** |
|
2121 |
+ * @author fenris |
|
2122 |
+ */ |
|
2123 |
+var class_task_php = (function (_super) { |
|
2124 |
+ __extends(class_task_php, _super); |
|
2125 |
+ /** |
|
2126 |
+ * @author fenris |
|
2127 |
+ */ |
|
2128 |
+ function class_task_php(name, sub, active, inputs_, output_, only_first) { |
|
2129 |
+ if (name === void 0) { name = null; } |
|
2130 |
+ if (sub === void 0) { sub = []; } |
|
2131 |
+ if (active === void 0) { active = true; } |
|
2132 |
+ if (inputs_ === void 0) { inputs_ = null; } |
|
2133 |
+ if (output_ === void 0) { output_ = null; } |
|
2134 |
+ if (only_first === void 0) { only_first = null; } |
|
2135 |
+ _super.call(this, name, sub, active); |
|
2136 |
+ this.inputs_ = inputs_; |
|
2137 |
+ this.output_ = output_; |
|
2138 |
+ this.only_first = only_first; |
|
2139 |
+ } |
|
2140 |
+ /** |
|
2141 |
+ * @author fenris |
|
2142 |
+ */ |
|
2143 |
+ class_task_php.create = function (name, sub, active, parameters) { |
|
2144 |
+ return (new class_task_php(name, sub, active, fetch(parameters, "inputs", [], 2).map(function (s) { return lib_path.class_filepointer.read(s); }), lib_path.class_filepointer.read(fetch(parameters, "output", null, 2)), fetch(parameters, "only_first", false, 0))); |
|
2145 |
+ }; |
|
2146 |
+ /** |
|
2147 |
+ * @override |
|
2148 |
+ * @author fenris |
|
2149 |
+ */ |
|
2150 |
+ class_task_php.prototype.inputs = function () { |
|
2151 |
+ return this.inputs_; |
|
2152 |
+ }; |
|
2153 |
+ /** |
|
2154 |
+ * @override |
|
2155 |
+ * @author fenris |
|
2156 |
+ */ |
|
2157 |
+ class_task_php.prototype.outputs = function () { |
|
2158 |
+ return [this.output_]; |
|
2159 |
+ }; |
|
2160 |
+ /** |
|
2161 |
+ * @author fenris |
|
2162 |
+ */ |
|
2163 |
+ class_task_php.prototype.actions = function () { |
|
2164 |
+ return [ |
|
2165 |
+ new class_action_mkdir(this.output_.location), |
|
2166 |
+ new class_action_php(this.inputs_, this.output_, this.only_first), |
|
2167 |
+ ]; |
|
2168 |
+ }; |
|
2169 |
+ return class_task_php; |
|
2170 |
+}(class_task)); |
|
2171 |
+class_task.register("php", /*(name, sub, active, parameters) => */ class_task_php.create /*(name, sub, active, parameters)*/); |
|
2172 |
+/** |
|
2173 |
+ * @author fenris |
|
2174 |
+ */ |
|
2175 |
+var class_target = (function () { |
|
2176 |
+ /** |
|
2177 |
+ * @author fenris |
|
2178 |
+ */ |
|
2179 |
+ function class_target() { |
|
2180 |
+ } |
|
2181 |
+ return class_target; |
|
2182 |
+}()); |
|
2183 |
+/** |
|
2184 |
+ * @author fenris |
|
2185 |
+ */ |
|
2186 |
+var class_target_regular = (function (_super) { |
|
2187 |
+ __extends(class_target_regular, _super); |
|
2188 |
+ /** |
|
2189 |
+ * @author fenris |
|
2190 |
+ */ |
|
2191 |
+ function class_target_regular(identifier) { |
|
2192 |
+ _super.call(this); |
|
2193 |
+ this.identifier = identifier; |
|
2194 |
+ } |
|
2195 |
+ /** |
|
2196 |
+ * @author fenris |
|
2197 |
+ */ |
|
2198 |
+ class_target_regular.prototype.compile_action = function (action) { |
|
2199 |
+ if (action instanceof class_action_adhoc) { |
|
2200 |
+ var action_ = (action); |
|
2201 |
+ return (action_.compilation(this.identifier)); |
|
2202 |
+ } |
|
2203 |
+ else { |
|
2204 |
+ throw (new Error("no delegation for action '" + JSON.stringify(action) + "'")); |
|
2205 |
+ } |
|
2206 |
+ }; |
|
2207 |
+ return class_target_regular; |
|
2208 |
+}(class_target)); |
|
2209 |
+/** |
|
2210 |
+ * @author fenris |
|
2211 |
+ */ |
|
2212 |
+var class_target_ant = (function (_super) { |
|
2213 |
+ __extends(class_target_ant, _super); |
|
2214 |
+ /** |
|
2215 |
+ * @author fenris |
|
2216 |
+ */ |
|
2217 |
+ function class_target_ant() { |
|
2218 |
+ _super.call(this, "ant"); |
|
2219 |
+ } |
|
2220 |
+ /** |
|
2221 |
+ * @author fenris |
|
2222 |
+ */ |
|
2223 |
+ class_target_ant.prototype.compile_task = function (task, path) { |
|
2224 |
+ var _this = this; |
|
2225 |
+ if (path === void 0) { path = []; } |
|
2226 |
+ var path_ = [task.name_get()]; |
|
2227 |
+ var targets_core = [ |
|
2228 |
+ new lib_ant.class_target({ |
|
2229 |
+ "name": path_.join("-"), |
|
2230 |
+ "dependencies": (task.sub_get() |
|
2231 |
+ .filter(function (task_) { return task_.active_get(); }) |
|
2232 |
+ .map(function (task_) { return [task_.name_get()] /*)*/.join("-"); })), |
|
2233 |
+ "actions": ([] |
|
2234 |
+ .concat([new class_action_echo(task.name_get())]) |
|
2235 |
+ .concat(task.actions()) |
|
2236 |
+ .map(function (action) { return _this.compile_action(action); })) |
|
2237 |
+ }) |
|
2238 |
+ ]; |
|
2239 |
+ var targets_sub = task.sub_get() |
|
2240 |
+ .map(function (task_) { return _this.compile_task(task_, path_); }) |
|
2241 |
+ .reduce(function (x, y) { return x.concat(y); }, []); |
|
2242 |
+ return [].concat(targets_core).concat(targets_sub); |
|
2243 |
+ }; |
|
2244 |
+ /** |
|
2245 |
+ * @author fenris |
|
2246 |
+ */ |
|
2247 |
+ class_target_ant.prototype.compile_project = function (project, without_dependencies) { |
|
2248 |
+ var _this = this; |
|
2249 |
+ if (without_dependencies === void 0) { without_dependencies = false; } |
|
2250 |
+ var that = this; |
|
2251 |
+ var comments = [ |
|
2252 |
+ // new lib_ant.class_comment("Project \"" + project.name_get() + "\""), |
|
2253 |
+ new lib_ant.class_comment("This build script was generated by Koralle " + configuration["version"]), |
|
2254 |
+ ]; |
|
2255 |
+ var dependencies = project.dependencies_get().map(function (path, index) { |
|
2256 |
+ return (new class_task_dependency("__dependency_" + index.toString(), [], true, lib_path.class_filepointer.read(path), that.identifier, true, undefined)); |
|
2257 |
+ }); |
|
2258 |
+ var targets = [] |
|
2259 |
+ .concat([ |
|
2260 |
+ new lib_ant.class_target({ |
|
2261 |
+ "name": "__root", |
|
2262 |
+ "dependencies": ["__dependencies", "__core"], |
|
2263 |
+ }) |
|
2264 |
+ ]) |
|
2265 |
+ .concat([ |
|
2266 |
+ new lib_ant.class_target({ |
|
2267 |
+ "name": "__dependencies", |
|
2268 |
+ "dependencies": without_dependencies ? [] : dependencies.map(function (dependency) { return dependency.name_get(); }), |
|
2269 |
+ }) |
|
2270 |
+ ]) |
|
2271 |
+ .concat(dependencies.map(function (dependency) { return _this.compile_task(dependency); }).reduce(function (x, y) { return x.concat(y); }, [])) |
|
2272 |
+ .concat([ |
|
2273 |
+ new lib_ant.class_target({ |
|
2274 |
+ "name": "__core", |
|
2275 |
+ "dependencies": [project.roottask_get().name_get()], |
|
2276 |
+ }) |
|
2277 |
+ ]) |
|
2278 |
+ .concat(this.compile_task(project.roottask_get())); |
|
2279 |
+ return (new lib_ant.class_project({ |
|
2280 |
+ "name": project.name_get(), |
|
2281 |
+ "default": "__root", |
|
2282 |
+ "comments": comments, |
|
2283 |
+ "targets": targets, |
|
2284 |
+ })); |
|
2285 |
+ }; |
|
2286 |
+ /** |
|
2287 |
+ * @override |
|
2288 |
+ * @author fenris |
|
2289 |
+ */ |
|
2290 |
+ class_target_ant.prototype.compile_project_string = function (project) { |
|
2291 |
+ return this.compile_project(project).compile().compile(); |
|
2292 |
+ }; |
|
2293 |
+ /** |
|
2294 |
+ * @override |
|
2295 |
+ * @author fenris |
|
2296 |
+ */ |
|
2297 |
+ class_target_ant.prototype.execute = function (filepointer) { |
|
2298 |
+ return (function (resolve, reject) { |
|
2299 |
+ var command = [ |
|
2300 |
+ "ant", |
|
2301 |
+ "-file " + filepointer.toString(), |
|
2302 |
+ ].join(" "); |
|
2303 |
+ _child_process.exec(command, {}, function (stdout, stderr, error) { |
|
2304 |
+ if (error != null) { |
|
2305 |
+ reject(error); |
|
2306 |
+ } |
|
2307 |
+ else { |
|
2308 |
+ resolve(undefined); |
|
2309 |
+ } |
|
2310 |
+ }); |
|
2311 |
+ }); |
|
2312 |
+ }; |
|
2313 |
+ return class_target_ant; |
|
2314 |
+}(class_target_regular)); |
|
2315 |
+/** |
|
2316 |
+ * @author fenris |
|
2317 |
+ */ |
|
2318 |
+var class_target_gnumake = (function (_super) { |
|
2319 |
+ __extends(class_target_gnumake, _super); |
|
2320 |
+ /** |
|
2321 |
+ * @author fenris |
|
2322 |
+ */ |
|
2323 |
+ function class_target_gnumake() { |
|
2324 |
+ _super.call(this, "gnumake"); |
|
2325 |
+ } |
|
2326 |
+ /** |
|
2327 |
+ * @author fenris |
|
2328 |
+ */ |
|
2329 |
+ class_target_gnumake.prototype.compile_task = function (task, path, depth, prefix) { |
|
2330 |
+ var _this = this; |
|
2331 |
+ if (path === void 0) { path = []; } |
|
2332 |
+ if (depth === void 0) { depth = 0; } |
|
2333 |
+ if (prefix === void 0) { prefix = null; } |
|
2334 |
+ var path_ = [task.name_get()]; |
|
2335 |
+ var logging_begin = new class_action_echo((new class_message("processing \"" + path_.join("-") + "\" ...", { "type": "log", "depth": depth, "prefix": prefix })).generate()); |
|
2336 |
+ var logging_end = new class_action_echo((new class_message("... finished \"" + path_.join("-") + "\"", { "type": "log", "depth": depth, "prefix": prefix })).generate()); |
|
2337 |
+ var rules_core = []; |
|
2338 |
+ { |
|
2339 |
+ // meta rule |
|
2340 |
+ rules_core.push(new lib_gnumake.class_rule({ |
|
2341 |
+ "name": path_.join("-"), |
|
2342 |
+ "dependencies": ([] |
|
2343 |
+ .concat(["__logging_" + path_.join("-")]) |
|
2344 |
+ .concat(task.sub_get() |
|
2345 |
+ .filter(function (task_) { return task_.active_get(); }) |
|
2346 |
+ .map(function (task_) { return [task_.name_get()] /*)*/.join("-"); })) |
|
2347 |
+ .concat(task.outputs().map(function (filepointer) { return filepointer.toString(); }))), |
|
2348 |
+ "actions": ([] |
|
2349 |
+ .concat((task.outputs().length == 0) ? task.actions() : []) |
|
2350 |
+ .map(function (action) { return _this.compile_action(action); })), |
|
2351 |
+ "phony": true, |
|
2352 |
+ })); |
|
2353 |
+ // logging |
|
2354 |
+ rules_core.push(new lib_gnumake.class_rule({ |
|
2355 |
+ "name": ("__logging_" + path_.join("-")), |
|
2356 |
+ "actions": [logging_begin].map(function (action) { return _this.compile_action(action); }), |
|
2357 |
+ "phony": true, |
|
2358 |
+ })); |
|
2359 |
+ // actual rule |
|
2360 |
+ if (task.outputs().length > 0) { |
|
2361 |
+ rules_core.push(new lib_gnumake.class_rule({ |
|
2362 |
+ "name": task.outputs().map(function (filepointer) { return filepointer.toString(); }).join(" "), |
|
2363 |
+ "dependencies": task.inputs().map(function (filepointer) { return filepointer.toString(); }), |
|
2364 |
+ "actions": task.actions().map(function (action) { return _this.compile_action(action); }), |
|
2365 |
+ "phony": false, |
|
2366 |
+ })); |
|
2367 |
+ } |
|
2368 |
+ } |
|
2369 |
+ var rules_sub = []; |
|
2370 |
+ { |
|
2371 |
+ rules_sub = task.sub_get() |
|
2372 |
+ .map(function (task_) { return _this.compile_task(task_, path_, depth + 1, prefix); }) |
|
2373 |
+ .reduce(function (x, y) { return x.concat(y); }, []); |
|
2374 |
+ } |
|
2375 |
+ return ([].concat(rules_core).concat(rules_sub)); |
|
2376 |
+ }; |
|
2377 |
+ /** |
|
2378 |
+ * @author fenris |
|
2379 |
+ */ |
|
2380 |
+ class_target_gnumake.prototype.compile_project = function (project, without_dependencies) { |
|
2381 |
+ var _this = this; |
|
2382 |
+ if (without_dependencies === void 0) { without_dependencies = false; } |
|
2383 |
+ var that = this; |
|
2384 |
+ var comments = [ |
|
2385 |
+ "Project \"" + project.name_get() + "\"", |
|
2386 |
+ "This makefile was generated by Koralle " + configuration["version"], |
|
2387 |
+ ]; |
|
2388 |
+ var dependencies = project.dependencies_get().map(function (path, index) { |
|
2389 |
+ return (new class_task_dependency("__dependency_" + index.toString(), [], true, lib_path.class_filepointer.read(path), that.identifier, true, undefined)); |
|
2390 |
+ }); |
|
2391 |
+ var rules = [] |
|
2392 |
+ .concat([ |
|
2393 |
+ new lib_gnumake.class_rule({ |
|
2394 |
+ "name": "__default", |
|
2395 |
+ "dependencies": ["__root"], |
|
2396 |
+ "actions": [], |
|
2397 |
+ "phony": true, |
|
2398 |
+ }) |
|
2399 |
+ ]) |
|
2400 |
+ .concat([ |
|
2401 |
+ new lib_gnumake.class_rule({ |
|
2402 |
+ "name": "__root", |
|
2403 |
+ "dependencies": ["__dependencies", "__core"], |
|
2404 |
+ "phony": true, |
|
2405 |
+ }) |
|
2406 |
+ ]) |
|
2407 |
+ .concat([ |
|
2408 |
+ new lib_gnumake.class_rule({ |
|
2409 |
+ "name": "__dependencies", |
|
2410 |
+ "dependencies": without_dependencies ? [] : dependencies.map(function (dependency) { return dependency.name_get(); }), |
|
2411 |
+ "phony": true, |
|
2412 |
+ }) |
|
2413 |
+ ]) |
|
2414 |
+ .concat(dependencies.map(function (dependency) { return _this.compile_task(dependency); }).reduce(function (x, y) { return x.concat(y); }, [])) |
|
2415 |
+ .concat([ |
|
2416 |
+ new lib_gnumake.class_rule({ |
|
2417 |
+ "name": "__core", |
|
2418 |
+ "dependencies": [project.roottask_get().name_get()], |
|
2419 |
+ "phony": true, |
|
2420 |
+ }) |
|
2421 |
+ ]) |
|
2422 |
+ .concat(this.compile_task(project.roottask_get(), undefined, undefined, project.name_get())); |
|
2423 |
+ return (new lib_gnumake.class_sheet(rules, comments)); |
|
2424 |
+ }; |
|
2425 |
+ /** |
|
2426 |
+ * @override |
|
2427 |
+ * @author fenris |
|
2428 |
+ */ |
|
2429 |
+ class_target_gnumake.prototype.compile_project_string = function (project, without_dependencies) { |
|
2430 |
+ if (without_dependencies === void 0) { without_dependencies = false; } |
|
2431 |
+ return (this.compile_project(project, without_dependencies).compile(true)); |
|
2432 |
+ }; |
|
2433 |
+ /** |
|
2434 |
+ * @override |
|
2435 |
+ * @author fenris |
|
2436 |
+ */ |
|
2437 |
+ class_target_gnumake.prototype.execute = function (filepointer) { |
|
2438 |
+ return (function (resolve, reject) { |
|
2439 |
+ var command = (["cd", filepointer.location].join(" ") |
|
2440 |
+ + " && " |
|
2441 |
+ + ["make", "--file=" + filepointer.filename].join(" ") |
|
2442 |
+ + " ; " |
|
2443 |
+ + ["cd", "-"].join(" ")); |
|
2444 |
+ // (new class_message(command, {"prefix": "exec:command"})).stderr(); |
|
2445 |
+ _child_process.exec(command, {}, function (stdout, stderr, error) { |
|
2446 |
+ /* |
|
2447 |
+ (new class_message(stdout, {"prefix": "exec:stdout"})).stderr(); |
|
2448 |
+ (new class_message(stderr, {"prefix": "exec:stderr"})).stderr(); |
|
2449 |
+ (new class_message(String(error), {"prefix": "exec:error"})).stderr(); |
|
2450 |
+ */ |
|
2451 |
+ if (error != null) { |
|
2452 |
+ reject(error); |
|
2453 |
+ } |
|
2454 |
+ else { |
|
2455 |
+ resolve(undefined); |
|
2456 |
+ } |
|
2457 |
+ }); |
|
2458 |
+ }); |
|
2459 |
+ }; |
|
2460 |
+ return class_target_gnumake; |
|
2461 |
+}(class_target_regular)); |
|
2462 |
+/** |
|
2463 |
+ * @author fenris |
|
2464 |
+ */ |
|
2465 |
+var class_project = (function () { |
|
2466 |
+ /** |
|
2467 |
+ * @author fenris |
|
2468 |
+ */ |
|
2469 |
+ function class_project(name, version, dependencies_listed, roottask) { |
|
2470 |
+ this.name = name; |
|
2471 |
+ this.version = version; |
|
2472 |
+ this.dependencies_listed = dependencies_listed; |
|
2473 |
+ this.dependencies_all = null; |
|
2474 |
+ this.roottask = roottask; |
|
2475 |
+ } |
|
2476 |
+ /** |
|
2477 |
+ * @author fenris |
|
2478 |
+ */ |
|
2479 |
+ class_project.prototype.name_get = function () { |
|
2480 |
+ return this.name; |
|
2481 |
+ }; |
|
2482 |
+ /** |
|
2483 |
+ * @author fenris |
|
2484 |
+ */ |
|
2485 |
+ class_project.prototype.dependencies_set = function (dependencies_all) { |
|
2486 |
+ this.dependencies_all = dependencies_all; |
|
2487 |
+ }; |
|
2488 |
+ /** |
|
2489 |
+ * @author fenris |
|
2490 |
+ */ |
|
2491 |
+ class_project.prototype.dependencies_get = function () { |
|
2492 |
+ return this.dependencies_all; |
|
2493 |
+ }; |
|
2494 |
+ /** |
|
2495 |
+ * @author fenris |
|
2496 |
+ */ |
|
2497 |
+ class_project.prototype.roottask_get = function () { |
|
2498 |
+ return this.roottask; |
|
2499 |
+ }; |
|
2500 |
+ /** |
|
2501 |
+ * @author fenris |
|
2502 |
+ */ |
|
2503 |
+ class_project.create_task = function (raw) { |
|
2504 |
+ var type = fetch(raw, "type", null, 2); |
|
2505 |
+ return (class_task.get(type)(fetch(raw, "name", null, 1), fetch(raw, "sub", [], 0).map(function (raw) { return class_project.create_task(raw); }), fetch(raw, "active", true, 0), fetch(raw, "parameters", {}, 0))); |
|
2506 |
+ }; |
|
2507 |
+ /** |
|
2508 |
+ * @author fenris |
|
2509 |
+ */ |
|
2510 |
+ class_project.create = function (project_raw) { |
|
2511 |
+ var name = fetch(project_raw, "name", "(nameless project)", 1); |
|
2512 |
+ var version = fetch(project_raw, "version", "0.0.0", 1); |
|
2513 |
+ var dependencies = fetch(project_raw, "dependencies", [], 0); |
|
2514 |
+ var roottask = class_project.create_task(fetch(project_raw, "roottask", null, 2)); |
|
2515 |
+ // roottask.clean(); |
|
2516 |
+ return (new class_project(name, version, dependencies, roottask)); |
|
2517 |
+ }; |
|
2518 |
+ return class_project; |
|
2519 |
+}()); |
|
2520 |
+/** |
|
2521 |
+ * @author fenris |
|
2522 |
+ */ |
|
2523 |
+function read(path) { |
|
2524 |
+ return (function (resolve, reject) { |
|
2525 |
+ _fs.access(path, _fs.R_OK | _fs.W_OK, function (error) { |
|
2526 |
+ if (error != null) { |
|
2527 |
+ reject(new Error("project.json at '" + path + "' couldn't be read")); |
|
2528 |
+ } |
|
2529 |
+ else { |
|
2530 |
+ read_json(path)(resolve, reject); |
|
2531 |
+ } |
|
2532 |
+ }); |
|
2533 |
+ }); |
|
2534 |
+} |
|
2535 |
+/** |
|
2536 |
+ * @param path the path to the project.json relative to the current working directory |
|
2537 |
+ * @param usage what to do with the result-graph |
|
2538 |
+ * @author fenris |
|
2539 |
+ */ |
|
2540 |
+function scan(filepointer, graph, depth) { |
|
2541 |
+ if (graph === void 0) { graph = new class_graph(); } |
|
2542 |
+ if (depth === void 0) { depth = 0; } |
|
2543 |
+ if (graph.nodes.indexOf(filepointer.toString()) >= 0) { |
|
2544 |
+ return (function (resolve, reject) { return resolve(graph); }); |
|
2545 |
+ } |
|
2546 |
+ else { |
|
2547 |
+ return (function (resolve, reject) { |
|
2548 |
+ executor_chain({ |
|
2549 |
+ "graph": graph, |
|
2550 |
+ "data": null, |
|
2551 |
+ }, [ |
|
2552 |
+ function (state_) { return function (resolve_, reject_) { |
|
2553 |
+ state_.graph.nodes.push(filepointer.toString()); |
|
2554 |
+ resolve_(state_); |
|
2555 |
+ }; }, |
|
2556 |
+ function (state_) { return function (resolve_, reject_) { |
|
2557 |
+ read(filepointer.toString())(function (data) { state_.data = data; resolve_(state_); }, reject_); |
|
2558 |
+ }; }, |
|
2559 |
+ function (state_) { return executor_chain(state_, fetch(state_.data, "dependencies", [], 0).map(function (path) { return function (state__) { return function (resolve__, reject__) { |
|
2560 |
+ // (new class_message("-- dep.-path is '" + path + "'", {"depth": depth})).stderr(); |
|
2561 |
+ var filepointer_ = lib_path.filepointer_read(path); |
|
2562 |
+ var filepointer__ = filepointer.foo(filepointer_); |
|
2563 |
+ // (new class_message("-- combining " + ("'" + filepointer.toString() + "'") + " and " + ("'" + filepointer_.toString() + "'") + " to " + ("'" + filepointer__.toString() + "'"), {"depth": depth})).stderr(); |
|
2564 |
+ var edge = { "from": filepointer__.toString(), "to": filepointer.toString() }; |
|
2565 |
+ state__.graph.edges.push(edge); |
|
2566 |
+ scan(filepointer__, state__.graph, depth + 1)(function (graph_) { state_.graph = graph_; resolve__(state__); }, reject__); |
|
2567 |
+ }; }; })); }, |
|
2568 |
+ ])(function (state) { return resolve(state.graph); }, reject); |
|
2569 |
+ }); |
|
2570 |
+ } |
|
2571 |
+} |
|
2572 |
+/** |
|
2573 |
+ * @author fenris |
|
2574 |
+ */ |
|
2575 |
+function main(args) { |
|
2576 |
+ configuration = { |
|
2577 |
+ "version": "0.0.4", |
|
2578 |
+ "tempfolder": "/tmp/", |
|
2579 |
+ "path_source": "source", |
|
2580 |
+ "path_build": "build", |
|
2581 |
+ "target": "gnumake", |
|
2582 |
+ "system": "unix", |
|
2583 |
+ "raw": false, |
|
2584 |
+ "execute": false, |
|
2585 |
+ "output": null, |
|
2586 |
+ "path": "project.json", |
|
2587 |
+ }; |
|
2588 |
+ /* |
|
2589 |
+ let argumentparser : lib_arguments.class_argumentparser = new lib_arguments.class_parser( |
|
2590 |
+ [ |
|
2591 |
+ new lib_arguments.class_argument_volatile<string>( |
|
2592 |
+ { |
|
2593 |
+ "type": "string", |
|
2594 |
+ "ids_long": ["target"], |
|
2595 |
+ "ids_short": ["t"], |
|
2596 |
+ "default": "gnumake", |
|
2597 |
+ "info": "the target build system; valid values are 'gnumake','ant'", |
|
2598 |
+ } |
|
2599 |
+ ), |
|
2600 |
+ new lib_arguments.class_argument_volatile<string>( |
|
2601 |
+ { |
|
2602 |
+ "type": "string", |
|
2603 |
+ "ids_long": ["system"], |
|
2604 |
+ "ids_short": ["s"], |
|
2605 |
+ "default": "unix", |
|
2606 |
+ "info": "the target platform; valid values are 'unix', 'win'; default is 'unix'", |
|
2607 |
+ } |
|
2608 |
+ ), |
|
2609 |
+ new lib_arguments.class_argument_volatile_boolean( |
|
2610 |
+ { |
|
2611 |
+ "type": "boolean", |
|
2612 |
+ "ids_long": ["raw"], |
|
2613 |
+ "ids_short": ["r"], |
|
2614 |
+ "default": false, |
|
2615 |
+ "info": "if set, depedencies are ignored/excluded from the output", |
|
2616 |
+ } |
|
2617 |
+ ), |
|
2618 |
+ new lib_arguments.class_argument_volatile<boolean>( |
|
2619 |
+ { |
|
2620 |
+ "type": "boolean", |
|
2621 |
+ "ids_long": ["execute"], |
|
2622 |
+ "ids_short": ["x"], |
|
2623 |
+ "default": false, |
|
2624 |
+ "info": "if set, the build script will be executed instead of being printed to stdout", |
|
2625 |
+ } |
|
2626 |
+ ), |
|
2627 |
+ ] |
|
2628 |
+ ); |
|
2629 |
+ */ |
|
2630 |
+ var procede = args.every(function (arg) { |
|
2631 |
+ if ((arg.indexOf("--") == 0) || (arg.indexOf("-") == 0)) { |
|
2632 |
+ var parts = arg.split("="); |
|
2633 |
+ switch (parts[0]) { |
|
2634 |
+ case "--help": |
|
2635 |
+ case "-h": { |
|
2636 |
+ (new class_message("NAME")).stdout(); |
|
2637 |
+ (new class_message("Koralle Build System Abstractor", { "depth": 1 })).stdout(); |
|
2638 |
+ (new class_message("")).stdout(); |
|
2639 |
+ { |
|
2640 |
+ (new class_message("SYNOPSIS")).stdout(); |
|
2641 |
+ (new class_message("koralle [--target=gnumake|ant] [--system=unix|win] <path-to-project.json>", { "depth": 1 })).stdout(); |
|
2642 |
+ (new class_message("")).stdout(); |
|
2643 |
+ } |
|
2644 |
+ { |
|
2645 |
+ (new class_message("DESCRIPTION")).stdout(); |
|
2646 |
+ (new class_message("Koralle is not a build-system itself. Instead it generates scripts for existing build-systems (e.g. GNU Make, Apache Ant, …) on base of a common json-description-file (usually named 'project.json').", { "depth": 1 })).stdout(); |
|
2647 |
+ (new class_message("", { "depth": 1 })).stdout(); |
|
2648 |
+ (new class_message("Koralle is designed for reducing the amount of text needed to define the build-process.", { "depth": 1 })).stdout(); |
|
2649 |
+ (new class_message("")).stdout(); |
|
2650 |
+ } |
|
2651 |
+ { |
|
2652 |
+ (new class_message("OPTIONS")).stdout(); |
|
2653 |
+ { |
|
2654 |
+ (new class_message("--target | -t", { "depth": 1 })).stdout(); |
|
2655 |
+ (new class_message("the target build system; valid values are 'gnumake','ant'; default is 'gnumake'", { "depth": 2 })).stdout(); |
|
2656 |
+ (new class_message("")).stdout(); |
|
2657 |
+ } |
|
2658 |
+ { |
|
2659 |
+ (new class_message("--system | -s", { "depth": 1 })).stdout(); |
|
2660 |
+ (new class_message("the target platform; valid values are 'unix', 'win'; default is 'unix'", { "depth": 2 })).stdout(); |
|
2661 |
+ (new class_message("")).stdout(); |
|
2662 |
+ } |
|
2663 |
+ { |
|
2664 |
+ (new class_message("--raw | -r", { "depth": 1 })).stdout(); |
|
2665 |
+ (new class_message("if set, depedencies are ignored/excluded from the output", { "depth": 2 })).stdout(); |
|
2666 |
+ (new class_message("")).stdout(); |
|
2667 |
+ } |
|
2668 |
+ { |
|
2669 |
+ (new class_message("--execute | -x", { "depth": 1 })).stdout(); |
|
2670 |
+ (new class_message("if set, the build script will be executed", { "depth": 2 })).stdout(); |
|
2671 |
+ (new class_message("")).stdout(); |
|
2672 |
+ } |
|
2673 |
+ { |
|
2674 |
+ (new class_message("--output | -o", { "depth": 1 })).stdout(); |
|
2675 |
+ (new class_message("the path of the output file", { "depth": 2 })).stdout(); |
|
2676 |
+ (new class_message("")).stdout(); |
|
2677 |
+ } |
|
2678 |
+ { |
|
2679 |
+ (new class_message("--version | -v", { "depth": 1 })).stdout(); |
|
2680 |
+ (new class_message("print the version and exit", { "depth": 2 })).stdout(); |
|
2681 |
+ (new class_message("")).stdout(); |
|
2682 |
+ } |
|
2683 |
+ { |
|
2684 |
+ (new class_message("--help | -h", { "depth": 1 })).stdout(); |
|
2685 |
+ (new class_message("show this help and exit", { "depth": 2 })).stdout(); |
|
2686 |
+ (new class_message("")).stdout(); |
|
2687 |
+ } |
|
2688 |
+ } |
|
2689 |
+ { |
|
2690 |
+ (new class_message("AUTHOR")).stdout(); |
|
2691 |
+ (new class_message("Christian Fraß <frass@greenscale.de>", { "depth": 1 })).stdout(); |
|
2692 |
+ (new class_message("")).stdout(); |
|
2693 |
+ } |
|
2694 |
+ return false; |
|
2695 |
+ break; |
|
2696 |
+ } |
|
2697 |
+ case "--version": |
|
2698 |
+ case "-v": { |
|
2699 |
+ (new class_message(configuration["version"].toString())).stdout(); |
|
2700 |
+ return false; |
|
2701 |
+ break; |
|
2702 |
+ } |
|
2703 |
+ case "--target": |
|
2704 |
+ case "-t": { |
|
2705 |
+ configuration["target"] = parts[1]; |
|
2706 |
+ return true; |
|
2707 |
+ break; |
|
2708 |
+ } |
|
2709 |
+ case "--system": |
|
2710 |
+ case "-s": { |
|
2711 |
+ configuration["system"] = parts[1]; |
|
2712 |
+ return true; |
|
2713 |
+ break; |
|
2714 |
+ } |
|
2715 |
+ case "--raw": |
|
2716 |
+ case "-r": { |
|
2717 |
+ configuration["raw"] = true; |
|
2718 |
+ return true; |
|
2719 |
+ break; |
|
2720 |
+ } |
|
2721 |
+ case "--output": |
|
2722 |
+ case "-o": { |
|
2723 |
+ configuration["output"] = parts[1]; |
|
2724 |
+ return true; |
|
2725 |
+ break; |
|
2726 |
+ } |
|
2727 |
+ case "--execute": |
|
2728 |
+ case "-x": { |
|
2729 |
+ configuration["execute"] = true; |
|
2730 |
+ return true; |
|
2731 |
+ break; |
|
2732 |
+ } |
|
2733 |
+ default: { |
|
2734 |
+ return false; |
|
2735 |
+ throw (new Error("unrecognized option '" + parts[0] + "'")); |
|
2736 |
+ break; |
|
2737 |
+ } |
|
2738 |
+ } |
|
2739 |
+ } |
|
2740 |
+ else { |
|
2741 |
+ configuration["path"] = arg; |
|
2742 |
+ return true; |
|
2743 |
+ } |
|
2744 |
+ }); |
|
2745 |
+ if (procede) { |
|
2746 |
+ executor_chain({}, [ |
|
2747 |
+ // environment |
|
2748 |
+ function (state) { return function (resolve, reject) { |
|
2749 |
+ var filepointer = lib_path.filepointer_read(configuration["path"]); |
|
2750 |
+ filepointer.location.go_thither(); |
|
2751 |
+ state.filepointer = filepointer; |
|
2752 |
+ resolve(state); |
|
2753 |
+ }; }, |
|
2754 |
+ // scan dependencies |
|
2755 |
+ function (state) { return function (resolve, reject) { |
|
2756 |
+ if (configuration["raw"]) { |
|
2757 |
+ state.order = []; |
|
2758 |
+ resolve(state); |
|
2759 |
+ } |
|
2760 |
+ else { |
|
2761 |
+ scan(state.filepointer)(function (graph) { |
|
2762 |
+ try { |
|
2763 |
+ var order = topsort(graph).filter(function (path) { return (path != state.filepointer.toString()); }); |
|
2764 |
+ state.order = order; |
|
2765 |
+ resolve(state); |
|
2766 |
+ } |
|
2767 |
+ catch (exception) { |
|
2768 |
+ reject((exception)); |
|
2769 |
+ } |
|
2770 |
+ }, reject); |
|
2771 |
+ } |
|
2772 |
+ }; }, |
|
2773 |
+ // setup project |
|
2774 |
+ function (state) { return function (resolve, reject) { |
|
2775 |
+ read(state.filepointer.toString())(function (data) { state.project = class_project.create(data); resolve(state); }, reject); |
|
2776 |
+ }; }, |
|
2777 |
+ // setup target |
|
2778 |
+ function (state) { return function (resolve, reject) { |
|
2779 |
+ var mapping = { |
|
2780 |
+ "ant": new class_target_ant(), |
|
2781 |
+ "gnumake": new class_target_gnumake(), |
|
2782 |
+ "make": new class_target_gnumake(), |
|
2783 |
+ }; |
|
2784 |
+ var target = fetch(mapping, configuration["target"], null, 0); |
|
2785 |
+ if (target == null) { |
|
2786 |
+ reject(new Error("no implementation found for target '" + configuration["target"] + "'")); |
|
2787 |
+ } |
|
2788 |
+ else { |
|
2789 |
+ state.target = target; |
|
2790 |
+ resolve(state); |
|
2791 |
+ } |
|
2792 |
+ }; }, |
|
2793 |
+ // generate |
|
2794 |
+ function (state) { return function (resolve, reject) { |
|
2795 |
+ state.project.dependencies_set(state.order); |
|
2796 |
+ try { |
|
2797 |
+ var script = state.target.compile_project_string(state.project, configuration["raw"]); |
|
2798 |
+ state.script = script; |
|
2799 |
+ resolve(state); |
|
2800 |
+ } |
|
2801 |
+ catch (exception) { |
|
2802 |
+ reject((exception)); |
|
2803 |
+ } |
|
2804 |
+ }; }, |
|
2805 |
+ // output |
|
2806 |
+ function (state) { return function (resolve, reject) { |
|
2807 |
+ var filepointer; |
|
2808 |
+ if (configuration["output"] == null) { |
|
2809 |
+ if (!configuration["execute"]) { |
|
2810 |
+ filepointer = null; |
|
2811 |
+ } |
|
2812 |
+ else { |
|
2813 |
+ filepointer = new lib_path.class_filepointer( |
|
2814 |
+ // new lib_path.class_location(null, new lib_path.class_path(["."])), |
|
2815 |
+ lib_path.class_location.read(configuration["tempfolder"]), "_koralle_"); |
|
2816 |
+ } |
|
2817 |
+ } |
|
2818 |
+ else { |
|
2819 |
+ filepointer = lib_path.class_filepointer.read(configuration["output"]); |
|
2820 |
+ } |
|
2821 |
+ if (filepointer == null) { |
|
2822 |
+ (new class_message(state.script)).stdout(); |
|
2823 |
+ } |
|
2824 |
+ else { |
|
2825 |
+ _fs.writeFile(filepointer.toString(), state.script); |
|
2826 |
+ } |
|
2827 |
+ state.output = filepointer; |
|
2828 |
+ resolve(state); |
|
2829 |
+ }; }, |
|
2830 |
+ // execution |
|
2831 |
+ function (state) { return function (resolve, reject) { |
|
2832 |
+ if (!configuration["execute"]) { |
|
2833 |
+ resolve(state); |
|
2834 |
+ } |
|
2835 |
+ else { |
|
2836 |
+ state.target.execute(state.output)(function (result) { return resolve(state); }, reject); |
|
2837 |
+ } |
|
2838 |
+ }; }, |
|
2839 |
+ ])(function (state) { |
|
2840 |
+ // (new class_message("successfull", {"type": "information", "prefix": "koralle"})).stderr(); |
|
2841 |
+ }, function (reason) { |
|
2842 |
+ // throw reason; |
|
2843 |
+ console.error(reason); |
|
2844 |
+ (new class_message("an error occured: " + String(reason), { "type": "error", "prefix": "koralle" })).stderr(); |
|
2845 |
+ }); |
|
2846 |
+ } |
|
2847 |
+} |
|
2848 |
+main(process.argv.slice(2)); |
|
0 | 2849 |