From 95ce1de831dc7c4e46031364ae6dd9485e977597 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 3 Feb 2011 05:47:06 +0000 Subject: [PATCH] SONAR-RUNNER: Add script for Windows --- pom.xml | 3 +-- .../bin/sonar-runner.sh => bin/sonar-runner} | 10 ++++----- src/bin/sonar-runner.bat | 5 +++++ .../conf/sonar-runner.properties | 0 src/it/example/analyze.sh | 4 ---- .../main/assembly/assembly.xml | 22 +++++++++++++++---- 6 files changed, 28 insertions(+), 16 deletions(-) rename src/{main/assembly/bin/sonar-runner.sh => bin/sonar-runner} (67%) create mode 100644 src/bin/sonar-runner.bat rename src/{main/assembly => }/conf/sonar-runner.properties (100%) delete mode 100755 src/it/example/analyze.sh rename assembly.xml => src/main/assembly/assembly.xml (50%) diff --git a/pom.xml b/pom.xml index 87aa91e..5f06253 100644 --- a/pom.xml +++ b/pom.xml @@ -104,9 +104,8 @@ false - sonar-runner-${project.version} - assembly.xml + ${basedir}/src/main/assembly/assembly.xml diff --git a/src/main/assembly/bin/sonar-runner.sh b/src/bin/sonar-runner similarity index 67% rename from src/main/assembly/bin/sonar-runner.sh rename to src/bin/sonar-runner index 1012948..af95fd5 100755 --- a/src/main/assembly/bin/sonar-runner.sh +++ b/src/bin/sonar-runner @@ -12,16 +12,14 @@ if [ -z "$SONAR_RUNNER_HOME" ] ; then SONAR_RUNNER_HOME=`cd "$SONAR_RUNNER_HOME" && pwd` fi -JAVACMD="`which java`" - -JAVACLASSPATH="${SONAR_RUNNER_HOME}"/lib/sonar-runner.jar -JAVACLASSPATH=$JAVACLASSPATH:"${SONAR_RUNNER_HOME}"/lib/sonar-batch-bootstrapper.jar +JAVA_CMD="`which java`" +JAVA_CLASSPATH="${SONAR_RUNNER_HOME}"/lib/sonar-runner.jar:"${SONAR_RUNNER_HOME}"/lib/sonar-batch-bootstrapper.jar #echo "Info: Using sonar-runner at $SONAR_RUNNER_HOME" #echo "Info: Using java at $JAVACMD" #echo "Info: Using classpath $JAVACLASSPATH" -exec "$JAVACMD" \ - -classpath $JAVACLASSPATH \ +exec "$JAVA_CMD" \ + -classpath $JAVA_CLASSPATH \ "-Drunner.home=${SONAR_RUNNER_HOME}" \ org.sonar.runner.Main "$@" diff --git a/src/bin/sonar-runner.bat b/src/bin/sonar-runner.bat new file mode 100644 index 0000000..35bf67c --- /dev/null +++ b/src/bin/sonar-runner.bat @@ -0,0 +1,5 @@ +@REM Sonar Runner Startup Script for Windows + +@echo off + +"%JAVA_HOME%\bin\java.exe" -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 diff --git a/src/main/assembly/conf/sonar-runner.properties b/src/conf/sonar-runner.properties similarity index 100% rename from src/main/assembly/conf/sonar-runner.properties rename to src/conf/sonar-runner.properties diff --git a/src/it/example/analyze.sh b/src/it/example/analyze.sh deleted file mode 100755 index f3e2f6a..0000000 --- a/src/it/example/analyze.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# TODO remove hard-coded version -java -jar ../../../target/sonar-cli-0.1-SNAPSHOT.jar project.properties diff --git a/assembly.xml b/src/main/assembly/assembly.xml similarity index 50% rename from assembly.xml rename to src/main/assembly/assembly.xml index 3c2c671..ca8f257 100644 --- a/assembly.xml +++ b/src/main/assembly/assembly.xml @@ -5,7 +5,6 @@ zip true - true @@ -15,10 +14,25 @@ - ${basedir}/src/main/assembly - / + src/bin + bin + + sonar-runner.bat + + dos + + + src/bin + bin + + sonar-runner + + unix 0755 - 0755 + + + src/conf + conf -- 2.39.5