2 :: Copyright (c) 2011 The Chromium Authors. All rights reserved.
\r
3 :: Use of this source code is governed by a BSD-style license that can be
\r
4 :: found in the LICENSE file.
\r
6 :: Batch file run as build command for chrome_dll.vcproj
\r
14 set LastChangeDir=%~5
\r
15 set VarsBat=%IntDir%/vers-vars.bat
\r
17 :: Put cygwin in the path
\r
18 call %SolutionDir%\..\third_party\cygwin\setup_env.bat
\r
20 :: Load version digits as environment variables
\r
21 cat %SolutionDir%\VERSION | sed "s/\(.*\)/set \1/" > %VarsBat%
\r
23 :: Load branding strings as environment variables
\r
24 set Distribution="chromium"
\r
25 if "%CHROMIUM_BUILD%" == "_google_chrome" set Distribution="google_chrome"
\r
26 cat %SolutionDir%app\theme\%Distribution%\BRANDING | sed "s/\(.*\)/set \1/" >> %VarsBat%
\r
28 set OFFICIAL_BUILD=0
\r
29 if "%CHROME_BUILD_TYPE%" == "_official" set OFFICIAL_BUILD=1
\r
31 :: Look if subversion client is available. It may not be available on Windows
\r
32 :: if downloaded with a tarball or depot_tools is not in the PATH.
\r
33 call svn --version 2>nul 1>nul
\r
34 :: If not available, just skip getting the revision number.
\r
35 if errorlevel 1 goto :NO_SVN
\r
39 :: Not having svn makes it impossible to determine the current checkout revision
\r
40 :: number. On normal build, this is not an issue but for official builds, this
\r
41 :: *can't* be tolerated so issue an error instead. VS will pick it up corectly.
\r
42 set NO_SVN_LEVEL=error
\r
43 if "%OFFICIAL_BUILD%" == "0" set NO_SVN_LEVEL=warning
\r
44 echo %0(28) : %NO_SVN_LEVEL% : svn is not installed.
\r
47 python %LastChangeDir%\lastchange.py | sed "s/\(.*\)/set \1/" >> %VarsBat%
\r
51 cat %InFile% | sed "s/@MAJOR@/%MAJOR%/" ^
\r
52 | sed "s/@MINOR@/%MINOR%/" ^
\r
53 | sed "s/@BUILD@/%BUILD%/" ^
\r
54 | sed "s/@PATCH@/%PATCH%/" ^
\r
55 | sed "s/@COMPANY_FULLNAME@/%COMPANY_FULLNAME%/" ^
\r
56 | sed "s/@COMPANY_SHORTNAME@/%COMPANY_SHORTNAME%/" ^
\r
57 | sed "s/@PRODUCT_FULLNAME@/%PRODUCT_FULLNAME%/" ^
\r
58 | sed "s/@PRODUCT_SHORTNAME@/%PRODUCT_SHORTNAME%/" ^
\r
59 | sed "s/@PRODUCT_EXE@/%PRODUCT_EXE%/" ^
\r
60 | sed "s/@COPYRIGHT@/%COPYRIGHT%/" ^
\r
61 | sed "s/@OFFICIAL_BUILD@/%OFFICIAL_BUILD%/" ^
\r
62 | sed "s/@LASTCHANGE@/%LASTCHANGE%/" > %OutFile%
\r