From 12aa340e468692d599f330d328c592f1ffcfc2f0 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 16 Jan 2017 13:05:15 +0100 Subject: [PATCH] Added an option to build the project in parallel with this change we've added some scripts to run the build in parallel. It makes the build ~ 2 times faster fixes #190 --- README.adoc | 33 +++++++++++++++++++ docs/src/main/asciidoc/building.adoc | 33 +++++++++++++++++++ scripts/noIntegration.sh | 10 ++++++ scripts/parallelBuild.sh | 10 ++++++ .../pom.xml | 1 + 5 files changed, 87 insertions(+) create mode 100755 scripts/noIntegration.sh create mode 100755 scripts/parallelBuild.sh diff --git a/README.adoc b/README.adoc index b01712dc5a..de570bc6a8 100644 --- a/README.adoc +++ b/README.adoc @@ -1639,3 +1639,36 @@ cd spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin ./gradlew clean build ``` +=== Helpful scripts + +We're providing a couple of helpful scripts to build the project. + +To build the project in parallel (by default uses 4 cores but you can change it) + +``` +./scripts/parallelBuild.sh +``` + +and with 8 cores + +``` +CORES=8 ./scripts/parallelBuild.sh +``` + +To build the project without any integration tests (by default uses 1 core) + +``` +./scripts/noIntegration.sh +``` + +and with 8 cores + +``` +CORES=8 ./scripts/noIntegration.sh +``` + +To generate the documentation (both the root one and the maven plugin one) + +``` +./scripts/generateDocs.sh +``` diff --git a/docs/src/main/asciidoc/building.adoc b/docs/src/main/asciidoc/building.adoc index 445653ed3e..7ddc05175d 100644 --- a/docs/src/main/asciidoc/building.adoc +++ b/docs/src/main/asciidoc/building.adoc @@ -51,4 +51,37 @@ cd spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin ./gradlew clean build ``` +=== Helpful scripts + +We're providing a couple of helpful scripts to build the project. + +To build the project in parallel (by default uses 4 cores but you can change it) + +``` +./scripts/parallelBuild.sh +``` + +and with 8 cores + +``` +CORES=8 ./scripts/parallelBuild.sh +``` + +To build the project without any integration tests (by default uses 1 core) + +``` +./scripts/noIntegration.sh +``` + +and with 8 cores + +``` +CORES=8 ./scripts/noIntegration.sh +``` + +To generate the documentation (both the root one and the maven plugin one) + +``` +./scripts/generateDocs.sh +``` diff --git a/scripts/noIntegration.sh b/scripts/noIntegration.sh new file mode 100755 index 0000000000..4251e19220 --- /dev/null +++ b/scripts/noIntegration.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +source common.sh || source scripts/common.sh || echo "No common.sh script found..." + +set -e + +[[ -z "${CORES}" ]] && CORES=1 +echo -e "\n\nRUNNING FAST BUILD (NO INTEGRATION TESTS) WITH [${CORES}] CORES\n\n" + +./mvnw clean install -Pdocs,fast -T ${CORES} \ No newline at end of file diff --git a/scripts/parallelBuild.sh b/scripts/parallelBuild.sh new file mode 100755 index 0000000000..e8e2570ce6 --- /dev/null +++ b/scripts/parallelBuild.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +source common.sh || source scripts/common.sh || echo "No common.sh script found..." + +set -e + +[[ -z "${CORES}" ]] && CORES=8 +echo -e "\n\nRUNNING PARALLEL BUILD WITH [${CORES}] CORES\n\n" + +./mvnw clean install -Pintegration,docs -T ${CORES} -Dinvoker.parallelThreads=${CORES} \ No newline at end of file diff --git a/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml b/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml index 67bef1ba7a..9d0f191bbf 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml +++ b/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml @@ -247,6 +247,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin + 2.9