Skip to content

Instantly share code, notes, and snippets.

@robstryker
Created July 21, 2017 19:59
Show Gist options
  • Save robstryker/413a256fd46993fc8da0768c830bc82a to your computer and use it in GitHub Desktop.
Save robstryker/413a256fd46993fc8da0768c830bc82a to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# move org.eclipse.jst.common.ui plugin into javaee
START_TIME=`date +%s`
# in case we have another alias for mv, like 'mv -i'
alias mv=mv
# set our local pull command depending on git version
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}
GIT_VERSION=`git version | head -1 | cut -f 3 -d " "`
verlte $GIT_VERSION 2.9.0 && ALLOW_PULL_FLAG=false || ALLOW_PULL_FLAG=true
if $ALLOW_PULL_FLAG
then
LOCAL_PULL_CMD="git pull --no-edit --allow-unrelated-histories"
else
LOCAL_PULL_CMD="git pull --no-edit "
fi
# handle changes to parent pom
git clone http://git.eclipse.org/gitroot/webtools/webtools.releng.aggregator.git
cd webtools.releng.aggregator
git fetch https://git.eclipse.org/r/webtools/webtools.releng.aggregator refs/changes/73/100873/1 && git checkout FETCH_HEAD
cd wtp-parent
mvn clean install
cd ../../
git clone http://git.eclipse.org/gitroot/jeetools/webtools.javaee.git
git clone http://git.eclipse.org/gitroot/jeetools/webtools.javaee.tests.git
git clone http://git.eclipse.org/gitroot/jeetools/webtools.ejb.git
cd webtools.javaee.tests
sed -i 's/<artifactId>org.eclipse.webtools.javaee.tests<\/artifactId>/<artifactId>org.eclipse.webtools.javaee<\/artifactId>/g' */*/pom.xml
git workprofile
git commit -a -m "[480383] prepare jee tests for merging" --signoff
cd ../
cd webtools.ejb
sed -i 's/<groupId>org.eclipse.webtools.ejb<\/groupId>/<groupId>org.eclipse.webtools.javaee<\/groupId>/g' */*/pom.xml
sed -i 's/<artifactId>org.eclipse.webtools.ejb<\/artifactId>/<artifactId>org.eclipse.webtools.javaee<\/artifactId>/g' */*/pom.xml
git workprofile
git commit -a -m "[480383] prepare ejb for merging" --signoff
cd ../
cd webtools.javaee
cp .project ../
git workprofile # comment this out if it doesn't make sense for you
$LOCAL_PULL_CMD ../webtools.javaee.tests
cp ../.project .project
echo "#maven
target/
bin/" > .gitignore
wget http://termbin.com/mwfw
mv mwfw pom.xml
git add .project
git add .gitignore
git add pom.xml
git commit -a -m "[480383] merge jee tests into jee repo" --signoff
$LOCAL_PULL_CMD ../webtools.ejb
echo "# maven
target/
bin/
# Compiled Java Files #
*.class
# Package Files #
*.jar
*.war
*.ear" > .gitignore
wget http://termbin.com/9jy3
mv 9jy3 pom.xml
git commit -a -m "[480383] merge ejb repo into jee repo" --signoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment