Skip to content

Commit

Permalink
Improve build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
NawaMan committed Jul 27, 2023
1 parent 4aa049e commit 91e3733
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions build.sh
Expand Up @@ -24,19 +24,33 @@ function main() {
function build-quick() {
ensure-java-version
set-version
./mvnw clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true
./mvnw \
--no-transfer-progress \
--batch-mode \
-Dmaven.test.skip=true \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip=true \
clean install
}

function build-test() {
ensure-java-version
set-version
./mvnw clean compile test -Dmaven.javadoc.skip=true -Dmaven.source.skip=true
./mvnw \
--no-transfer-progress \
--batch-mode \
-Dmaven.source.skip=true \
-Dmaven.javadoc.skip=true \
clean compile test
}

function build-full() {
ensure-java-version
set-version
./mvnw clean install -Dgpg.signing.skip=true
./mvnw \
--no-transfer-progress \
--batch-mode \
clean install
}

function build-package() {
Expand All @@ -49,7 +63,11 @@ function build-package() {

ensure-java-version
set-version
./mvnw clean install package deploy -Dnexus.staging.skip=true
./mvnw \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase=$NAWAMAN_SIGNING_PASSWORD \
clean install package deploy -Ppackage
}

function build-release() {
Expand All @@ -69,7 +87,11 @@ function build-release() {

ensure-java-version
set-version
./mvnw clean install package deploy
./mvnw \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase=$NAWAMAN_SIGNING_PASSWORD \
clean install package deploy -Ppublish

set -x
increment-build-number
Expand All @@ -86,10 +108,12 @@ function show-help() {
echo " package: Compile, test, install and package (signed)."
echo " release: Build and release. Must be run while on 'release' branch only."
echo " help : Show this message."
echo ""
echo "All command requires the follow files"
echo " project-version-number: Contains the major and minor version. For example: 2.0 for '2.0.6' version."
echo " project-build-number : Contains the build number. For example: 6 for '2.0.6' version."
echo " key-var-name : Contains the environmental variable name that holds the key name, e.g., DEFAULTJ_KEYNAME."
echo ""
echo "Release comand requires the following environmental variable."
echo " NAWAMAN_SIGNING_PASSWORD : The password for the signing key. Make sure the user name is in '~/.m2/settings.xml'".
echo " NAWAMAN_SONATYPE_PASSWORD: The password for SONATYPE account."
Expand Down

0 comments on commit 91e3733

Please sign in to comment.