build.cmd 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. rem Licensed to the Apache Software Foundation (ASF) under one or more
  2. rem contributor license agreements. See the NOTICE file distributed with
  3. rem this work for additional information regarding copyright ownership.
  4. rem The ASF licenses this file to You under the Apache License, Version 2.0
  5. rem (the "License"); you may not use this file except in compliance with
  6. rem the License. You may obtain a copy of the License at
  7. rem
  8. rem http://www.apache.org/licenses/LICENSE-2.0
  9. rem
  10. rem Unless required by applicable law or agreed to in writing, software
  11. rem distributed under the License is distributed on an "AS IS" BASIS,
  12. rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. rem See the License for the specific language governing permissions and
  14. rem limitations under the License.
  15. @echo on
  16. echo Copying resources
  17. pushd ..
  18. copy /y "%cd%\ambari-scom-server\target\ambari-scom-*.*" "%cd%\msi\src\AmbariPackages\ambari-winpkg\resources\" || exit /b 1
  19. copy /y "%cd%\metrics-sink\target\metrics-sink-*.jar" "%cd%\msi\src\AmbariPackages\ambari-winpkg\resources\" || exit /b 1
  20. copy /y "%cd%\metrics-sink\db\Hadoop-Metrics-SQLServer-CREATE.ddl" "%cd%\msi\src\AmbariPackages\ambari-winpkg\resources\" || exit /b 1
  21. popd
  22. echo Compressing resources
  23. powershell.exe -NoProfile -InputFormat none -ExecutionPolicy unrestricted -command "%cd%\build\zip.ps1" "%cd%\src\AmbariPackages\ambari-winpkg" "%cd%\src\AmbariPackages\ambari-winpkg.zip" || exit /b 1
  24. echo Building GUI
  25. set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319
  26. call %msBuildDir%\msbuild.exe "%cd%\src\GUI\GUI_Ambari.csproj" || exit /b 1
  27. copy /y "%cd%\src\GUI\bin\Debug\GUI_Ambari.exe" "%cd%\src\bin\GUI_Ambari.exe" || exit /b 1
  28. echo Building Result Messagebox
  29. call %msBuildDir%\msbuild.exe "%cd%\src\Result\Ambari_Result.csproj" || exit /b 1
  30. mkdir "%cd%\src\bin\"
  31. copy /y "%cd%\src\Result\bin\Debug\Ambari_Result.exe" "%cd%\src\bin\Ambari_Result.exe" || exit /b 1
  32. echo Building MSI
  33. pushd "%cd%\src" || exit /b 1
  34. start /wait /min candle "%cd%\ambari-scom.wxs" || exit /b 1
  35. start /wait /min light "%cd%\ambari-scom.wixobj" || exit /b 1
  36. popd || exit /b 1
  37. copy /y "..\management-pack\Hadoop_MP\Installer\bin\Debug\en-us\AmbariSCOMManagementPack.msi" "%cd%\ambari-scom.msi" || exit /b 1
  38. echo Cleaning
  39. del /f /q "%cd%\src\ambari-scom.wixobj" || exit /b 1
  40. del /f /q "%cd%\src\ambari-scom.wixpdb" || exit /b 1
  41. del /f /q "%cd%\src\ambari-scom.msi" || exit /b 1
  42. del /f /q "%cd%\src\bin\GUI_Ambari.exe" || exit /b 1
  43. del /f /q "%cd%\src\bin\Ambari_Result.exe" || exit /b 1
  44. del /f /q "%cd%\src\AmbariPackages\ambari-winpkg.zip" || exit /b 1
  45. del /f /q "%cd%\src\AmbariPackages\ambari-winpkg\resources\*.jar" || exit /b 1
  46. del /f /q "%cd%\src\AmbariPackages\ambari-winpkg\resources\*.zip" || exit /b 1
  47. del /f /q "%cd%\src\AmbariPackages\ambari-winpkg\resources\Hadoop-Metrics-SQLServer-CREATE.ddl" || exit /b 1
  48. rd /s /q "%cd%\src\GUI\bin" || exit /b 1
  49. rd /s /q "%cd%\src\GUI\obj" || exit /b 1
  50. rd /s /q "%cd%\src\Result\bin" || exit /b 1
  51. rd /s /q "%cd%\src\Result\obj" || exit /b 1
  52. echo Done