From: Evgeny Mandrikov Date: Thu, 3 Feb 2011 05:47:06 +0000 (+0000) Subject: SONAR-RUNNER: Add script for Windows X-Git-Tag: 2.5-rc1~356 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=95ce1de831dc7c4e46031364ae6dd9485e977597;p=sonar-scanner-cli.git SONAR-RUNNER: Add script for Windows --- diff --git a/assembly.xml b/assembly.xml deleted file mode 100644 index 3c2c671..0000000 --- a/assembly.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - bin - - zip - - true - - - - true - lib - ${artifact.artifactId}.${artifact.extension} - - - - - ${basedir}/src/main/assembly - / - 0755 - 0755 - - - 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/bin/sonar-runner b/src/bin/sonar-runner new file mode 100755 index 0000000..af95fd5 --- /dev/null +++ b/src/bin/sonar-runner @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Sonar Runner Startup Script for Unix +# + +if [ -z "$SONAR_RUNNER_HOME" ] ; then + PRG="$0" + + SONAR_RUNNER_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + SONAR_RUNNER_HOME=`cd "$SONAR_RUNNER_HOME" && pwd` +fi + +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 "$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/conf/sonar-runner.properties b/src/conf/sonar-runner.properties new file mode 100644 index 0000000..5f01622 --- /dev/null +++ b/src/conf/sonar-runner.properties @@ -0,0 +1,25 @@ +#----- Default directory layout +sources=src/main/java +tests=src/test/java +binaries=target/classes + +sonar.sourceEncoding=UTF-8 + +#----- Default Sonar server +#sonar.host.url=http://localhost:9000 + +#----- PostgreSQL +#sonar.jdbc.url=jdbc:postgresql://localhost/sonar +#sonar.jdbc.driver=org.postgresql.Driver + +#----- MySQL +#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 +#sonar.jdbc.driver=com.mysql.jdbc.Driver + +#----- Oracle +#sonar.jdbc.url=jdbc:oracle:thin:@localhost/XE +#sonar.jdbc.driver=oracle.jdbc.driver.OracleDriver + +#----- Global database settings +#sonar.jdbc.username=sonar +#sonar.jdbc.password=sonar 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/src/main/assembly/assembly.xml b/src/main/assembly/assembly.xml new file mode 100644 index 0000000..ca8f257 --- /dev/null +++ b/src/main/assembly/assembly.xml @@ -0,0 +1,38 @@ + + + bin + + zip + + true + + + true + lib + ${artifact.artifactId}.${artifact.extension} + + + + + src/bin + bin + + sonar-runner.bat + + dos + + + src/bin + bin + + sonar-runner + + unix + 0755 + + + src/conf + conf + + + diff --git a/src/main/assembly/bin/sonar-runner.sh b/src/main/assembly/bin/sonar-runner.sh deleted file mode 100755 index 1012948..0000000 --- a/src/main/assembly/bin/sonar-runner.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# Sonar Runner Startup Script for Unix -# - -if [ -z "$SONAR_RUNNER_HOME" ] ; then - PRG="$0" - - SONAR_RUNNER_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - 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 - -#echo "Info: Using sonar-runner at $SONAR_RUNNER_HOME" -#echo "Info: Using java at $JAVACMD" -#echo "Info: Using classpath $JAVACLASSPATH" - -exec "$JAVACMD" \ - -classpath $JAVACLASSPATH \ - "-Drunner.home=${SONAR_RUNNER_HOME}" \ - org.sonar.runner.Main "$@" diff --git a/src/main/assembly/conf/sonar-runner.properties b/src/main/assembly/conf/sonar-runner.properties deleted file mode 100644 index 5f01622..0000000 --- a/src/main/assembly/conf/sonar-runner.properties +++ /dev/null @@ -1,25 +0,0 @@ -#----- Default directory layout -sources=src/main/java -tests=src/test/java -binaries=target/classes - -sonar.sourceEncoding=UTF-8 - -#----- Default Sonar server -#sonar.host.url=http://localhost:9000 - -#----- PostgreSQL -#sonar.jdbc.url=jdbc:postgresql://localhost/sonar -#sonar.jdbc.driver=org.postgresql.Driver - -#----- MySQL -#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 -#sonar.jdbc.driver=com.mysql.jdbc.Driver - -#----- Oracle -#sonar.jdbc.url=jdbc:oracle:thin:@localhost/XE -#sonar.jdbc.driver=oracle.jdbc.driver.OracleDriver - -#----- Global database settings -#sonar.jdbc.username=sonar -#sonar.jdbc.password=sonar