Skip to content

Commit

Permalink
remove unecessary enabled check
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed May 20, 2020
1 parent 235e3e8 commit b1f5a23
Showing 1 changed file with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,23 +398,30 @@ static void configureJars(Project project) {
ExtraPropertiesExtension ext = project.getExtensions().getExtraProperties();
ext.set("licenseFile", null);
ext.set("noticeFile", null);
project.getTasks().withType(Jar.class).configureEach(jarTask -> {
if (jarTask.isEnabled()) {
// we put all our distributable files under distributions
jarTask.getDestinationDirectory().set(new File(project.getBuildDir(), "distributions"));
// fixup the jar manifest
jarTask.doFirst(
t -> {
// this doFirst is added before the info plugin, therefore it will run
// after the doFirst added by the info plugin, and we can override attributes
jarTask.getManifest()
.attributes(
Map.of("Build-Date", BuildParams.getBuildDate(), "Build-Java-Version", BuildParams.getCompilerJavaVersion())
);
}
);
}
});
project.getTasks()
.withType(Jar.class)
.configureEach(
jarTask -> {
// we put all our distributable files under distributions
jarTask.getDestinationDirectory().set(new File(project.getBuildDir(), "distributions"));
// fixup the jar manifest
jarTask.doFirst(
t -> {
// this doFirst is added before the info plugin, therefore it will run
// after the doFirst added by the info plugin, and we can override attributes
jarTask.getManifest()
.attributes(
Map.of(
"Build-Date",
BuildParams.getBuildDate(),
"Build-Java-Version",
BuildParams.getCompilerJavaVersion()
)
);
}
);
}
);
// add license/notice files
project.afterEvaluate(p -> project.getTasks().withType(Jar.class).configureEach(jarTask -> {
if (jarTask.isEnabled()) {
Expand Down

0 comments on commit b1f5a23

Please sign in to comment.