Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

sonar-runner.bat 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. @REM Sonar Runner Startup Script for Windows
  2. @REM
  3. @REM Required ENV vars:
  4. @REM JAVA_HOME - location of a JDK home dir
  5. @REM
  6. @REM Optional ENV vars:
  7. @REM SONAR_RUNNER_HOME - location of runner's installed home dir
  8. @REM SONAR_RUNNER_OPTS - parameters passed to the Java VM when running Sonar
  9. @echo off
  10. set ERROR_CODE=0
  11. @REM set local scope for the variables with windows NT shell
  12. @setlocal
  13. @REM ==== START VALIDATION ====
  14. @REM *** JAVA EXEC VALIDATION ***
  15. if not "%JAVA_HOME%" == "" goto foundJavaHome
  16. for %%i in (java.exe) do set JAVA_EXEC=%%~$PATH:i
  17. if not "%JAVA_EXEC%" == "" (
  18. set JAVA_EXEC="%JAVA_EXEC%"
  19. goto OkJava
  20. )
  21. if not "%JAVA_EXEC%" == "" goto OkJava
  22. echo.
  23. echo ERROR: JAVA_HOME not found in your environment, and no Java
  24. echo executable present in the PATH.
  25. echo Please set the JAVA_HOME variable in your environment to match the
  26. echo location of your Java installation, or add "java.exe" to the PATH
  27. echo.
  28. goto error
  29. :foundJavaHome
  30. if EXIST "%JAVA_HOME%\bin\java.exe" goto foundJavaExeFromJavaHome
  31. echo.
  32. echo ERROR: JAVA_HOME exists but does not point to a valid Java home
  33. echo folder. No "\bin\java.exe" file can be found there.
  34. echo.
  35. goto error
  36. :foundJavaExeFromJavaHome
  37. set JAVA_EXEC="%JAVA_HOME%\bin\java.exe"
  38. @REM *** SONAR RUNNER HOME VALIDATION ***
  39. :OkJava
  40. if NOT "%SONAR_RUNNER_HOME%"=="" goto cleanSonarRunnerHome
  41. set SONAR_RUNNER_HOME=%~dp0..
  42. goto run
  43. :cleanSonarRunnerHome
  44. @REM If the property has a trailing backslash, remove it
  45. if %SONAR_RUNNER_HOME:~-1%==\ set SONAR_RUNNER_HOME=%SONAR_RUNNER_HOME:~0,-1%
  46. @REM Check if the provided SONAR_RUNNER_HOME is a valid install dir
  47. IF EXIST "%SONAR_RUNNER_HOME%\lib\sonar-runner-impl-${project.version}.jar" goto run
  48. echo.
  49. echo ERROR: SONAR_RUNNER_HOME exists but does not point to a valid install
  50. echo directory: %SONAR_RUNNER_HOME%
  51. echo.
  52. goto error
  53. @REM ==== START RUN ====
  54. :run
  55. echo %SONAR_RUNNER_HOME%
  56. set PROJECT_HOME=%CD%
  57. %JAVA_EXEC% %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner-impl-${project.version}.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonar.runner.Main %*
  58. if ERRORLEVEL 1 goto error
  59. goto end
  60. :error
  61. set ERROR_CODE=1
  62. @REM ==== END EXECUTION ====
  63. :end
  64. @REM set local scope for the variables with windows NT shell
  65. @endlocal & set ERROR_CODE=%ERROR_CODE%
  66. @REM see http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/
  67. goto exit
  68. :returncode
  69. exit /B %1
  70. :exit
  71. call :returncode %ERROR_CODE%