From 118bc4fba824045c27c4e9efc20bcb8b2d1f23fd Mon Sep 17 00:00:00 2001 From: Benjamin DANGLOT Date: Fri, 14 Sep 2018 12:27:50 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20launch=20checkstyle=20in=20a=20dedicated?= =?UTF-8?q?=20node=20of=20travis=20and=20skip=20it=20when=E2=80=A6=20(#549?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: launch checkstyle in a dedicated node of travis and skip it when deploy * fix: checkstyle in CloverCoverageSelector --- .travis.yml | 11 ++--------- .travis/travis-checkstyle.sh | 3 +++ .travis/travis-deploy.sh | 2 +- .../dspot/selector/CloverCoverageSelector.java | 8 +++----- 4 files changed, 9 insertions(+), 15 deletions(-) create mode 100755 .travis/travis-checkstyle.sh diff --git a/.travis.yml b/.travis.yml index 0ad2a1739..11cea42f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ env: - SCRIPT=travis-coverage.sh - SCRIPT=travis-jar.sh - SCRIPT=travis-dspot-maven.sh + - SCRIPT=travis-checkstyle.sh cache: directories: @@ -35,12 +36,4 @@ after_success: branch: only: - - master - -notifications: - webhooks: - urls: - - "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGJkYW5nbG90JTNBbWF0cml4Lm9yZy8lMjF2bkN5V2FHSmJ4RVNBa3p5cWglM0FtYXRyaXgub3Jn" - on_success: change # always|never|change - on_failure: always - on_start: never + - master \ No newline at end of file diff --git a/.travis/travis-checkstyle.sh b/.travis/travis-checkstyle.sh new file mode 100755 index 000000000..8d364fd25 --- /dev/null +++ b/.travis/travis-checkstyle.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +mvn checkstyle:checkstyle \ No newline at end of file diff --git a/.travis/travis-deploy.sh b/.travis/travis-deploy.sh index 08c3cfc8d..a2a8cf6e0 100755 --- a/.travis/travis-deploy.sh +++ b/.travis/travis-deploy.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then - cp .travis/travis-settings.xml $HOME/.m2/settings.xml && mvn deploy -DskipTests + cp .travis/travis-settings.xml $HOME/.m2/settings.xml && mvn deploy -DskipTests -Dcheckstyle.skip else echo "Nothing to deploy when on PR or other branch" fi \ No newline at end of file diff --git a/dspot/src/main/java/eu/stamp_project/dspot/selector/CloverCoverageSelector.java b/dspot/src/main/java/eu/stamp_project/dspot/selector/CloverCoverageSelector.java index 9279187e1..f163c8cf8 100644 --- a/dspot/src/main/java/eu/stamp_project/dspot/selector/CloverCoverageSelector.java +++ b/dspot/src/main/java/eu/stamp_project/dspot/selector/CloverCoverageSelector.java @@ -192,14 +192,12 @@ private Coverage computeAmplifiedCoverage() { } private final static String PATH_TO_COPIED_FILES = "target/dspot/copy/"; - private String getPathToCopiedFiles() { - return DSpotUtils.shouldAddSeparator.apply(this.configuration.getAbsolutePathToProjectRoot()) - + PATH_TO_COPIED_FILES; + return this.configuration.getAbsolutePathToProjectRoot() + PATH_TO_COPIED_FILES; } - - private void initDirectory() { + + private void initDirectory() { // in order to run clover easily, we have to put all the sources and // test classes in the same folder. // also, we will print amplified test in the same folder