Skip to content

Commit

Permalink
feat: Allow 8 as JDK version for requireJavaVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Jan 29, 2023
1 parent 5aa3b61 commit 04917a8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract class AbstractVersionEnforcerRule extends AbstractStandardEnforcerRule
@Override
protected void doExecute(EnforcerContext context) throws EnforcerRuleException {
ArtifactVersion detectedVersion = detectVersion(context)
String requiredVersionRange = version.get()
String requiredVersionRange = adjustVersion(version.get())

String msg = 'Detected ' + variableName + ' Version: ' + detectedVersion

Expand Down Expand Up @@ -136,4 +136,8 @@ abstract class AbstractVersionEnforcerRule extends AbstractStandardEnforcerRule
}
return matched
}

protected String adjustVersion(String version) {
version
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ class RequireJavaVersion extends AbstractVersionEnforcerRule {
'JDK'
}

/**
@Override
protected String adjustVersion(String version) {
version == '8'? '1.8' : version
}

/**
* Converts a jdk string from 1.5.0-11b12 to a single 3 digit version like 1.5.0-11
*
* @param theJdkVersion to be converted.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/src/docs/asciidoc/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enforce {

== Requirements

Java 8 and Gradle 5 are the minimum requirements to use this plugin.
Java 8 and Gradle 6 are the minimum requirements to use this plugin.

== Rule DSL

Expand Down

0 comments on commit 04917a8

Please sign in to comment.