Skip to content

Commit 207cbdf

Browse files
remove jdk 17 api and replace it to 11 for more compatibility with old projects | increase version to 2.1.1
1 parent 47b18c7 commit 207cbdf

4 files changed

Lines changed: 19 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ exit $status
2424

2525
### Prerequisites
2626

27-
- Java JDK (version 11 or newer)
28-
- Gradle for build automation
27+
- Java JDK 17+
28+
- Gradle 5.0+
2929

3030
### Installation and Usage
3131

plugin/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'io.github.alexeytereshchenko.guardian'
8-
version = '1.2.0'
8+
version = '1.2.1'
99

1010
dependencies {
1111
implementation 'net.ltgt.errorprone:net.ltgt.errorprone.gradle.plugin:3.0.1'
@@ -17,6 +17,12 @@ repositories {
1717
gradlePluginPortal()
1818
}
1919

20+
java {
21+
toolchain {
22+
languageVersion = JavaLanguageVersion.of(11)
23+
}
24+
}
25+
2026
testing {
2127
suites {
2228
// Configure the built-in test suite

plugin/src/main/java/io/github/alexeytereshchenko/guardian/GuardianPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private void configureGitHooks(Project project, GuardianExtension guardianExtens
234234
);
235235

236236
project.getTasks().withType(Delete.class, cleanTask -> {
237-
cleanTask.delete(project.getLayout().getProjectDirectory().file("%s/%s".formatted(destDir, fileName)));
237+
cleanTask.delete(project.getLayout().getProjectDirectory().file(String.format("%s/%s", destDir, fileName)));
238238
});
239239
}
240240
}

plugin/src/main/java/io/github/alexeytereshchenko/guardian/task/DownloadCheckstyleFile.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
package io.github.alexeytereshchenko.guardian.task;
22

3-
import org.gradle.api.DefaultTask;
4-
import org.gradle.api.InvalidUserDataException;
5-
import org.gradle.api.provider.Property;
6-
import org.gradle.api.tasks.Input;
7-
import org.gradle.api.tasks.Optional;
8-
import org.gradle.api.tasks.TaskAction;
9-
import org.slf4j.Logger;
10-
import org.slf4j.LoggerFactory;
11-
123
import java.io.File;
134
import java.io.FileOutputStream;
145
import java.io.IOException;
@@ -19,6 +10,14 @@
1910
import java.net.http.HttpRequest;
2011
import java.net.http.HttpResponse;
2112
import java.net.http.HttpResponse.BodyHandlers;
13+
import org.gradle.api.DefaultTask;
14+
import org.gradle.api.InvalidUserDataException;
15+
import org.gradle.api.provider.Property;
16+
import org.gradle.api.tasks.Input;
17+
import org.gradle.api.tasks.Optional;
18+
import org.gradle.api.tasks.TaskAction;
19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
2221

2322
public abstract class DownloadCheckstyleFile extends DefaultTask {
2423

@@ -66,7 +65,7 @@ public void downloadCheckstyleFile() throws URISyntaxException, IOException, Int
6665
}
6766

6867
} catch (Exception e) {
69-
String message = "Cannot download a checkstyle file by url: %s in %s".formatted(url, destinationPath);
68+
String message = String.format("Cannot download a checkstyle file by url: %s in %s", url, destinationPath);
7069
log.error(message, e);
7170
throw e;
7271
}

0 commit comments

Comments
 (0)