From: Daniel Schwarz Date: Wed, 6 Dec 2017 09:17:39 +0000 (+0100) Subject: Add README.md to sonar-ws-generator X-Git-Tag: 7.0-RC1~177 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=67b8132247f0332b1ff4df2923cc2aad479d46e4;p=sonarqube.git Add README.md to sonar-ws-generator --- diff --git a/sonar-ws-generator/README.md b/sonar-ws-generator/README.md new file mode 100644 index 00000000000..75369809b57 --- /dev/null +++ b/sonar-ws-generator/README.md @@ -0,0 +1,17 @@ +# What is this project used for? + +The *sonar-ws-generator* must be used to generate the java sources used to access the Web API (HTTP) of SonarQube. +The generated sources are not compilable on their own, but require to be copied in the `sonar-ws` module. + +# How do I use it? + +* Make your changes on the SonarQube Web API (protobuf specification of responses in sonar-ws or `WebService` implementations in sonar-server) +* Build SonarQube (for example with `./quick-build.sh`) +* Run this generator: `sonar-ws-generator/run.sh` +* Check your git status: the generated sources are copied in `sonar-ws/src/main/java`. Please double check the changed code. +* Now you can rebuild sonar-ws and use it in integration tests + +# Hints +* A request parameter has type `List` if its description contains "comma-separated" or "list of" (case insensitive). Examples: + * "Comma-separated list of metric keys" + * "List of metric keys" diff --git a/sonar-ws-generator/run.sh b/sonar-ws-generator/run.sh index 58b77a09c44..f785bcb4032 100755 --- a/sonar-ws-generator/run.sh +++ b/sonar-ws-generator/run.sh @@ -1,10 +1,9 @@ #!/bin/bash - -# Example: -# run.sh /path/to/orchestrator.properties - set -euo pipefail +SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" + +cd $SCRIPTPATH mvn clean package -Prun-ws-generator java -jar target/sonar-ws-generator-*-SNAPSHOT-jar-with-dependencies.jar cp -R target/generated-sources/results/org/sonarqube/ws/client/* ../sonar-ws/src/main/java/org/sonarqube/ws/client