This repository has been archived by the owner on May 15, 2024. It is now read-only.
generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
make-docs.bat
86 lines (77 loc) · 2.25 KB
/
make-docs.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
77
78
79
80
81
82
83
84
85
86
@echo off
REM SPDX-FileCopyrightText: 2023 SAP SE
REM
REM SPDX-License-Identifier: Apache-2.0
REM
REM This file is part of FEDEM - https://openfedem.org
if not exist "%PDFLATEX%.exe" set PDFLATEX=C:\Program Files\MiKTex\miktex\bin\x64\pdflatex
if not exist "%PDFLATEX%.exe" (
@echo %PDFLATEX%.exe does not exist
@echo Please set environment variable PDFLATEX to point to the pdflatex executable
exit /B
)
setlocal ENABLEDELAYEDEXPANSION
REM Edit this line to match the location of your
REM local clone of https://github.com/SAP/fedem-gui
set gui_dir=%USERPROFILE%\Fedem-src\fedem-gui
set /a doTheory=0
set /a doUser=0
set /a doRef=0
if "%1" == "-theory" set /a doTheory=1
if "%1" == "-user" set /a doUser=1
if "%1" == "-ref" set /a doRef=1
if "%1" == "-install" (
if not "%2" == "" ( set install_dir=%2 ) else (
if exist %gui_dir% (
set /p VERSION=<%gui_dir%\cfg\VERSION
set install_dir=%USERPROFILE%\Fedem-install\%VERSION%\bin\Doc\
) else set install_dir=%~dp0docs\
)
if not exist !install_dir! (
echo !install_dir! does not exist - ignored
set install_dir=
)
)
if not %doTheory%==1 if not %doUser%==1 if not %doRef%==1 (
set /a doTheory=2
set /a doUser=2
set /a doRef=2
)
if %doTheory% gtr 0 (
cd %~dp0\src\TheoryGuide\
@echo Generate the Fedem Theory Guide (pdf^)
"%PDFLATEX%" theory_main.tex > pdflatex.log
)
if %doTheory% gtr 1 (
@echo 2nd pass
"%PDFLATEX%" theory_main.tex >> pdflatex.log
if not "%install_dir%" == "" (
@echo Installing FedemTheoryGuide.pdf in %install_dir%
rename theory_main.pdf FedemTheoryGuide.pdf
move FedemTheoryGuide.pdf %install_dir%
)
)
if %doUser% gtr 0 (
cd %~dp0\src\UsersGuide\
@echo Generate the Fedem User Guide (pdf^)
"%PDFLATEX%" user_main.tex > pdflatex.log
)
if %doUser% gtr 1 (
@echo 2nd pass
"%PDFLATEX%" user_main.tex >> pdflatex.log
if not "%install_dir%" == "" (
@echo Installing FedemUsersGuide.pdf in %install_dir%
rename user_main.pdf FedemUsersGuide.pdf
move FedemUsersGuide.pdf %install_dir%
)
)
if %doRef% gtr 0 (
cd %~dp0\src\ReferenceGuide
@echo Generate the Fedem Reference Guide (chm^)
call fm-make.bat
if not "%install_dir%" == "" (
@echo Installing Fedem.chm in %install_dir%
move Fedem.chm %install_dir%
)
)
cd %~dp0