Skip to content

Commit

Permalink
ctron#66 Assign project.build.rpm.outputFileName property
Browse files Browse the repository at this point in the history
  • Loading branch information
jarkkosonninen authored and ctron committed Sep 12, 2022
1 parent 5f61690 commit 0796b57
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main/java/de/dentrassi/rpm/builder/RpmMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,18 @@ public void setOutputFileName(final String outputFileName) {
this.outputFileName = outputFileName;
}

/**
* Name of the property, which is set according to the final outputFileName
*
* @since 1.9.1
*/
@Parameter(property = "rpm.outputFileNameProperty", defaultValue="project.build.rpm.outputFileName")
String outputFileNameProperty = "project.build.rpm.outputFileName";

public void setOutputFileNameProperty(final String outputFileNameProperty) {
this.outputFileNameProperty = outputFileNameProperty;
}

/**
* The highest supported RPM version this package must conform to.
* <p>
Expand Down Expand Up @@ -751,7 +763,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
this.logger.info("Creating reproducible RPM at timestamp: %s", outputTimestampInstant);
}

final Path targetFile = makeTargetFile(targetDir);
final String outputFileName = makeTargetFilename();
project.getProperties().setProperty(outputFileNameProperty, outputFileName);
final Path targetFile = makeTargetFile(targetDir, outputFileName);

this.logger.debug("Max supported RPM version: %s", this.maximumSupportedRpmVersion);

Expand Down Expand Up @@ -854,8 +868,7 @@ private String makeTargetFilename() {
return outputFileName;
}

private Path makeTargetFile(final Path targetDir) {
final String outputFileName = makeTargetFilename();
private Path makeTargetFile(final Path targetDir, final String outputFileName) {
final Path targetFile = targetDir.resolve(outputFileName);
this.logger.debug("Resolved output file name - fileName: %s, fullName: %s", this.outputFileName, targetFile);
return targetFile;
Expand Down

0 comments on commit 0796b57

Please sign in to comment.