Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve warning in Gradle 7.2 #201

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,25 @@ public void execute(Task task) {
}
});

project.getTasks().withType(Jar.class).configureEach(jar -> {
File moduleInfoDir = helper().getModuleInfoDir();
jar.from(moduleInfoDir);
jar.doFirst(task -> {
File classesDir = helper().mainSourceSet().getJava().getOutputDir();
File mainModuleInfoFile = new File(classesDir, "module-info.class");
File customModuleInfoFile = new File(moduleInfoDir, "module-info.class");
if(mainModuleInfoFile.isFile() && customModuleInfoFile.isFile()) {
mainModuleInfoFile.delete();
}
});
// don't convert to lambda: https://docs.gradle.org/7.2/userguide/validation_problems.html#implementation_unknown
project.getTasks().withType(Jar.class).configureEach(new Action<Jar>() {
@Override
public void execute(Jar jar) {
File moduleInfoDir = CompileModuleInfoTask.this.helper().getModuleInfoDir();
jar.from(moduleInfoDir);
// don't convert to lambda: https://docs.gradle.org/7.2/userguide/validation_problems.html#implementation_unknown
jar.doFirst(new Action<Task>() {
@Override
public void execute(Task task) {
File classesDir = CompileModuleInfoTask.this.helper().mainSourceSet().getJava().getOutputDir();
File mainModuleInfoFile = new File(classesDir, "module-info.class");
File customModuleInfoFile = new File(moduleInfoDir, "module-info.class");
if (mainModuleInfoFile.isFile() && customModuleInfoFile.isFile()) {
mainModuleInfoFile.delete();
}
}
});
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void smokeTestDist(String projectName, String gradleVersion) {

@CartesianProductTest(name = "smokeTestRunDemo({arguments})")
@CartesianValueSource(strings = {"test-project", "test-project-kotlin", "test-project-groovy"})
@CartesianValueSource(strings = {"5.1", "5.6", "6.3", "6.4.1", "6.5.1", "6.8.3", "7.0"})
@CartesianValueSource(strings = {"5.1", "5.6", "6.3", "6.4.1", "6.5.1", "6.8.3", "7.0", "7.2"})
void smokeTestRunDemo(String projectName, String gradleVersion) {
LOGGER.info("Executing smokeTestRunDemo with Gradle {}", gradleVersion);
var result = GradleRunner.create()
Expand All @@ -212,6 +212,7 @@ void smokeTestRunDemo(String projectName, String gradleVersion) {
.build();

assertTasksSuccessful(result, "greeter.javaexec", "runDemo1", "runDemo2");
assertFalse(result.getOutput().contains("Using Java lambdas is not supported as task inputs"));
}

@CartesianProductTest(name = "smokeTestRunStartScripts({arguments})")
Expand Down