Fix the compareBuilds script (compares mvn vs ant generated jars) & add it to travis (before publishing snapshots). Comment out comparing the noaop builds since they're different right now, and update to asm 5.0.3 (which was a source of a difference).
diff --git a/.travis.yml b/.travis.yml
index b3f31dd..b9b79e0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,6 +29,7 @@
after_success:
- util/generate-latest-docs.sh
+ - util/compareBuilds.sh
- util/publish-snapshot-on-commit.sh
branches:
diff --git a/build.xml b/build.xml
index b101073..8386158 100644
--- a/build.xml
+++ b/build.xml
@@ -279,7 +279,7 @@
<arg value="-DNO_AOP" />
</munge>
<replace file="build/no_aop/common.xml" value="">
- <replacetoken><![CDATA[<zipfileset src="${common.basedir}/lib/build/asm-5.0.1.jar"/>]]></replacetoken>
+ <replacetoken><![CDATA[<zipfileset src="${common.basedir}/lib/build/asm-5.0.3.jar"/>]]></replacetoken>
</replace>
<replace file="build/no_aop/common.xml" value="">
<replacetoken><![CDATA[<zipfileset src="${common.basedir}/lib/build/cglib-3.1.jar"/>]]></replacetoken>
diff --git a/common.xml b/common.xml
index 6be7db6..a23eb90 100644
--- a/common.xml
+++ b/common.xml
@@ -145,7 +145,7 @@
<jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
<fileset dir="${build.dir}/classes"/>
<zipfileset src="${common.basedir}/lib/build/cglib-3.1.jar"/>
- <zipfileset src="${common.basedir}/lib/build/asm-5.0.1.jar"/>
+ <zipfileset src="${common.basedir}/lib/build/asm-5.0.3.jar"/>
<rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
<rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
<rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
diff --git a/core/pom.xml b/core/pom.xml
index 91dfe0a..33e6dcc 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -53,7 +53,7 @@
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
- <version>5.0.1</version>
+ <version>5.0.3</version>
<optional>true</optional>
</dependency>
<dependency>
diff --git a/lib/build/asm-5.0.1.jar b/lib/build/asm-5.0.1.jar
deleted file mode 100644
index 9f9be04..0000000
--- a/lib/build/asm-5.0.1.jar
+++ /dev/null
Binary files differ
diff --git a/lib/build/asm-5.0.3.jar b/lib/build/asm-5.0.3.jar
new file mode 100644
index 0000000..573535b
--- /dev/null
+++ b/lib/build/asm-5.0.3.jar
Binary files differ
diff --git a/util/compareBuilds.sh b/util/compareBuilds.sh
index 63af7d6..805e36d 100755
--- a/util/compareBuilds.sh
+++ b/util/compareBuilds.sh
@@ -1,29 +1,33 @@
#!/bin/bash
-# Compares the ant jars to the maven jars and makes sure they're the same
-# (or different where/how expected)
+## Compares the ant jars to the maven jars and makes sure they're the same
+## (or different where/how expected)
-# Build everything first.
+## Note: The no_aop build doesn't compare cleanly for some reason.
+## Maybe a difference between the ant & maven munge preprocessor?
+
+RETVAL=0
+
function cleanAndBuild {
- mvn clean
- ant clean.all
- ant no_aop
- ant dist test.dist
- mvn package
- cd build/no_aop
- ant dist test.dist
- cd ../..
+ mvn clean > /dev/null
+ ant clean.all > /dev/null
+ #ant no_aop > /dev/null
+ ant dist > /dev/null
+ mvn package -DskipTests=true -Dmaven.javadoc.skip=true > /dev/null
+ ant -f build/no_aop/build.xml dist > /dev/null
}
function findAndCompareJars {
- version=3.0
+ version=4.0
for ANT in `find ./build/dist/* -name "*-snapshot.jar" `
do
- if [ $ANT = "./build/dist/guice-snapshot.jar" ]; then #Check main build
+ if [ $ANT = "./build/dist/guice-snapshot.jar" ]; then
+ ## Check the main build.
MVN=./core/target/guice-$version-SNAPSHOT.jar
extension=core
compareJars "$ANT" "$MVN" $extension
- compareJars "./build/no_aop/$ANT" "./core/target/guice-$version-SNAPSHOT-no_aop.jar" "no_aop: $extension" #also compare no_aop core
- else # Check extensions
+ #compareJars "./build/no_aop/$ANT" "./core/target/guice-$version-SNAPSHOT-no_aop.jar" "no_aop: $extension"
+ else
+ ## Check extensions.
extension=`echo $ANT | awk -F"-" '{print $2 }'`
MVN=./extensions/$extension/target/guice-$extension-$version-SNAPSHOT.jar
compareJars "$ANT" "$MVN" $extension
@@ -36,12 +40,13 @@
ANT=$1
MVN=$2
extension=$3
+ curdir=`pwd`
echo Comparing $3
- mkdir tmp$$
+ mkdir "tmp$$"
cp $ANT tmp$$/ant.jar
cp $MVN tmp$$/mvn.jar
- cd tmp$$
+ cd "tmp$$"
mkdir ant
mkdir mvn
cd ant
@@ -51,24 +56,50 @@
jar -xf ../mvn.jar
cd ..
- # ant puts LICENSE & NOTICE files in a different place
+ ## ant puts LICENSE & NOTICE files in a different place
echo LICENSE > excludes
echo NOTICE >> excludes
- # ant does not create DEPENDENCIES
+ ## ant does not create DEPENDENCIES
echo DEPENDENCIES >> excludes
- # ant/mvn slightly different in MANIFEST.MF
+ ## ant/mvn slightly different in MANIFEST.MF
echo MANIFEST.MF >> excludes
- # ant leaves empty directories for some jarjar'd paths --
- # we grep -v instead of exclude because we want to make sure
- # if any files in those directories exist, that they're diff'd
- diff -u --recursive -Xexcludes ant mvn | grep -v "Only in ant/com/google/inject/internal/asm: signature" | grep -v "Only in ant/com/google/inject/internal/cglib: beans" | grep -v "Only in ant/com/google/inject/internal/cglib: transform" | grep -v "Only in ant/com/google/inject/internal/cglib: util"
- cd ..
+
+ ## ant leaves empty directories for some jarjar'd paths --
+ ## we grep -v instead of exclude because we want to make sure
+ ## if any files in those directories exist, that they're diff'd.
+ ## ant 1.8+ also creates package-info classes all the time, and
+ ## maven doesn't -- so we just ignore the package-info classes.
+ diff -u --recursive -Xexcludes ant mvn | \
+ grep -v "^Only in ant/com/google/inject/internal/asm: signature$" | \
+ grep -v "^Only in ant/com/google/inject/internal/cglib: beans$" | \
+ grep -v "^Only in ant/com/google/inject/internal/cglib: transform$" | \
+ grep -v "^Only in ant/com/google/inject/internal/cglib/transform: impl$" | \
+ grep -v "^Only in ant/com/google/inject/internal/cglib: util$" | \
+ grep -v "^Only in ant: net$" | \
+ grep -v "^Only in ant: org$" | \
+ grep -v "^Only in ant/com/google/inject/.*: package-info\.class$"
+ # failure is 0 because we're using grep -v to filter things out
+ if [ $? -eq 0 ]; then
+ export RETVAL=1
+ fi
+ cd "$curdir"
rm -rf "tmp$$"
}
-cleanAndBuild
-echo "Starting to compare jars... Check the output closely!"
-echo
-findAndCompareJars
-echo
-echo "If the only thing that printed out is 'Comparing <thing>', then you're good!"
+## Only bother doing this on the jdk8/mvn build (before we publish snapshots).
+## Otherwise it's a waste of time building mvn+ant each time.
+if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && \
+ [ "$LABEL" == "mvn" ]; then
+ echo "Cleaning and building ant & maven..."
+ cleanAndBuild
+ echo "Starting to compare jars..."
+ echo
+ findAndCompareJars
+ if [ $RETVAL -eq 0 ]; then
+ echo "Everything looks good!"
+ exit 0
+ else
+ echo "Some things don't match -- see above for details."
+ exit 1
+ fi
+fi