Skip to content

Commit dca6bff

Browse files
committed
Fixed a build error
1 parent 8ae45ae commit dca6bff

File tree

2 files changed

+6
-40
lines changed

2 files changed

+6
-40
lines changed

src/main/java/io/github/intisy/gradle/github/Logger.java

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,34 @@
66
public class Logger {
77
private final GithubExtension extension;
88
private final Project project;
9-
/**
10-
* Constructs a new instance of Logger using the provided {@link Project} instance.
11-
*
12-
* @param project The {@link Project} instance associated with this Logger.
13-
*
14-
* @throws NullPointerException If the {@code project} is null.
15-
*
16-
* @see GithubExtension
17-
*/
9+
1810
public Logger(Project project) {
1911
this(project.getExtensions().getByType(GithubExtension.class), project);
2012
}
21-
/**
22-
* Constructs a new instance of Logger.
23-
*
24-
* @param extension The {@link GithubExtension} instance to be used for logging configuration.
25-
* @param project The {@link Project} instance associated with this Logger.
26-
*
27-
* @throws NullPointerException If either {@code extension} or {@code project} is null.
28-
*/
13+
2914
public Logger(GithubExtension extension, Project project) {
3015
if (extension == null || project == null) {
3116
throw new NullPointerException("extension and project cannot be null");
3217
}
3318
this.extension = extension;
3419
this.project = project;
3520
}
36-
/**
37-
* Logs a message at the lifecycle level.
38-
*
39-
* @param message The message to be logged.
40-
*/
21+
4122
public void log(String message) {
4223
project.getLogger().lifecycle(message);
4324
}
4425

45-
/**
46-
* Logs an error message.
47-
*
48-
* @param message The error message to be logged.
49-
*/
5026
public void error(String message) {
5127
project.getLogger().error(message);
5228
}
5329

54-
/**
55-
* Logs a debug message if the debug mode is enabled or the log level is INFO or DEBUG.
56-
*
57-
* @param message The debug message to be logged.
58-
*/
5930
public void debug(String message) {
6031
LogLevel logLevel = project.getGradle().getStartParameter().getLogLevel();
6132
if (extension.isDebug() || logLevel.equals(LogLevel.INFO) || logLevel.equals(LogLevel.DEBUG)) {
6233
project.getLogger().lifecycle(message);
6334
}
6435
}
6536

66-
/**
67-
* Logs a warning message.
68-
*
69-
* @param message The warning message to be logged.
70-
*/
7137
public void warn(String message) {
7238
project.getLogger().warn(message);
7339
}

src/main/java/io/github/intisy/gradle/github/Main.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class Main implements org.gradle.api.Plugin<Project> {
2727
/**
2828
* Applies all the project stuff.
2929
*/
30-
public void apply(Project project) {
31-
Logger logger = new Logger(project);
30+
public void apply(Project project) {
31+
GithubExtension githubExtension = project.getExtensions().create("github", GithubExtension.class);
32+
Logger logger = new Logger(githubExtension, project);
3233
GitHub gitHub = new GitHub(logger);
3334

3435
ResourcesExtension resourcesExtension = project.getExtensions().create("resources", ResourcesExtension.class);
35-
GithubExtension githubExtension = project.getExtensions().create("github", GithubExtension.class);
3636
Configuration githubImplementation = project.getConfigurations().create("githubImplementation");
3737

3838
Task processGitHubResources = project.getTasks().create("processGitHubResources", task -> {

0 commit comments

Comments
 (0)