]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SONARPLUGINS-1220 Runner home must be optional
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 27 Jun 2011 09:02:41 +0000 (09:02 +0000)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 27 Jun 2011 09:02:41 +0000 (09:02 +0000)
src/main/assembly/bin/sonar-runner
src/main/assembly/bin/sonar-runner.bat
src/main/java/org/sonar/runner/Main.java

index 9193323c3a6288a984f46b9a40de302340ae43e0..16c7eb04be119b4e8a7fb7bed61a4f4c5eb5cebc 100755 (executable)
@@ -17,13 +17,16 @@ fi
 
 JAVA_CMD="`which java`"
 JAVA_CLASSPATH="${SONAR_RUNNER_HOME}"/lib/sonar-runner.jar:"${SONAR_RUNNER_HOME}"/lib/sonar-batch-bootstrapper.jar
+PROJECT_HOME=`pwd`
 
 #echo "Info: Using sonar-runner at $SONAR_RUNNER_HOME"
 #echo "Info: Using java at $JAVACMD"
 #echo "Info: Using classpath $JAVACLASSPATH"
+#echo "Info: Using project $PROJECT_HOME"
 
 exec "$JAVA_CMD" \
   $SONAR_RUNNER_OPTS \
   -classpath $JAVA_CLASSPATH \
   "-Drunner.home=${SONAR_RUNNER_HOME}" \
+  "-Dproject.home=${PROJECT_HOME}" \
   org.sonar.runner.Main "$@"
index 4635e80f31b9e5d64eb6887129134692f2d651b5..8be6542ccb5d09419c804a80716d6bb9fce52c59 100644 (file)
@@ -14,4 +14,7 @@ set SONAR_RUNNER_HOME=%~dp0..
 
 :run
 echo %SONAR_RUNNER_HOME%
-"%JAVA_HOME%\bin\java.exe" %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" org.sonar.runner.Main %*
+
+set PROJECT_HOME=%CD%
+
+"%JAVA_HOME%\bin\java.exe" %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonar.runner.Main %*
index f935d5fe9e901f95142472f76255951b16b111ae..1eb8b77f11d6872d7372fb3b911384745cd9036e 100644 (file)
@@ -51,11 +51,10 @@ public final class Main {
   }
 
   static Properties loadProperties(String[] args) {
-    Properties props = new Properties();
-    Properties commandLineProps = parseArguments(args);
-    props.putAll(loadRunnerProperties(commandLineProps));
-    props.putAll(loadProjectProperties(commandLineProps));
-    props.putAll(commandLineProps);
+    Properties props = parseArguments(args);
+    props.putAll(System.getProperties());
+    props.putAll(loadRunnerProperties(props));
+    props.putAll(loadProjectProperties(props));
     return props;
   }