summaryrefslogtreecommitdiffstats
path: root/prepAllTestBundles.sh
diff options
context:
space:
mode:
authorRoland Grunberg <rgrunber@redhat.com>2013-08-30 13:58:53 -0400
committerRoland Grunberg <rgrunber@redhat.com>2013-08-30 14:05:27 -0400
commit7ba86fd9b032d21a931f0dc4fad2d6a8f6bd88e8 (patch)
tree1d73891304f32c97944fbab3671a6a154afda168 /prepAllTestBundles.sh
parent7250bc91fc0c37035e720042246df94303a65e76 (diff)
downloadtestbundle-to-eclipse-test-7ba86fd9b032d21a931f0dc4fad2d6a8f6bd88e8.tar.gz
testbundle-to-eclipse-test-7ba86fd9b032d21a931f0dc4fad2d6a8f6bd88e8.tar.xz
testbundle-to-eclipse-test-7ba86fd9b032d21a931f0dc4fad2d6a8f6bd88e8.zip
Install extra IUs in tycho-surefire-plugin's dependency configuration.
Any IUs found in tycho-surefire-plugin's dependency configuration may be needed for testing purposes. Ideally these should be installed only for the test bundle that requires them but doing so would be more complicated. We install the IUs for all test bundles.
Diffstat (limited to 'prepAllTestBundles.sh')
-rwxr-xr-xprepAllTestBundles.sh43
1 files changed, 36 insertions, 7 deletions
diff --git a/prepAllTestBundles.sh b/prepAllTestBundles.sh
index 136ffc0..8ca7559 100755
--- a/prepAllTestBundles.sh
+++ b/prepAllTestBundles.sh
@@ -22,6 +22,8 @@ fi
testBundleFolder=$1
echo 'Eclipse-BundleShape: dir' > MANIFEST.MF
+extraIUs=
+
for jar in `find ${testBundleFolder} -name "*.jar"`; do
jarPomPath=`jar -tf ${jar} | grep 'pom.xml'`
unzip -p ${jar} ${jarPomPath} | grep -q '<packaging>eclipse-test-plugin</packaging>'
@@ -57,17 +59,44 @@ for jar in `find ${testBundleFolder} -name "*.jar"`; do
<runTests testPlugin=\"${bsname}\" testClass=\"${testclass}\" />" \
target/test.xml
done
+
+ # Collect any extra IUs from each test bundle's tycho-surefire-plugin
+ unzip -p ${jar} ${jarPomPath} | grep -q '<artifactId>tycho-surefire-plugin<\/artifactId>'
+ if [ $? -eq 0 ]; then
+ IUList=`unzip -p ${jar} ${jarPomPath} | sed -n '/<dependency>/,/<\/dependency>/ p' | grep -B 1 '<artifactId>'`
+ isFeature=0
+ for elem in ${IUList}; do
+ echo ${elem} | grep -q '<type>eclipse-feature<\/type>'
+ if [ $? -eq 0 ]; then
+ isFeature=1
+ fi
+ echo ${elem} | grep -q '<artifactId>'
+ if [ $? -eq 0 ]; then
+ extraIU=`echo ${elem} | sed 's/.*<artifactId>\(.*\)<\/artifactId>.*/\1/'`
+ if [ ${isFeature} -eq 1 ]; then
+ extraIU=${extraIU}'.feature.group'
+ fi
+ extraIUs="${extraIUs} ${extraIU}"
+ isFeature=0
+ fi
+ done
+ fi
- fi
+ # Make 'Eclipse-BundleShape: dir'
+ jarName=`basename ${jar}`
+ symJarName=`ls target-sdk/plugins/ | grep ${jarName}`
+ rm target-sdk/plugins/${symJarName}
+ cp ${jar} target-sdk/plugins/
+ jar -umf ./MANIFEST.MF target-sdk/plugins/${jarName}
- # Make 'Eclipse-BundleShape: dir'
- jarName=`basename ${jar}`
- symJarName=`ls target-sdk/plugins/ | grep ${jarName}`
- rm target-sdk/plugins/${symJarName}
- cp ${jar} target-sdk/plugins/
- jar -umf ./MANIFEST.MF target-sdk/plugins/${jarName}
+ fi
done
+# Always install the extra IUs
+# Not by choice but because this is easier to do
+extraIUs=`echo -n ${extraIUs} | tr ' ' '\n' | sort | uniq | tr '\n' ','`
+sed -i "s/\"-installIUs \(.*\)\"/\"-installIUs \1,${extraIUs}\"/" target/test.xml
+
rm ./MANIFEST.MF
pushd target
../genRepo.sh $(pwd)