Skip to content

Commit 22d97e5

Browse files
committed
Use the version in pom.xml as the single source of truth
1 parent 58592f8 commit 22d97e5

9 files changed

Lines changed: 18 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Next, build DiffDetective and install it on your system so that you can access i
4444
mvn install
4545
```
4646

47-
To add DiffDetective as a dependency to your own project, add the following snippet to the pom.xml of your Maven project, but make sure to pick the right version number. You can find the version number of DiffDetective at the top of the pom.xml file of DiffDetective.
47+
To add DiffDetective as a dependency to your own project, add the following snippet to the pom.xml of your Maven project, but make sure to pick the right version number. The current version number can be obtained by running `scripts/version.sh`
4848

4949
```xml
5050
<dependency>

default.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
}:
1313
pkgs.stdenvNoCC.mkDerivation rec {
1414
pname = "DiffDetective";
15-
version = "2.2.0";
15+
# The single source of truth for the version number is stored in `pom.xml`.
16+
# Hence, this XML file needs to be parsed to extract the current version.
17+
version = pkgs.lib.removeSuffix "\n" (pkgs.lib.readFile
18+
(pkgs.runCommandLocal "DiffDetective-version" {}
19+
"${pkgs.xq-xml}/bin/xq -x '/project/version' ${./pom.xml} > $out"));
1620
src = with pkgs.lib.fileset;
1721
toSource {
1822
root = ./.;

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<groupId>org.variantsync</groupId>
88
<artifactId>diffdetective</artifactId>
9+
<!-- The DiffDetective version, needs to be the first version tag in this file. -->
910
<version>2.2.0</version>
1011

1112
<properties>

replication/esecfse22/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ WORKDIR /home/sherlock
3232
# Copy the compiled JAR file from the first stage into the second stage
3333
# Syntax: COPY --from=STAGE_ID SOURCE_PATH TARGET_PATH
3434
WORKDIR /home/sherlock/holmes
35-
COPY --from=0 /home/user/target/diffdetective-2.2.0-jar-with-dependencies.jar ./DiffDetective.jar
35+
COPY --from=0 /home/user/target/diffdetective-*-jar-with-dependencies.jar ./DiffDetective.jar
3636
WORKDIR /home/sherlock
3737
RUN mkdir results
3838

replication/splc23-views/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ WORKDIR /home/sherlock
3838
# Copy the compiled JAR file from the first stage into the second stage
3939
# Syntax: COPY --from=STAGE_ID SOURCE_PATH TARGET_PATH
4040
WORKDIR /home/sherlock/holmes
41-
COPY --from=0 /home/user/target/diffdetective-2.2.0-jar-with-dependencies.jar ./DiffDetective.jar
41+
COPY --from=0 /home/user/target/diffdetective-*-jar-with-dependencies.jar ./DiffDetective.jar
4242
WORKDIR /home/sherlock
4343

4444
# Copy the setup

scripts/genUltimateResults.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
resultsdir=$1
22

3-
java -cp "target/diffdetective-2.2.0-jar-with-dependencies.jar" org.variantsync.diffdetective.tablegen.MiningResultAccumulator $resultsdir $resultsdir
3+
java -cp "target/diffdetective-$(./scripts/version.sh)-jar-with-dependencies.jar" org.variantsync.diffdetective.tablegen.MiningResultAccumulator $resultsdir $resultsdir
44
echo "genUltimateResults.sh DONE"

scripts/runValidation.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
java -cp "target/diffdetective-2.2.0-jar-with-dependencies.jar" org.variantsync.diffdetective.validation.EditClassValidation
1+
java -cp "target/diffdetective-$(./scripts/version.sh)-jar-with-dependencies.jar" org.variantsync.diffdetective.validation.EditClassValidation
22
echo "runValidation.sh DONE"

scripts/runViewFeasibilityStudy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
java -cp "target/diffdetective-2.2.0-jar-with-dependencies.jar" org.variantsync.diffdetective.experiments.views.Main "docs/datasets/views.md"
1+
java -cp "target/diffdetective-$(./scripts/version.sh)-jar-with-dependencies.jar" org.variantsync.diffdetective.experiments.views.Main "docs/datasets/views.md"
22
echo "runValidation.sh DONE"

scripts/version.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
cd "$(dirname "${BASH_SOURCE[0]}")/.."
4+
5+
# extracts the first version tag in pom.xml
6+
sed -n '/<version/ {s/.*version>\(.*\)<\/version.*/\1/; p; q}' pom.xml

0 commit comments

Comments
 (0)