]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SONAR-RUNNER: Add script for Windows
authorEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 3 Feb 2011 05:47:06 +0000 (05:47 +0000)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Thu, 3 Feb 2011 05:47:06 +0000 (05:47 +0000)
assembly.xml [deleted file]
pom.xml
src/bin/sonar-runner [new file with mode: 0755]
src/bin/sonar-runner.bat [new file with mode: 0644]
src/conf/sonar-runner.properties [new file with mode: 0644]
src/it/example/analyze.sh [deleted file]
src/main/assembly/assembly.xml [new file with mode: 0644]
src/main/assembly/bin/sonar-runner.sh [deleted file]
src/main/assembly/conf/sonar-runner.properties [deleted file]

diff --git a/assembly.xml b/assembly.xml
deleted file mode 100644 (file)
index 3c2c671..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<assembly>
-  <id>bin</id>
-  <formats>
-    <format>zip</format>
-  </formats>
-  <includeBaseDirectory>true</includeBaseDirectory>
-
-  <dependencySets>
-    <dependencySet>
-      <useProjectArtifact>true</useProjectArtifact>
-      <outputDirectory>lib</outputDirectory>
-      <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
-    </dependencySet>
-  </dependencySets>
-  <fileSets>
-    <fileSet>
-      <directory>${basedir}/src/main/assembly</directory>
-      <outputDirectory>/</outputDirectory>
-      <fileMode>0755</fileMode>
-      <directoryMode>0755</directoryMode>
-    </fileSet>
-  </fileSets>
-</assembly>
diff --git a/pom.xml b/pom.xml
index 87aa91ea9fb6415a6d6ac582642b9dbc7996004c..5f06253fe3351376c2eca95255948acefd18bf9d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
             </goals>
             <configuration>
               <appendAssemblyId>false</appendAssemblyId>
-              <finalName>sonar-runner-${project.version}</finalName>
               <descriptors>
-                <descriptor>assembly.xml</descriptor>
+                <descriptor>${basedir}/src/main/assembly/assembly.xml</descriptor>
               </descriptors>
             </configuration>
           </execution>
diff --git a/src/bin/sonar-runner b/src/bin/sonar-runner
new file mode 100755 (executable)
index 0000000..af95fd5
--- /dev/null
@@ -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 (file)
index 0000000..35bf67c
--- /dev/null
@@ -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 (file)
index 0000000..5f01622
--- /dev/null
@@ -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&amp;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 (executable)
index f3e2f6a..0000000
+++ /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 (file)
index 0000000..ca8f257
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly>
+  <id>bin</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>true</useProjectArtifact>
+      <outputDirectory>lib</outputDirectory>
+      <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+    </dependencySet>
+  </dependencySets>
+  <fileSets>
+    <fileSet>
+      <directory>src/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <includes>
+        <include>sonar-runner.bat</include>
+      </includes>
+      <lineEnding>dos</lineEnding>
+    </fileSet>
+    <fileSet>
+      <directory>src/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <includes>
+        <include>sonar-runner</include>
+      </includes>
+      <lineEnding>unix</lineEnding>
+      <fileMode>0755</fileMode>
+    </fileSet>
+    <fileSet>
+      <directory>src/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/src/main/assembly/bin/sonar-runner.sh b/src/main/assembly/bin/sonar-runner.sh
deleted file mode 100755 (executable)
index 1012948..0000000
+++ /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 (file)
index 5f01622..0000000
+++ /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&amp;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