Skip to content

Commit

Permalink
chore: Set version to 0.1.0-SNAPSHOT (#472)
Browse files Browse the repository at this point in the history
* Set version to 0.1-SNAPSHOT

* Discover Sorald jarfile instead of hardcoding version

* Use updated Sorald JAR path in warnings_extractor.py

* Use wildcard in Sorald jar path

* Try setting jar path in script

* Set version to 0.1.0

* Try to force shell expansion with echo
  • Loading branch information
slarse authored Apr 12, 2021
1 parent 0f30533 commit 7a28338
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
- name: Run tests
run: mvn test
- name: Sanity check jarfile
env:
SORALD_JAR_PATH: "target/sorald-1.1-SNAPSHOT-jar-with-dependencies.jar"
shell: bash
run: |
SORALD_JAR_PATH=$(echo target/sorald-*-SNAPSHOT-jar-with-dependencies.jar)
java -jar "$SORALD_JAR_PATH" repair --source src/test/resources/ArrayHashCodeAndToString.java --rule-key 2184
java -jar "$SORALD_JAR_PATH" repair --source src/test/resources/ArrayHashCodeAndToString.java --rule-key 2116
- name: Upload coverage report to Codecov
Expand Down
23 changes: 18 additions & 5 deletions experimentation/tools/sorald/_helpers/soraldwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@
from typing import List, Optional, Tuple


DEFAULT_SORALD_JAR_PATH = (
pathlib.Path(__file__).absolute().parent.parent.parent.parent.parent
/ "target"
/ "sorald-1.1-SNAPSHOT-jar-with-dependencies.jar"
).resolve(strict=False)
def _find_default_sorald_jar() -> pathlib.Path:
target_dir = (
pathlib.Path(__file__).absolute().parent.parent.parent.parent.parent / "target"
)
sorald_jar_matches = list(
target_dir.glob("sorald-*-SNAPSHOT-jar-with-dependencies.jar")
)

if len(sorald_jar_matches) != 1:
raise RuntimeError(
f"expected precisely one Sorald jar in the target directory, "
f"but found: {sorald_jar_matches}"
)

return sorald_jar_matches[0].resolve(strict=True)


DEFAULT_SORALD_JAR_PATH = _find_default_sorald_jar()


def sorald(
Expand Down
9 changes: 2 additions & 7 deletions experimentation/tools/sorald/warnings_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@

from typing import Tuple, List, Mapping, Iterable, Optional


SORALD_JAR_PATH = (
pathlib.Path(__file__).absolute().parent.parent.parent.parent
/ "target"
/ "sorald-1.1-SNAPSHOT-jar-with-dependencies.jar"
).resolve(strict=False)
from sorald._helpers import soraldwrapper

WARNING_STATS_OUTPUT_DIR = (
pathlib.Path(__file__).parent / "warning_stats_output"
Expand Down Expand Up @@ -116,7 +111,7 @@ def parse_args(args: List[str]) -> argparse.Namespace:
"--sorald-jar",
help="path to the Sorald jarfile with dependencies",
type=pathlib.Path,
default=SORALD_JAR_PATH,
default=soraldwrapper.DEFAULT_SORALD_JAR_PATH,
)
parser.add_argument(
"--num-cpus",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>se.kth.castor</groupId>
<artifactId>sorald</artifactId>
<version>1.1-SNAPSHOT</version>
<version>0.1.0-SNAPSHOT</version>

<name>Sorald</name>
<description>An automatic repair system for static code analysis warnings from Sonar Java.</description>
Expand Down

0 comments on commit 7a28338

Please sign in to comment.