1@echo off
2rem /*
3rem  * Licensed to the Apache Software Foundation (ASF) under one
4rem  * or more contributor license agreements. See the NOTICE file
5rem  * distributed with this work for additional information
6rem  * regarding copyright ownership. The ASF licenses this file
7rem  * to you under the Apache License, Version 2.0 (the
8rem  * "License"); you may not use this file except in compliance
9rem  * with the License. You may obtain a copy of the License at
10rem  *
11rem  *   http://www.apache.org/licenses/LICENSE-2.0
12rem  *
13rem  * Unless required by applicable law or agreed to in writing,
14rem  * software distributed under the License is distributed on an
15rem  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16rem  * KIND, either express or implied. See the License for the
17rem  * specific language governing permissions and limitations
18rem  * under the License.
19rem  */
20
21setlocal
22if "%HOMEDRIVE%"=="" goto MISSINGVARS
23if "%HOMEPATH%"=="" goto MISSINGVARS
24if "%HAXEPATH%"=="" goto NOTINSTALLED
25
26set path=%HAXEPATH%;%HAXEPATH%\..\neko;%path%
27
28rem # invoke Thrift comnpiler
29thrift -r -gen haxe   ..\tutorial.thrift
30if errorlevel 1 goto STOP
31
32rem # invoke Haxe compiler for all targets
33for %%a in (*.hxml) do (
34	rem * filter Python, as it is not supported by Haxe 3.1.3 (but will be in 3.1.4)
35	if not "%%a"=="python.hxml" (
36		echo --------------------------
37		echo Building %%a ...
38		echo --------------------------
39		haxe  --cwd .  %%a
40	)
41)
42
43
44echo.
45echo done.
46pause
47goto eof
48
49:NOTINSTALLED
50echo FATAL: Either Haxe is not installed, or the HAXEPATH variable is not set.
51pause
52goto eof
53
54:MISSINGVARS
55echo FATAL: Unable to locate home folder.
56echo.
57echo Both HOMEDRIVE and HOMEPATH need to be set to point to your Home folder.
58echo The current values are:
59echo HOMEDRIVE=%HOMEDRIVE%
60echo HOMEPATH=%HOMEPATH%
61pause
62goto eof
63
64:STOP
65pause
66goto eof
67
68:eof
69