diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2020-12-18 10:27:51 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-12-22 20:09:38 +0000 |
commit | 0f1972c71fd80e613457995ec494bbbc3f57f8a7 (patch) | |
tree | 8f07d31026d7f1e4839bc265d913db6407e1cdf2 /sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap | |
parent | cc838211b1c811ff86156d481b9e7f7fba9c632c (diff) | |
download | sonarqube-0f1972c71fd80e613457995ec494bbbc3f57f8a7.tar.gz sonarqube-0f1972c71fd80e613457995ec494bbbc3f57f8a7.zip |
SONAR-13312 drop 'sonar.organization' scanner parameter
- drop unused bitbucket pipelines references
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap')
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalAnalysisMode.java | 2 | ||||
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalConfigurationProvider.java | 2 | ||||
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java | 2 | ||||
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java | 4 | ||||
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ProcessedScannerProperties.java | 60 | ||||
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java (renamed from sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/RawScannerProperties.java) | 14 | ||||
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java | 2 |
7 files changed, 16 insertions, 70 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalAnalysisMode.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalAnalysisMode.java index 9eb93129377..c4468eb90e4 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalAnalysisMode.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalAnalysisMode.java @@ -30,7 +30,7 @@ public class GlobalAnalysisMode { protected boolean mediumTestMode; - public GlobalAnalysisMode(RawScannerProperties props) { + public GlobalAnalysisMode(ScannerProperties props) { mediumTestMode = "true".equals(props.property(MEDIUM_TEST_ENABLED)); if (mediumTestMode) { LOG.info("Medium test mode"); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalConfigurationProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalConfigurationProvider.java index c72f7ef089b..efc9db8abe7 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalConfigurationProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalConfigurationProvider.java @@ -28,7 +28,7 @@ public class GlobalConfigurationProvider extends ProviderAdapter { private GlobalConfiguration globalConfig; - public GlobalConfiguration provide(GlobalServerSettings globalServerSettings, RawScannerProperties scannerProps, + public GlobalConfiguration provide(GlobalServerSettings globalServerSettings, ScannerProperties scannerProps, PropertyDefinitions propertyDefinitions) { if (globalConfig == null) { Map<String, String> mergedSettings = new LinkedHashMap<>(); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java index 9dfd4d3367d..42aa1bb7064 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java @@ -74,7 +74,7 @@ public class GlobalContainer extends ComponentContainer { @Override protected void doBeforeStart() { - RawScannerProperties rawScannerProperties = new RawScannerProperties(scannerProperties); + ScannerProperties rawScannerProperties = new ScannerProperties(scannerProperties); GlobalAnalysisMode globalMode = new GlobalAnalysisMode(rawScannerProperties); add(rawScannerProperties); add(globalMode); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java index 913fa7866b8..7456a587749 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java @@ -56,7 +56,7 @@ public class GlobalTempFolderProvider extends ProviderAdapter implements Compone this.system = system; } - public TempFolder provide(RawScannerProperties scannerProps) { + public TempFolder provide(ScannerProperties scannerProps) { if (tempFolder == null) { String workingPathName = StringUtils.defaultIfBlank(scannerProps.property(CoreProperties.GLOBAL_WORKING_DIRECTORY), CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE); @@ -95,7 +95,7 @@ public class GlobalTempFolderProvider extends ProviderAdapter implements Compone } } - private Path findSonarHome(RawScannerProperties props) { + private Path findSonarHome(ScannerProperties props) { String home = props.property("sonar.userHome"); if (home != null) { return Paths.get(home).toAbsolutePath(); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ProcessedScannerProperties.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ProcessedScannerProperties.java deleted file mode 100644 index a8ca80adc2f..00000000000 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ProcessedScannerProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.scanner.bootstrap; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import javax.annotation.concurrent.Immutable; -import org.sonar.scanner.scan.ExternalProjectKeyAndOrganization; - -import static org.sonar.api.CoreProperties.PROJECT_KEY_PROPERTY; - -/** - * Properties that are coming from scanner. - */ -@Immutable -public class ProcessedScannerProperties { - - private final Map<String, String> properties; - - public ProcessedScannerProperties(RawScannerProperties rawScannerProperties, - ExternalProjectKeyAndOrganization externalProjectKeyAndOrganization) { - this.properties = new HashMap<>(); - this.properties.putAll(rawScannerProperties.properties()); - - externalProjectKeyAndOrganization.getProjectKey() - .ifPresent(projectKey -> properties.put(PROJECT_KEY_PROPERTY, projectKey)); - externalProjectKeyAndOrganization.getOrganization() - .ifPresent(organization -> properties.put(org.sonar.core.config.ScannerProperties.ORGANIZATION, organization)); - } - - public Map<String, String> properties() { - return Collections.unmodifiableMap(new HashMap<>(properties)); - } - - public String property(String key) { - return properties.get(key); - } - - public String getProjectKey() { - return this.properties.get(PROJECT_KEY_PROPERTY); - } -} diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/RawScannerProperties.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java index 8d468a0cbeb..1316642836b 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/RawScannerProperties.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerProperties.java @@ -23,20 +23,22 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import javax.annotation.concurrent.Immutable; -import org.sonar.api.CoreProperties; import org.sonar.api.config.internal.Encryption; +import static org.sonar.api.CoreProperties.ENCRYPTION_SECRET_KEY_PATH; +import static org.sonar.api.CoreProperties.PROJECT_KEY_PROPERTY; + /** * Properties that are coming from scanner. */ @Immutable -public class RawScannerProperties { +public class ScannerProperties { private final Map<String, String> properties; private final Encryption encryption; - public RawScannerProperties(Map<String, String> properties) { - encryption = new Encryption(properties.get(CoreProperties.ENCRYPTION_SECRET_KEY_PATH)); + public ScannerProperties(Map<String, String> properties) { + encryption = new Encryption(properties.get(ENCRYPTION_SECRET_KEY_PATH)); Map<String, String> decryptedProps = new HashMap<>(properties.size()); for (Map.Entry<String, String> entry : properties.entrySet()) { String value = entry.getValue(); @@ -63,4 +65,8 @@ public class RawScannerProperties { public String property(String key) { return properties.get(key); } + + public String getProjectKey() { + return properties.get(PROJECT_KEY_PROPERTY); + } } diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java index 6c3bfd7718b..ea5cf27ee38 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java @@ -38,7 +38,7 @@ public class ScannerWsClientProvider extends ProviderAdapter { private DefaultScannerWsClient wsClient; - public synchronized DefaultScannerWsClient provide(final RawScannerProperties scannerProps, + public synchronized DefaultScannerWsClient provide(final ScannerProperties scannerProps, final EnvironmentInformation env, GlobalAnalysisMode globalMode, System2 system) { if (wsClient == null) { String url = defaultIfBlank(scannerProps.property("sonar.host.url"), "http://localhost:9000"); |