-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.sh
executable file
·28 lines (21 loc) · 1.05 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
ABSOLUTE_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd "${ABSOLUTE_PATH}" || exit
set -e
printf "> \e[1;37mBuilding graphql-java-datetime\e[0m\n"
appVersion=$(./version.sh)
printf "\n# Project version \e[1;37m$appVersion\e[0m"
rm -rf build
printf "\n# Checking for failed dependencies\n\n"
./gradlew dependencies | grep FAILED && exit 1
if [ -n "${ARTIFACTORY_CONTEXT_URL}" ] && [[ $appVersion != *"SNAPSHOT"* ]]; then
printf "\n# Publishing plugin to Artifactory\n\n"
./gradlew -PprojectVersion="${appVersion}" clean jar sourcesJar generatePomFileForMainProjectPublicationPublication artifactoryPublish
elif [ -n "${BINTRAY_KEY}" ] && [[ $appVersion != *"SNAPSHOT"* ]]; then
printf "\n# Publishing plugin to Bintray\n\n"
./gradlew -PprojectVersion="${appVersion}" clean jar sourcesJar javadocJar generatePomFileForMainProjectPublicationPublication
./gradlew -PprojectVersion="${appVersion}" bintrayUpload
else
printf "# Installing locally\n\n"
./gradlew -PprojectVersion="${appVersion}" clean install -x javadoc -x test
fi