This repository has been archived by the owner on Jul 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
/
RUN.bat
76 lines (67 loc) · 1.64 KB
/
RUN.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo off
if exist application.xml (
ECHO The file application.xml exists!
ECHO.
) else (
ECHO The file application.xml doesn't exist.
ECHO.
ECHO Please make sure this file is available and try again.
ECHO.
PAUSE
goto end
)
::
:: Lets find the SWF's name inside application.xml for the file we want to create
::
setlocal enableextensions enabledelayedexpansion
set xmlFile=application.xml
set fileName=
for /f "tokens=3 delims=<>" %%v in ('findstr /n /i /c:"<content>" "%xmlFile%"') do (
if "%%v" == "" (
goto defaultName
)
if "%%v" == " " (
goto defaultName
)
set fileName=%%v
goto checkFile
)
:defaultName
ECHO No file name found in appplication.xml. Using BoscaCeoil.swf...
ECHO.
set fileName=BoscaCeoil.swf
:checkFile
ECHO Searching for %fileName%...
ECHO.
if exist %fileName% (
ECHO %fileName% exists!
ECHO.
goto fileExists
) else (
ECHO %fileName% doesn't exist. Compiling the application...
ECHO.
goto createSwf
)
:createSwf
SET airVar=%AIR_SDK_HOME%
if "%airVar%"=="" (
ECHO AIR_SDK_HOME enviroment variable doesn't exist.
ECHO.
ECHO Please create it before running this bat.
ECHO.
PAUSE
goto end
) else (
CALL %AIR_SDK_HOME%\bin\amxmlc.bat -swf-version 28 -default-frame-rate 30 -default-size 768 560 -library-path+=lib/sion065.swc -source-path+=src -default-background-color 0x000000 -warnings -strict src/Main.as -o %fileName% -define+=CONFIG::desktop,true -define+=CONFIG::web,false
ECHO.
ECHO Compilation finished.
ECHO.
ECHO If no error was thrown by the Java Runtime, %fileName% should now exist.
ECHO.
goto checkFile
)
:fileExists
ECHO.
ECHO Running the application...
%AIR_SDK_HOME%\bin\adl application.xml
:end