Opened 9 months ago

Closed 8 months ago

#31649 closed task (fixed)

Add ant task in metrics-base to fetch metrics-lib/exonerator from dist

Reported by: irl Owned by: karsten
Priority: Very Low Milestone:
Component: Metrics Version:
Severity: Normal Keywords:
Cc: metrics-team Actual Points:
Parent ID: Points:
Reviewer: irl Sponsor:


We could use this in GitLab CI instead of having to update the CI configuration every time we switch version of metrics-lib/exonerator.

Child Tickets

Change History (5)

comment:1 Changed 9 months ago by karsten

I wonder if there are situations where we want to upgrade the metrics-lib version in some of our code bases but not all of them. In that case, having the version in metrics-base might cause problems.

Note that we'll have to update versions in the respective build.xml files anyway. Should be fine to do it in the GitLab CI file, too. What do you think?

comment:2 Changed 9 months ago by karsten

Cc: metrics-team added
Owner: changed from metrics-team to karsten
Status: newaccepted

Ah, never mind my comment above. We can of course download whichever metrics-lib version is written in build.xml. Accepting this ticket and doing some Ant hacking now...

comment:3 Changed 8 months ago by karsten

Reviewer: irl
Status: acceptedneeds_review

Please review this metrics-base commit:

commit 07c2a00c27f0d536223f8b5a61fc91e60eb524d4 (HEAD -> task-31649)
Author: Karsten Loesing <>
Date:   Mon Sep 23 15:27:32 2019 +0200

    Add ant task to fetch metrics-lib from dist.
    Implements part of #31649.

diff --git a/java/base.xml b/java/base.xml
index 8342e91..4ce1660 100644
--- a/java/base.xml
+++ b/java/base.xml
@@ -28,6 +28,7 @@
   <property name="emptymanifest" value="${generated}/emptymanifest" />
   <property name="javadocstyle" value="${basedir}/src/build/java/stylesheet.css" />
   <property name="javadocicon" value="${basedir}/src/build/java/tor-onion.png" />
+  <property name="downloadedlibs" value="${generated}/downloaded-libs" />
   <!-- generic path definitions -->
   <path id="classpath">
@@ -99,6 +100,7 @@
     <mkdir dir="${docs}"/>
     <mkdir dir="${testresult}"/>
     <mkdir dir="${dist}"/>
+    <mkdir dir="${libs}"/>
     <manifest file="${emptymanifest}" />
@@ -109,6 +111,20 @@
     <ivy:report todir="${generated}/ivy" />
+  <target name="fetch-metrics-lib" depends="init"
+          description="Fetch metrics-lib from">
+    <mkdir dir="${downloadedlibs}"/>
+    <get src="${metricslibversion}/metrics-lib-${metricslibversion}.tar.gz"
+         dest="${downloadedlibs}"/>
+    <untar src="${downloadedlibs}/metrics-lib-${metricslibversion}.tar.gz"
+           dest="${libs}" compression="gzip">
+      <patternset>
+        <include name="**/metrics-lib-${metricslibversion}-thin.jar"/>
+      </patternset>
+      <mapper type="flatten"/>
+    </untar>
+  </target>
   <target name="compile"
     <javac destdir="${classes}"

(Turns out that I don't have a user metrics-base repository. Filed a ticket to fix that, but this comment shouldn't be blocking on that.)

And please also review metrics-web commit 85bbd48.

comment:4 Changed 8 months ago by irl

Status: needs_reviewmerge_ready

Both metrics-base and metrics-web patches look good to me.

comment:5 Changed 8 months ago by karsten

Resolution: fixed
Status: merge_readyclosed

Great! Thanks for checking! Merged to all repositories. Closing.

Note: See TracTickets for help on using tickets.