179
|
1 |
@echo off
|
|
2 |
|
|
3 |
rem
|
|
4 |
rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
5 |
rem All rights reserved.
|
|
6 |
rem This component and the accompanying materials are made available
|
|
7 |
rem under the terms of the License "Eclipse Public License v1.0"
|
|
8 |
rem which accompanies this distribution, and is available
|
|
9 |
rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
10 |
rem
|
|
11 |
rem Initial Contributors:
|
|
12 |
rem Nokia Corporation - initial contribution.
|
|
13 |
rem
|
|
14 |
rem Contributors:
|
|
15 |
rem
|
|
16 |
rem Description:
|
|
17 |
rem
|
|
18 |
|
|
19 |
setlocal
|
|
20 |
if not defined JAVA_6_HOME (
|
|
21 |
set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
|
|
22 |
) ELSE set TESTED_JAVA=%JAVA_6_HOME%
|
|
23 |
if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
|
|
24 |
|
|
25 |
REM Configure Ant
|
|
26 |
if not defined TESTED_ANT_HOME (
|
|
27 |
set TESTED_ANT_HOME=C:\Apps\ant_1.7
|
|
28 |
)
|
|
29 |
if exist %TESTED_ANT_HOME% (set ANT_HOME=%TESTED_ANT_HOME%)
|
|
30 |
|
|
31 |
REM Configure the expected Ant Version details below
|
|
32 |
SET expMajorVer=1
|
|
33 |
SET expMinorVer=7
|
|
34 |
|
|
35 |
rem *** Verify Ant Version ***
|
|
36 |
rem -- Run the 'ant -version' command and capture the output to a variable
|
|
37 |
for /f "tokens=*" %%a in ('ant -version') do (set antversion=%%a)
|
|
38 |
echo *** Installed Version : %antversion%
|
|
39 |
|
|
40 |
rem -- Parse the version string obtained above and get the version number
|
|
41 |
for /f "tokens=4 delims= " %%a in ("%antversion%") do set val=%%a
|
|
42 |
rem -- Parse the version number delimiting the '.' and set the major and
|
|
43 |
rem minor versions
|
|
44 |
for /f "tokens=1-2 delims=." %%a in ("%val%") do (
|
|
45 |
set /A majorVersion=%%a
|
|
46 |
set /A minorVersion=%%b
|
|
47 |
)
|
|
48 |
rem -- Check whether major version is greater than or equal to the expected.
|
|
49 |
if %majorVersion% geq %expMajorVer% (
|
|
50 |
rem -- if major version is valid, check minor version. If minor version is less
|
|
51 |
rem than expected display message and abort the execution.
|
|
52 |
if %minorVersion% lss %expMinorVer% (echo *** Incorrect version of Ant found. Please check you have atleast Ant 1.7.0 & goto :errorstop )
|
|
53 |
)
|
|
54 |
|
|
55 |
ant %*
|
|
56 |
endlocal
|
|
57 |
|
|
58 |
:errorstop
|
|
59 |
@echo *** Build aborted with error
|
|
60 |
exit /b 1 |