aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-04-30 16:59:35 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2024-05-03 13:07:43 +0200
commit69d6ba48c07b69ddd6cce7361573d3ab46517fb0 (patch)
tree954c1f79ac3cd40ab4e4451ae986d37fff4d42d4 /src
parent9eb22f219a4404e68a74f2d0de6a6818e34d6e50 (diff)
downloadsonar-scanner-cli-69d6ba48c07b69ddd6cce7361573d3ab46517fb0.tar.gz
sonar-scanner-cli-69d6ba48c07b69ddd6cce7361573d3ab46517fb0.zip
SCANCLI-84 Rename SonarScanner -> SonarScanner CLI
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main/assembly/bin/sonar-scanner2
-rwxr-xr-xsrc/main/assembly/bin/sonar-scanner-debug4
-rw-r--r--src/main/assembly/bin/sonar-scanner-debug.bat4
-rw-r--r--src/main/assembly/bin/sonar-scanner.bat2
-rw-r--r--src/main/assembly/conf/sonar-scanner.properties13
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/Main.java6
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/SystemInfo.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/MainTest.java24
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java2
9 files changed, 29 insertions, 30 deletions
diff --git a/src/main/assembly/bin/sonar-scanner b/src/main/assembly/bin/sonar-scanner
index 2d2c2cc..128143f 100755
--- a/src/main/assembly/bin/sonar-scanner
+++ b/src/main/assembly/bin/sonar-scanner
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
#
-# SonarScanner Startup Script for Unix
+# SonarScanner CLI Startup Script for Unix
#
# Required ENV vars:
# JAVA_HOME - Location of Java's installation, optional if use_embedded_jre is set
diff --git a/src/main/assembly/bin/sonar-scanner-debug b/src/main/assembly/bin/sonar-scanner-debug
index dd45ab0..1a49c84 100755
--- a/src/main/assembly/bin/sonar-scanner-debug
+++ b/src/main/assembly/bin/sonar-scanner-debug
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
#
-# SonarScanner Startup Script for Unix
+# SonarScanner CLI Startup Script for Unix
#
# Required ENV vars:
# JAVA_HOME - Location of Java's installation, optional if use_embedded_jre is set
@@ -10,7 +10,7 @@
SONAR_SCANNER_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
-echo "Executing SonarScanner in Debug Mode"
+echo "Executing SonarScanner CLI in Debug Mode"
echo "SONAR_SCANNER_DEBUG_OPTS=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\""
env SONAR_SCANNER_OPTS="$SONAR_SCANNER_OPTS" SONAR_SCANNER_DEBUG_OPTS="$SONAR_SCANNER_DEBUG_OPTS" "`dirname "$0"`"/sonar-scanner "$@"
diff --git a/src/main/assembly/bin/sonar-scanner-debug.bat b/src/main/assembly/bin/sonar-scanner-debug.bat
index 3021c01..aeaae59 100644
--- a/src/main/assembly/bin/sonar-scanner-debug.bat
+++ b/src/main/assembly/bin/sonar-scanner-debug.bat
@@ -1,4 +1,4 @@
-@REM SonarScanner Startup Script for Windows
+@REM SonarScanner CLI Startup Script for Windows
@REM
@REM Required ENV vars:
@REM JAVA_HOME - Location of Java's installation, optional if use_embedded_jre is set
@@ -8,6 +8,6 @@
@setlocal
@set SONAR_SCANNER_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-echo "Executing SonarScanner in Debug Mode"
+echo "Executing SonarScanner CLI in Debug Mode"
echo "SONAR_SCANNER_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
@call "%~dp0"sonar-scanner.bat %*
diff --git a/src/main/assembly/bin/sonar-scanner.bat b/src/main/assembly/bin/sonar-scanner.bat
index fdfbfd9..654137d 100644
--- a/src/main/assembly/bin/sonar-scanner.bat
+++ b/src/main/assembly/bin/sonar-scanner.bat
@@ -1,4 +1,4 @@
-@REM SonarScanner Startup Script for Windows
+@REM SonarScanner CLI Startup Script for Windows
@REM
@REM Required ENV vars:
@REM JAVA_HOME - Location of Java's installation, optional if use_embedded_jre is set
diff --git a/src/main/assembly/conf/sonar-scanner.properties b/src/main/assembly/conf/sonar-scanner.properties
index b30e841..8bf8356 100644
--- a/src/main/assembly/conf/sonar-scanner.properties
+++ b/src/main/assembly/conf/sonar-scanner.properties
@@ -1,9 +1,8 @@
-#Configure here general information about the environment, such as SonarQube server connection details for example
-#No information about specific project should appear here
+# Configure here general information about the environment, such as the server connection details for example
+# No information about specific project should appear here
-#----- Default SonarQube server
-#sonar.host.url=http://localhost:9000
-
-#----- Default source code encoding
-#sonar.sourceEncoding=UTF-8
+#----- SonarQube server URL (default to SonarCloud)
+#sonar.host.url=https://mycompany.com/sonarqube
+#sonar.scanner.proxyHost=myproxy.mycompany.com
+#sonar.scanner.proxyPort=8002
diff --git a/src/main/java/org/sonarsource/scanner/cli/Main.java b/src/main/java/org/sonarsource/scanner/cli/Main.java
index f9a613d..8ad0c05 100644
--- a/src/main/java/org/sonarsource/scanner/cli/Main.java
+++ b/src/main/java/org/sonarsource/scanner/cli/Main.java
@@ -79,7 +79,7 @@ public class Main {
}
} catch (Throwable e) {
displayExecutionResult(stats, "FAILURE");
- showError("Error during SonarScanner execution", e, cli.isDebugEnabled());
+ showError("Error during SonarScanner CLI execution", e, cli.isDebugEnabled());
status = isUserError(e) ? Exit.USER_ERROR : Exit.INTERNAL_ERROR;
} finally {
exit.exit(status);
@@ -97,7 +97,7 @@ public class Main {
private void checkSkip(Properties properties) {
if ("true".equalsIgnoreCase(properties.getProperty(ScanProperties.SKIP))) {
- logger.info("SonarScanner analysis skipped");
+ logger.info("SonarScanner CLI analysis skipped");
exit.exit(Exit.SUCCESS);
}
}
@@ -155,7 +155,7 @@ public class Main {
private void suggestDebugMode() {
if (!cli.isEmbedded()) {
- logger.error("Re-run SonarScanner using the -X switch to enable full debug logging.");
+ logger.error("Re-run SonarScanner CLI using the -X switch to enable full debug logging.");
}
}
diff --git a/src/main/java/org/sonarsource/scanner/cli/SystemInfo.java b/src/main/java/org/sonarsource/scanner/cli/SystemInfo.java
index 5aee435..30abee5 100644
--- a/src/main/java/org/sonarsource/scanner/cli/SystemInfo.java
+++ b/src/main/java/org/sonarsource/scanner/cli/SystemInfo.java
@@ -39,7 +39,7 @@ class SystemInfo {
}
static void print(Logs logger) {
- logger.info("SonarScanner " + ScannerVersion.version());
+ logger.info("SonarScanner CLI " + ScannerVersion.version());
logger.info(java());
logger.info(os());
String scannerOpts = system.getenv("SONAR_SCANNER_OPTS");
diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
index 3169142..5d4a372 100644
--- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
@@ -93,7 +93,7 @@ public class MainTest {
main.analyze();
verify(exit).exit(Exit.INTERNAL_ERROR);
- verify(logs).error("Error during SonarScanner execution", e);
+ verify(logs).error("Error during SonarScanner CLI execution", e);
}
@Test
@@ -110,7 +110,7 @@ public class MainTest {
verify(bootstrapper).bootstrap();
verify(engine, never()).analyze(any());
verify(exit).exit(Exit.INTERNAL_ERROR);
- verify(logs).error("Error during SonarScanner execution", e);
+ verify(logs).error("Error during SonarScanner CLI execution", e);
}
@Test
@@ -118,8 +118,8 @@ public class MainTest {
Exception e = createException(false);
testException(e, false, false, Exit.INTERNAL_ERROR);
- verify(logs).error("Error during SonarScanner execution", e);
- verify(logs).error("Re-run SonarScanner using the -X switch to enable full debug logging.");
+ verify(logs).error("Error during SonarScanner CLI execution", e);
+ verify(logs).error("Re-run SonarScanner CLI using the -X switch to enable full debug logging.");
}
@Test
@@ -128,11 +128,11 @@ public class MainTest {
testException(e, false, false, Exit.USER_ERROR);
verify(logs, times(5)).error(anyString());
- verify(logs).error("Error during SonarScanner execution");
+ verify(logs).error("Error during SonarScanner CLI execution");
verify(logs).error("my message");
verify(logs).error("Caused by: A functional cause");
verify(logs).error("");
- verify(logs).error("Re-run SonarScanner using the -X switch to enable full debug logging.");
+ verify(logs).error("Re-run SonarScanner CLI using the -X switch to enable full debug logging.");
}
@Test
@@ -141,7 +141,7 @@ public class MainTest {
testException(e, false, true, Exit.USER_ERROR);
verify(logs, times(4)).error(anyString());
- verify(logs).error("Error during SonarScanner execution");
+ verify(logs).error("Error during SonarScanner CLI execution");
verify(logs).error("my message");
verify(logs).error("Caused by: A functional cause");
verify(logs).error("");
@@ -153,7 +153,7 @@ public class MainTest {
testException(e, true, false, Exit.USER_ERROR);
verify(logs, times(1)).error(anyString(), any(Throwable.class));
- verify(logs).error("Error during SonarScanner execution", e);
+ verify(logs).error("Error during SonarScanner CLI execution", e);
}
@Test
@@ -162,7 +162,7 @@ public class MainTest {
testException(e, true, true, Exit.USER_ERROR);
verify(logs, times(1)).error(anyString(), any(Throwable.class));
- verify(logs).error("Error during SonarScanner execution", e);
+ verify(logs).error("Error during SonarScanner CLI execution", e);
}
@Test
@@ -170,8 +170,8 @@ public class MainTest {
Exception e = createException(false);
testException(e, true, false, Exit.INTERNAL_ERROR);
- verify(logs).error("Error during SonarScanner execution", e);
- verify(logs, never()).error("Re-run SonarScanner using the -X switch to enable full debug logging.");
+ verify(logs).error("Error during SonarScanner CLI execution", e);
+ verify(logs, never()).error("Re-run SonarScanner CLI using the -X switch to enable full debug logging.");
}
private void testException(Exception e, boolean debugEnabled, boolean isEmbedded, int expectedExitCode) {
@@ -228,7 +228,7 @@ public class MainTest {
Main main = new Main(exit, cli, conf, scannerEngineBootstrapperFactory, logs);
main.analyze();
- verify(logs).info("SonarScanner analysis skipped");
+ verify(logs).info("SonarScanner CLI analysis skipped");
InOrder inOrder = Mockito.inOrder(exit, scannerEngineBootstrapperFactory);
inOrder.verify(exit, times(1)).exit(Exit.SUCCESS);
diff --git a/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java b/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java
index b5415a1..5a45873 100644
--- a/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/SystemInfoTest.java
@@ -83,7 +83,7 @@ public class SystemInfoTest {
verify(mockSystem).getenv("SONAR_SCANNER_OPTS");
verify(logs, never()).info("SonarScanner null");
- verify(logs).info("SonarScanner " + ScannerVersion.version());
+ verify(logs).info("SonarScanner CLI " + ScannerVersion.version());
verify(logs).info("Java 1.9 oracle (64-bit)");
verify(logs).info("linux 2.5 x64");
verify(logs).info("SONAR_SCANNER_OPTS=arg");