-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.bat
68 lines (59 loc) · 1.87 KB
/
make.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
@echo off
echo ***************************************************************
echo *
echo * OpenTTD "Bulgarian Town Names"
echo * Copyright (c) 2017 Rusi Dimitrov
echo * This program comes with ABSOLUTELY NO WARRANTY.
echo * This is free software, and you are welcome to redistribute it
echo * under certain conditions of GPL v3 license.
echo *
echo ***************************************************************
:: Set variables
set nmlc=%cd%\..\nmlc.exe
set tar=%cd%\utils\7z\7za.exe
set src=%cd%\src
type %src%\custom_tags-base.txt | more /p > %src%\custom_tags.txt
set /p version=<%cd%\src\custom_tags.txt
for /f "tokens=2 delims=:" %%a in ("%version%") do set version=%%a
set name=bg_names
set build=Bulgarian_Town_Names-%version%
set release=%cd%\build\%build%
:: Create folder
echo.
echo *** Creating folder: \build\%build%
echo.
md "%release%"
:: Building
echo.
echo *** Building from the source, please wait...
echo.
for %%i in (%src%\%name%.nml) do %nmlc% ^
--grf=%release%\%name%.grf ^
--custom-tags=%src%\custom_tags.txt ^
--lang-dir=%src%\lang ^
%src%\%name%.nml ^
--verbosity=4
:: Copy files
copy %cd%\docs\*.txt %release% >nul
copy %cd%\LICENSE %release%\license.txt >nul
:: Create TAR archive
echo.
echo *** Creating archive: %release%.tar
echo.
%tar% a "%release%.tar" "%release%" >nul
:: Cleanup files and dirs
del %src%\custom_tags.txt
if exist "%release%.tar" rd /q /s "%cd%\.nmlcache\" "%release%"
:: Finish
echo.
echo ********************** Building finished **********************
echo.
echo To install copy the NewGRF archive to the OpenTTD NewGRF directory:
echo.
echo * C:\My Documents\newgrf (Win 95, 98, ME)
echo * C:\Documents and Settings\^<username^>\My Documents\OpenTTD\newgrf (Win 2000, XP)
echo * C:\Users\^<username^>\Documents\OpenTTD\newgrf (Win Vista, 7, 8, 8.1, 10)
echo * \OpenTTDPortable\Data\OpenTTD\newgrf (Portable version)
:: Pause
echo.
pause