Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
Be more precise about matching scala versions
Browse files Browse the repository at this point in the history
now, f.e. "2.10" will no longer match on scala 2.12.10
  • Loading branch information
Philippus committed Aug 18, 2019
1 parent 89ea359 commit 829804d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public void evaluate() throws Throwable {

public Statement apply(Statement stmt, FrameworkMethod meth, Object arg2) {
ScalaVersion onlyOn = meth.getAnnotation(ScalaVersion.class);
String versionString = Properties.versionString();
String versionNumberString = Properties.versionNumberString();

if (onlyOn != null) {
if (!onlyOn.doesNotMatch().isEmpty() && versionString.contains(onlyOn.doesNotMatch())) {
if (!onlyOn.doesNotMatch().isEmpty() && versionNumberString.startsWith(onlyOn.doesNotMatch())) {
return new EmptyStatement();
} else if (versionString.contains(onlyOn.matches())) {
} else if (versionNumberString.startsWith(onlyOn.matches())) {
return stmt;
} else {
return new EmptyStatement();
Expand Down

0 comments on commit 829804d

Please sign in to comment.