Skip to content

Commit

Permalink
Fix ant
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-bell committed Aug 7, 2024
1 parent 069f6c1 commit d7921ee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/experiments/get_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export expandedCP=$(join_by ":" $deps)


if [ -d "$2" ]; then rm -Rf $2; fi
export jacocoJars="$ROOT_DIR/examples/target/dependency/org.jacoco.report-0.8.10.jar:$ROOT_DIR/examples/target/dependency/org.jacoco.core-0.8.10.jar"
export jacocoJars="$ROOT_DIR/examples/target/dependency/org.jacoco.report-0.8.7.jar:$ROOT_DIR/examples/target/dependency/org.jacoco.core-0.8.7.jar"
export cmd="java -cp $JACOCO_UTIL_JAR:$jacocoJars -DJACOCO_SOURCES=$JACOCO_SOURCES fun.jvm.jacoco.reachability.entry.TolerantJacocoReportBuilder $1 $ROOT_DIR/examples/target/test-classes:$expandedCP $2 $3"

COVERAGE_JSON=`$cmd | tail -n 1`
Expand Down
17 changes: 17 additions & 0 deletions scripts/experiments/reproWithJacoco.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ if [ "$1" = "-i" ]; then
shift 1
fi

JACOCO_SOURCES=$ROOT_DIR/examples/target/dependency-sources
if [ ! -d $JACOCO_SOURCES ]; then
(cd $ROOT_DIR/examples && mvn -q dependency:unpack-dependencies -Dclassifier=sources -DincludeArtifactIds=maven-model,closure-compiler,rhino,ant,bcel -DoutputDirectory=target/dependency-sources)
fi

class="$1"
method="$2"
JACOCO_JAR=$ROOT_DIR/target/jacocoagent.jar
Expand All @@ -26,7 +31,19 @@ if [ ! -f $JACOCO_JAR ]; then
(cd $ROOT_DIR/target && unzip org.jacoco.agent-0.8.7.jar)
fi

if [ -f $ROOT_DIR/examples/target/dependency/org.jacoco.report-0.8.10.jar ]; then
rm $ROOT_DIR/examples/target/dependency/org.jacoco.report-0.8.10.jar
mvn -q dependency:get -Dartifact=org.jacoco:org.jacoco.report:0.8.7
mvn -q dependency:copy -Dartifact=org.jacoco:org.jacoco.report:0.8.7 -DoutputDirectory=$ROOT_DIR/examples/target/dependency/
fi
if [ -f $ROOT_DIR/examples/target/dependency/org.jacoco.core-0.8.10.jar ]; then
rm $ROOT_DIR/examples/target/dependency/org.jacoco.core-0.8.10.jar
mvn -q dependency:get -Dartifact=org.jacoco:org.jacoco.core:0.8.7
mvn -q dependency:copy -Dartifact=org.jacoco:org.jacoco.core:0.8.7 -DoutputDirectory=$ROOT_DIR/examples/target/dependency/
fi
echo $JACOCO_JAR
# Chocopy contains a copy of ant, so we need to exclude it when processing coverage for ant...
rm -f $ROOT_DIR/examples/target/dependency/chocopy*

export CLASSPATH="$ROOT_DIR/examples/target/classes/:$ROOT_DIR/examples/target/test-classes/:$ROOT_DIR/examples/target/dependency/*"
export JVM_OPTS="-javaagent:$JACOCO_JAR=destfile=$3,includes=$4"
Expand Down

0 comments on commit d7921ee

Please sign in to comment.