diff --git a/README.md b/README.md index 2b0fd7da1..3ce8d2d24 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Next, build DiffDetective and install it on your system so that you can access i mvn install ``` -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. +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` ```xml diff --git a/default.nix b/default.nix index e6d9dd4fb..9e91d29bf 100644 --- a/default.nix +++ b/default.nix @@ -10,9 +10,13 @@ doCheck ? true, buildGitHubPages ? true, }: -pkgs.stdenv.mkDerivation rec { +pkgs.stdenvNoCC.mkDerivation rec { pname = "DiffDetective"; - version = "2.2.0"; + # The single source of truth for the version number is stored in `pom.xml`. + # Hence, this XML file needs to be parsed to extract the current version. + version = pkgs.lib.removeSuffix "\n" (pkgs.lib.readFile + (pkgs.runCommandLocal "DiffDetective-version" {} + "${pkgs.xq-xml}/bin/xq -x '/project/version' ${./pom.xml} > $out")); src = with pkgs.lib.fileset; toSource { root = ./.; diff --git a/pom.xml b/pom.xml index c2570176e..5628799b7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,6 +6,7 @@ org.variantsync diffdetective + 2.2.0 diff --git a/replication/esecfse22/Dockerfile b/replication/esecfse22/Dockerfile index 61b12a77a..50dc493b7 100644 --- a/replication/esecfse22/Dockerfile +++ b/replication/esecfse22/Dockerfile @@ -32,7 +32,7 @@ WORKDIR /home/sherlock # Copy the compiled JAR file from the first stage into the second stage # Syntax: COPY --from=STAGE_ID SOURCE_PATH TARGET_PATH WORKDIR /home/sherlock/holmes -COPY --from=0 /home/user/target/diffdetective-2.2.0-jar-with-dependencies.jar ./DiffDetective.jar +COPY --from=0 /home/user/target/diffdetective-*-jar-with-dependencies.jar ./DiffDetective.jar WORKDIR /home/sherlock RUN mkdir results diff --git a/replication/splc23-views/Dockerfile b/replication/splc23-views/Dockerfile index 5bdaa2317..dbb1a24b3 100644 --- a/replication/splc23-views/Dockerfile +++ b/replication/splc23-views/Dockerfile @@ -38,7 +38,7 @@ WORKDIR /home/sherlock # Copy the compiled JAR file from the first stage into the second stage # Syntax: COPY --from=STAGE_ID SOURCE_PATH TARGET_PATH WORKDIR /home/sherlock/holmes -COPY --from=0 /home/user/target/diffdetective-2.2.0-jar-with-dependencies.jar ./DiffDetective.jar +COPY --from=0 /home/user/target/diffdetective-*-jar-with-dependencies.jar ./DiffDetective.jar WORKDIR /home/sherlock # Copy the setup diff --git a/scripts/genUltimateResults.sh b/scripts/genUltimateResults.sh index 35fd6d7c2..a748d0e49 100755 --- a/scripts/genUltimateResults.sh +++ b/scripts/genUltimateResults.sh @@ -1,4 +1,8 @@ -resultsdir=$1 +#!/usr/bin/env bash -java -cp "target/diffdetective-2.2.0-jar-with-dependencies.jar" org.variantsync.diffdetective.tablegen.MiningResultAccumulator $resultsdir $resultsdir +resultsdir="$1" + +cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1 + +java -cp "target/diffdetective-$(./scripts/version.sh)-jar-with-dependencies.jar" org.variantsync.diffdetective.tablegen.MiningResultAccumulator "$resultsdir" "$resultsdir" && echo "genUltimateResults.sh DONE" diff --git a/scripts/runValidation.sh b/scripts/runValidation.sh index db1638d60..cebd8fcd8 100755 --- a/scripts/runValidation.sh +++ b/scripts/runValidation.sh @@ -1,2 +1,6 @@ -java -cp "target/diffdetective-2.2.0-jar-with-dependencies.jar" org.variantsync.diffdetective.validation.EditClassValidation +#!/usr/bin/env bash + +cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1 + +java -cp "target/diffdetective-$(./scripts/version.sh)-jar-with-dependencies.jar" org.variantsync.diffdetective.validation.EditClassValidation && echo "runValidation.sh DONE" diff --git a/scripts/runViewFeasibilityStudy.sh b/scripts/runViewFeasibilityStudy.sh index 3ff5993c5..5f2f94d37 100755 --- a/scripts/runViewFeasibilityStudy.sh +++ b/scripts/runViewFeasibilityStudy.sh @@ -1,2 +1,6 @@ -java -cp "target/diffdetective-2.2.0-jar-with-dependencies.jar" org.variantsync.diffdetective.experiments.views.Main "docs/datasets/views.md" +#!/usr/bin/env bash + +cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1 + +java -cp "target/diffdetective-$(./scripts/version.sh)-jar-with-dependencies.jar" org.variantsync.diffdetective.experiments.views.Main "docs/datasets/views.md" && echo "runValidation.sh DONE" diff --git a/scripts/version.sh b/scripts/version.sh new file mode 100755 index 000000000..94c51d77a --- /dev/null +++ b/scripts/version.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +# extracts the first version tag in pom.xml +sed -n '/\(.*\)<\/version.*/\1/; p; q}' pom.xml