-
-
Save eristoddle/edfaf53ea8f93208dd156dd5c5b372cb to your computer and use it in GitHub Desktop.
wso2 studio developer artifact.xml generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# using: bash-artifactxml-gen.sh my.project.folder | |
# | |
ROOTFOLDER=$* | |
#set src dir | |
SRCDIR=$ROOTFOLDER'/src/'; | |
#cd to src dir | |
cd $SRCDIR; | |
#start gen artifact.xml | |
echo '<?xml version="1.0" encoding="UTF-8"?><artifacts>'; | |
#foreach all xml (except pom.xml and artifact.xml) files in src directory | |
for D in `find . -name '*.xml' ! -name 'pom.xml' ! -name 'artifact.xml'` | |
do | |
#set full filename | |
FILENAME=`echo $D | awk 'BEGIN { RS = "/" }; END {print $1}'`; | |
#set foldername | |
FOLDERNAME=`echo $D | awk 'BEGIN { FS = "/" }; END {print $4}'`; | |
#set filename whitout extension .xml | |
FNAME=`echo $FILENAME | awk 'BEGIN {FS = ".xml"}; END {print $1}'`; | |
#replace dot and slash in filepath | |
PATHTOXML=`echo $D | sed 's/^.\///g'`; | |
#set type | |
TYPE=`echo $FOLDERNAME | sed 's/local-entries/local-entry/g;s/proxy-services/proxy-service/g;s/sequences/sequence/g;s/endpoints/endpoint/g;'` | |
#out each artifact string | |
echo '<artifact name="'$FNAME'" groupId="com.example.'$ROOTFOLDER'" version="1.0.0" type="synapse/'$TYPE'" serverRole="EnterpriseServiceBus"> | |
<file>src/'$PATHTOXML'</file> | |
</artifact>' | |
done | |
#hmm seems really done | |
echo '</artifacts>'; | |
#now just copy-paste |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment