From 082ace5471dcc5b5b5f4d1c3cfaf82ddfae0df36 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Fri, 24 Nov 2017 09:25:26 +0100 Subject: Copy generated sonar-ws sources to sonar-ws-generated, automatically --- sonar-ws-generator/run.sh | 1 + .../src/main/java/org/sonarqube/wsgenerator/CodeFormatter.java | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sonar-ws-generator/run.sh b/sonar-ws-generator/run.sh index 4513503eec6..e79b51a3d34 100755 --- a/sonar-ws-generator/run.sh +++ b/sonar-ws-generator/run.sh @@ -7,3 +7,4 @@ set -euo pipefail mvn clean package -Prun-ws-generator java -Dorchestrator.configUrl=file://$* -jar target/sonar-ws-generator-*-SNAPSHOT-jar-with-dependencies.jar +cp -R target/generated-sources/results/org/sonarqube/ws/client/* ../sonar-ws-generated/src/main/java/org/sonarqube/ws/client diff --git a/sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/CodeFormatter.java b/sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/CodeFormatter.java index 1d062a2f9aa..aebeabf2323 100644 --- a/sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/CodeFormatter.java +++ b/sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/CodeFormatter.java @@ -30,7 +30,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringWriter; import java.io.Writer; -import java.util.Arrays; import java.util.HashSet; import java.util.Properties; import java.util.Set; @@ -39,12 +38,11 @@ import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Arrays.asList; public class CodeFormatter { - private static final Set PATH_EXCLUSIONS = new HashSet<>(Arrays.asList( - "api/components", "api/issues", "api/measures", "api/organizations", "api/permissions", "api/projects", - "api/project_analyses", "api/qualityprofiles", "api/rules", "api/settings", "api/users", "api/user_groups")); + private static final Set PATH_EXCLUSIONS = new HashSet<>(asList("api/orchestrator")); public static void format(String json) { JsonObject jsonElement = new Gson().fromJson(json, JsonObject.class); @@ -57,6 +55,7 @@ public class CodeFormatter { String webServicePath = webService.get("path").getAsString(); if (PATH_EXCLUSIONS.contains(webServicePath)) { + System.out.println("Excluding WS " + webServicePath + " from code generation"); continue; } -- cgit v1.2.3