Ommiting comments in profiles

This commit is contained in:
Travis 2014-07-02 13:22:06 +02:00
commit 2a9c1d07f6

View file

@ -20,7 +20,7 @@ export BACKGROUND_CYAN=`tput setab 6`
export BACKGROUND_WHITE=`tput setab 7` export BACKGROUND_WHITE=`tput setab 7`
export RESET_FORMATTING=`tput sgr0` export RESET_FORMATTING=`tput sgr0`
# Wrapper function for Maven's mvn command. # Wrapper function for Maven's mvn command.
mvn-color() mvn-color()
{ {
@ -32,12 +32,12 @@ mvn-color()
-e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
-e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
-e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g"
# Make sure formatting is reset # Make sure formatting is reset
echo -ne ${RESET_FORMATTING} echo -ne ${RESET_FORMATTING}
) )
} }
# Override the mvn command with the colorized one. # Override the mvn command with the colorized one.
#alias mvn="mvn-color" #alias mvn="mvn-color"
@ -55,7 +55,7 @@ alias mvnct='mvn clean test'
alias mvnt='mvn test' alias mvnt='mvn test'
alias mvnag='mvn archetype:generate' alias mvnag='mvn archetype:generate'
alias mvn-updates='mvn versions:display-dependency-updates' alias mvn-updates='mvn versions:display-dependency-updates'
alias mvntc7='mvn tomcat7:run' alias mvntc7='mvn tomcat7:run'
alias mvntc='mvn tomcat:run' alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run' alias mvnjetty='mvn jetty:run'
alias mvndt='mvn dependency:tree' alias mvndt='mvn dependency:tree'
@ -79,7 +79,7 @@ function _realpath {
fi fi
else else
# file *cannot* exist # file *cannot* exist
return 1 # failure return 1 # failure
fi fi
# reassemble realpath # reassemble realpath
@ -98,13 +98,13 @@ function __pom_hierarchy {
## <parent> is present but not defined. Asume ../pom.xml ## <parent> is present but not defined. Asume ../pom.xml
if [ -z "$new_file" ]; then if [ -z "$new_file" ]; then
new_file="../pom.xml" new_file="../pom.xml"
fi fi
## if file exists continue else break ## if file exists continue else break
new_pom=`_realpath "${file%/*}/$new_file"` new_pom=`_realpath "${file%/*}/$new_file"`
if [ -n "$new_pom" ]; then if [ -n "$new_pom" ]; then
file=$new_pom file=$new_pom
else else
break break
fi fi
POM_HIERARCHY+=("$file") POM_HIERARCHY+=("$file")
@ -117,16 +117,16 @@ function listMavenCompletions {
local profiles=() local profiles=()
#current pom profiles #current pom profiles
for item in ${POM_HIERARCHY[*]}; do for item in ${POM_HIERARCHY[*]}; do
profiles=($profiles `[ -e $item ] && grep -e "<profile>" -A 1 $item | grep -e "<id>.*</id>" | sed 's?.*<id>\(.*\)<\/id>.*?-P\1?'`) profiles=($profiles `[ -e $item ] && cat $item | sed 's/<!--.*-->//' | sed '/<!--/,/-->/d' | grep -e "<profile>" -A 1 | grep -e "<id>.*</id>" | sed 's?.*<id>\(.*\)<\/id>.*?-P\1?'`)
done done
reply=( reply=(
# common lifecycle # common lifecycle
clean process-resources compile process-test-resources test-compile test package verify install deploy site clean process-resources compile process-test-resources test-compile test package verify install deploy site
# common plugins # common plugins
deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
# deploy # deploy
deploy:deploy-file deploy:deploy-file
# failsafe # failsafe
@ -137,7 +137,7 @@ function listMavenCompletions {
site:site site:deploy site:run site:stage site:stage-deploy site:site site:deploy site:run site:stage site:stage-deploy
# surefire # surefire
surefire:test surefire:test
# checkstyle # checkstyle
checkstyle:checkstyle checkstyle:check checkstyle:checkstyle checkstyle:check
# javadoc # javadoc
@ -169,12 +169,12 @@ function listMavenCompletions {
repository:bundle-create repository:bundle-pack repository:bundle-create repository:bundle-pack
# source # source
source:aggregate source:jar source:jar-no-fork source:aggregate source:jar source:jar-no-fork
# eclipse # eclipse
eclipse:clean eclipse:eclipse eclipse:clean eclipse:eclipse
# idea # idea
idea:clean idea:idea idea:clean idea:idea
# jetty # jetty
jetty:run jetty:run-exploded jetty:run jetty:run-exploded
# cargo # cargo
@ -228,8 +228,8 @@ function listMavenCompletions {
# arguments # arguments
-am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -pl -q -rf -s -T -t -U -up -V -v -X -am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -pl -q -rf -s -T -t -U -up -V -v -X
cli:execute cli:execute-phase cli:execute cli:execute-phase
archetype:generate generate-sources archetype:generate generate-sources
cobertura:cobertura cobertura:cobertura
-Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi` -Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`
$profiles $profiles