1 | @echo off
|
---|
2 |
|
---|
3 | setlocal
|
---|
4 |
|
---|
5 | set OS_ALLCAPS=WINDOWS
|
---|
6 |
|
---|
7 | set selfcon_ext=selfcontained-mvn
|
---|
8 | set installed_dir=%selfcon_ext%\apache-maven
|
---|
9 |
|
---|
10 | echo.
|
---|
11 | cmd /c .\get-subversion-windows-64bit.bat
|
---|
12 | cmd /c .\setup-subversion-windows-64bit.bat
|
---|
13 |
|
---|
14 | echo.
|
---|
15 |
|
---|
16 | if not exist selfcontained-jdk (
|
---|
17 | echo.
|
---|
18 | echo Checking for java ...
|
---|
19 | REM java -version > nul 2> nul
|
---|
20 | where java > nul 2> nul
|
---|
21 |
|
---|
22 | if %ERRORLEVEL% NEQ 0 (
|
---|
23 | echo.
|
---|
24 | echo Failed to find 'java'
|
---|
25 | echo After 5 seconds, initiating:
|
---|
26 | echo.
|
---|
27 | echo .\get-selfcontained-jdk.bat
|
---|
28 | echo [Press ^C to stop]
|
---|
29 | timeout /t 5 /nobreak >nul
|
---|
30 | .\get-selfcontained-jdk.bat
|
---|
31 | ) else (
|
---|
32 | echo.
|
---|
33 | echo Detected 'java' but it is not the Greenstone3 supplied 'selfcontained-jdk'
|
---|
34 | echo => Recommend running:
|
---|
35 | echo.
|
---|
36 | echo .\get-selfcontained-jdk.bat
|
---|
37 | echo.
|
---|
38 | echo After 5 seconds, continuing with getting ant
|
---|
39 | echo [Press ^C to stop]
|
---|
40 | timeout /t 5 /nobreak >nul
|
---|
41 | )
|
---|
42 | )
|
---|
43 |
|
---|
44 |
|
---|
45 |
|
---|
46 | echo.
|
---|
47 | if not exist %selfcon_ext% (
|
---|
48 | echo Checking out from svn: Greenstone3\'s %selfcon_ext% extension
|
---|
49 | svn co https://svn.greenstone.org/gs3-extensions/%selfcon_ext%/trunk %selfcon_ext%
|
---|
50 |
|
---|
51 | if %ERRORLEVEL% NEQ 0 (
|
---|
52 | echo Error encountered checking out: 1>&2
|
---|
53 | echo svn co https://svn.greenstone.org/gs3-extensions/%selfcon_ext%/trunk %selfcon_ext% 1>&2
|
---|
54 | exit /b 1
|
---|
55 | )
|
---|
56 | ) else (
|
---|
57 | echo Detected directory '%selfcon_ext%'
|
---|
58 | echo =^> Taken to mean that the svn check-out command has already been run
|
---|
59 | )
|
---|
60 |
|
---|
61 | echo.
|
---|
62 | if not exist %installed_dir% (
|
---|
63 | echo Runing the %selfcon_ext%\PREPARE-%OS_ALLCAPS%.bat
|
---|
64 |
|
---|
65 | cd %selfcon_ext% && call .\PREPARE-%OS_ALLCAPS%.bat
|
---|
66 |
|
---|
67 | if %ERRORLEVEL% NEQ 0 (
|
---|
68 | echo Error encountered running: 1>&2
|
---|
69 | echo cd %selfcon_ext% && .\PREPARE-%OS_ALLCAPS%.bat 1>&2
|
---|
70 | exit /b 1
|
---|
71 | )
|
---|
72 |
|
---|
73 | ) else (
|
---|
74 | echo Detected directory '%installed_dir%'
|
---|
75 | echo =^> Taken to mean that the %selfcon_ext%/PREPARE-%OS_ALLCAPS%.bat command has already been run
|
---|
76 | )
|
---|
77 |
|
---|
78 |
|
---|
79 | if "x%MAVEN_HOME%" NEQ "x%CD%\%installed_dir%" (
|
---|
80 | echo.
|
---|
81 | echo To use this installed version of Apache Maven, in the top-level Greenstone3 directory run:
|
---|
82 | echo gs3-setup-cli.bat
|
---|
83 | echo.
|
---|
84 | ) else (
|
---|
85 | echo.
|
---|
86 | echo Detected MAVEN_HOME set to \%CD\%/%installed_dir%
|
---|
87 | echo =^> Taken to mean that the %selfcon_ext% SETUP.bat file has been sourced
|
---|
88 | )
|
---|
89 |
|
---|
90 | echo.
|
---|
91 |
|
---|
92 |
|
---|
93 | endlocal
|
---|