Skip to content

Commit

Permalink
update README so it's more closely parallel w/ the JBoss Central vers…
Browse files Browse the repository at this point in the history
…ion; add step4 for producing a p2diff report; if install fails, break
  • Loading branch information
nickboldt committed May 26, 2014
1 parent 19d30a1 commit 7f9d572
Showing 1 changed file with 43 additions and 16 deletions.
59 changes: 43 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and then clone your fork:
$ git clone git@github.com:<you>/jbosstools-target-platforms.git
$ cd jbosstools-build
$ git remote add upstream git://github.com/jbosstools/jbosstools-target-platforms.git
At any time, you can pull changes from the upstream and merge them onto your 4.40.x branch:

$ git checkout 4.40.x # switches to the '4.40.x' branch
Expand All @@ -27,10 +27,10 @@ The general idea is to keep your '4.40.x' branch in-sync with the
'upstream/4.40.x'.


## Building JBoss Tools Target Platforms
## Building Target Platforms

To build _JBoss Tools Target Platforms_ requires specific versions of Java and
Maven. Also, there is some Maven setup. The [How to Build JBoss Tools with Maven 3](https://community.jboss.org/wiki/HowToBuildJBossToolsWithMaven3)
To build, you require specific versions of Java and Maven. Also, there is some Maven setup.
The [How to Build JBoss Tools with Maven 3](https://community.jboss.org/wiki/HowToBuildJBossToolsWithMaven3)
document will guide you through that setup.

This command will run the build, but will NOT download the contents of the target platform to disk:
Expand Down Expand Up @@ -68,20 +68,38 @@ When moving from one version of the target to another, the steps are:

<pre>

# keep these in sync + up to date:
# https://github.com/jbosstools/jbosstools-discovery/tree/master/jbtcentraltarget#updating-versions-of-ius-in-target-files
# https://github.com/jbosstools/jbosstools-target-platforms/tree/master/#updating-versions-of-ius-in-target-files
# https://github.com/jbosstools/jbosstools-target-platforms/tree/4.40.x/#updating-versions-of-ius-in-target-files

# point BASEDIR to where you have these sources checked out
BASEDIR=$HOME/jbosstools-target-platforms; # or, just do this:
BASEDIR=`pwd`

# set path to where you have the latest compatible Eclipse bundle stored locally
ECLIPSEZIP=${HOME}/tmp/Eclipse_Bundles/eclipse-jee-luna-M7-linux-gtk-x86_64.tar.gz

for PROJECT in jbosstools jbdevstudio; do
# set path to where you have the latest p2diff executable installed
P2DIFF=${HOME}/tmp/p2diff/p2diff

NOW=`date +%F_%H-%M`

for PROJECT in jbosstools jbdevstudio; do
if [[ -d ${BASEDIR}/${PROJECT} ]]; then WORKSPACE=${BASEDIR}/${PROJECT}; else WORKSPACE=${BASEDIR}; fi

# Step 0: move the existing target platform folder to a new path, so that it can be p2diff'd against the one you're about to build
# TODO: remember to clean these out
if [[ -d ${WORKSPACE}/multiple/target/${PROJECT}-multiple.target.repo/ ]]; then
mv ${WORKSPACE}/multiple/target/${PROJECT}-multiple.target.repo/ /tmp/${PROJECT}-multiple.target.repo_${NOW}
fi

# Step 1: Merge changes in new target file to actual target file
pushd ${BASEDIR}/${PROJECT}/multiple && mvn -U org.jboss.tools.tycho-plugins:target-platform-utils:0.19.0-SNAPSHOT:fix-versions -DtargetFile=${PROJECT}-multiple.target && rm -f ${PROJECT}-multiple.target ${PROJECT}-multiple.target_update_hints.txt && mv -f ${PROJECT}-multiple.target_fixedVersion.target ${PROJECT}-multiple.target && popd
pushd ${WORKSPACE}/multiple && mvn -U org.jboss.tools.tycho-plugins:target-platform-utils:0.19.0-SNAPSHOT:fix-versions -DtargetFile=${PROJECT}-multiple.target && rm -f ${PROJECT}-multiple.target ${PROJECT}-multiple.target_update_hints.txt && mv -f ${PROJECT}-multiple.target_fixedVersion.target ${PROJECT}-multiple.target && popd

# Step 2: Resolve the new 'multiple' target platform and verify it is self-contained by building the 'unified' target platform too
# TODO: if you removed IUs, be sure to do a `mvn clean install`, rather than just a `mvn install`; process will be much longer but will guarantee metadata is correct
pushd ${BASEDIR}/${PROJECT} && mvn install -Pmultiple2repo -DtargetRepositoryUrl=file://${BASEDIR}/${PROJECT}/multiple/target/${PROJECT}-multiple.target.repo/ -Dmirror-target-to-repo.includeSources=true && popd
pushd ${WORKSPACE} && mvn install -Pmultiple2repo -DtargetRepositoryUrl=file://${WORKSPACE}/multiple/target/${PROJECT}-multiple.target.repo/ -Dmirror-target-to-repo.includeSources=true && popd

# Step 3: Install the new target platform into a clean Eclipse JEE bundle to verify if everything can be installed
INSTALLDIR=/tmp/${PROJECT}target-install-test
Expand All @@ -90,9 +108,18 @@ When moving from one version of the target to another, the steps are:
pushd ${INSTALLDIR}
echo "Unpack ${ECLIPSEZIP} into ${INSTALLDIR} ..." && tar xzf ${ECLIPSEZIP}
echo "Fetch install script to ${INSTALLSCRIPT} ..." && wget -q --no-check-certificate -N https://raw.githubusercontent.com/jbosstools/jbosstools-build-ci/master/util/installFromTarget.sh -O ${INSTALLSCRIPT} && chmod +x ${INSTALLSCRIPT}
echo "Install..." && ${INSTALLSCRIPT} -ECLIPSE ${INSTALLDIR}/eclipse -INSTALL_PLAN file://${BASEDIR}/${PROJECT}/multiple/target/${PROJECT}-multiple.target.repo/ \
| tee /tmp/log.txt; cat /tmp/log.txt | egrep -i -A2 "could not be found|FAILED|Missing|Only one of the following|being installed|Cannot satisfy dependency"
echo "Install..."
if [[ ${UPSTREAM_SITE} ]]; then
${INSTALLSCRIPT} -ECLIPSE ${INSTALLDIR}/eclipse -INSTALL_PLAN ${UPSTREAM_SITE},file://${WORKSPACE}/multiple/target/${PROJECT}-multiple.target.repo/ | tee ${INSTALLSCRIPT}_log_${PROJECT}_${NOW}.txt;
else
${INSTALLSCRIPT} -ECLIPSE ${INSTALLDIR}/eclipse -INSTALL_PLAN file://${WORKSPACE}/multiple/target/${PROJECT}-multiple.target.repo/ | tee ${INSTALLSCRIPT}_log_${PROJECT}_${NOW}.txt;
fi
cat ${INSTALLSCRIPT}_log_${PROJECT}_${NOW}.txt | egrep -i -A2 "IllegalArgumentException|Could not resolve|error|Unresolved requirement|could not be found|FAILED|Missing|Only one of the following|being installed|Cannot satisfy dependency"; if [[ "$?" == "0" ]]; then break; fi
popd

# Step 4: produce p2diff report
${P2DIFF} /tmp/${PROJECT}-multiple.target.repo_${NOW} file://${WORKSPACE}/multiple/target/${PROJECT}-multiple.target.repo/ | tee /tmp/p2diff_log_${PROJECT}_${NOW}.txt

done

</pre>
Expand All @@ -114,25 +141,25 @@ describing the bug or new feature and give it a component type of
topic branch named with the JIRA issue number. For example, this
command creates a branch for the JBIDE-1234 issue:

$ git checkout -b jbide-1234
$ git checkout -b jbide-1234

After you're happy with your changes and a full build (with unit
tests) runs successfully, commit your changes on your topic branch
(with good comments). Then it's time to check for any recent changes
that were made in the official repository:

$ git checkout 4.40.x # switches to the '4.40.x' branch
$ git pull upstream 4.40.x # fetches all 'upstream' changes and merges 'upstream/4.40.x' onto your '4.40.x' branch
$ git checkout jbide-1234 # switches to your topic branch
$ git rebase 4.40.x # reapplies your changes on top of the latest in 4.40.x
(i.e., the latest from 4.40.x will be the new base for your changes)
$ git checkout 4.40.x # switches to the '4.40.x' branch
$ git pull upstream 4.40.x # fetches all 'upstream' changes and merges 'upstream/4.40.x' onto your '4.40.x' branch
$ git checkout jbide-1234 # switches to your topic branch
$ git rebase 4.40.x # reapplies your changes on top of the latest in 4.40.x
(i.e., the latest from 4.40.x will be the new base for your changes)

If the pull grabbed a lot of changes, you should rerun your build with
tests enabled to make sure your changes are still good.

You can then push your topic branch and its changes into your public fork repository:

$ git push origin jbide-1234 # pushes your topic branch into your public fork of JBoss Tools Target Platforms
$ git push origin jbide-1234 # pushes your topic branch into your public fork of JBoss Tools Target Platforms

And then [generate a pull-request](http://help.github.com/pull-requests/) where we can
review the proposed changes, comment on them, discuss them with you,
Expand Down

0 comments on commit 7f9d572

Please sign in to comment.