aboutsummaryrefslogtreecommitdiff
path: root/fixup.sh
diff options
context:
space:
mode:
authorEugene Susla <eugenesusla@google.com>2019-07-31 15:12:54 -0700
committerEugene Susla <eugenesusla@google.com>2019-07-31 15:12:54 -0700
commit1410e008c8ea196afec98d7766e6dca5c9d555b4 (patch)
tree68586f4fd910c3b08a9608d7be5e186c9df572c6 /fixup.sh
parent1b2211eaf2fa78358abe0b16f82ccf0b689aa56a (diff)
downloadjavaparser-1410e008c8ea196afec98d7766e6dca5c9d555b4.tar.gz
Pull commits from upstream for java 11 compatibility!
Change-Id: I27826ba60af5c54848e2eae40930d8fb8a302919
Diffstat (limited to 'fixup.sh')
-rwxr-xr-xfixup.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/fixup.sh b/fixup.sh
new file mode 100755
index 000000000..c7220d6f1
--- /dev/null
+++ b/fixup.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+
+mvn org.walkmod.maven.plugins:walkmod-maven-plugin:apply -Dchains=pmd -Dproperties="configurationFile=ruleset.xml" -Dpath=src/main/java
+git diff > walkmod.patch
+
+if [ "$TRAVIS_PULL_REQUEST" = false ] ; then
+ echo 'Skipped build. This is not a pull request'
+ exit 0
+fi
+
+if [ -z "$TRAVIS_REPO_SLUG" ]
+then
+ echo "There is not TRAVIS_REPO_SLUG defined"
+ exit 1
+fi
+
+if [ -z "$TRAVIS_PULL_REQUEST_SHA" ]
+then
+ echo "There is not TRAVIS_PULL_REQUEST_SHA defined"
+ exit 1
+fi
+
+if [ -z "$OCTOPATCH_API_TOKEN" ] ; then
+ echo "There is not OCTOPATCH_API_TOKEN defined"
+ exit 1
+fi
+
+REQUEST="curl -X POST -H \"Content-Type: multipart/form-data\""
+FILES=$(find . -type f -name "*.patch")
+if [ -z "$FILES" ]
+then
+ echo "Perfect! There are not patch files"
+ exit 0
+fi
+
+for FILE in $FILES
+do
+ REQUEST+=" -F \"data=@$FILE\""
+done
+
+REQUEST+=" -H \"Authorization: $OCTOPATCH_API_TOKEN\" api.octopatch.io/api/pulls/$TRAVIS_REPO_SLUG/$TRAVIS_PULL_REQUEST/$TRAVIS_PULL_REQUEST_SHA"
+eval $REQUEST \ No newline at end of file