Skip to content

Commit

Permalink
feat(core): Add basedir as name template. Resolves #876
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Jul 28, 2022
1 parent 6f890a4 commit 02c35ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void assemble() throws AssemblerProcessingException {

private Map<String, Object> initProps() {
Map<String, Object> props = context.props();
props.put(Constants.KEY_BASEDIR, context.getBasedir());
props.put(Constants.KEY_BASE_OUTPUT_DIRECTORY, outputDirectory.getParent());
props.put(Constants.KEY_OUTPUT_DIRECTORY, outputDirectory);
props.put(Constants.KEY_ASSEMBLE_DIRECTORY, context.getAssembleDirectory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public JReleaserContext(JReleaserLogger logger,

try {
logger.increaseIndent();
logger.debug("- " + Constants.KEY_BASEDIR + " set to " + getBasedir());
logger.debug("- " + Constants.KEY_BASE_OUTPUT_DIRECTORY + " set to " + getOutputDirectory().getParent());
logger.debug("- " + Constants.KEY_OUTPUT_DIRECTORY + " set to " + getOutputDirectory());
logger.debug("- " + Constants.KEY_CHECKSUMS_DIRECTORY + " set to " + getChecksumsDirectory());
Expand Down Expand Up @@ -551,6 +552,7 @@ public void setCommand(JReleaserCommand command) {

public Map<String, Object> props() {
Map<String, Object> props = new LinkedHashMap<>(model.props());
props.put(Constants.KEY_BASEDIR, getBasedir());
props.put(Constants.KEY_BASE_OUTPUT_DIRECTORY, getOutputDirectory().getParent());
props.put(Constants.KEY_OUTPUT_DIRECTORY, getOutputDirectory());
props.put(Constants.KEY_CHECKSUMS_DIRECTORY, getChecksumsDirectory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ public interface Constants {
String KEY_DOWNLOADER_NAME = "downloaderName";

// Directories
String KEY_BASEDIR = "basedir";
String KEY_BASE_OUTPUT_DIRECTORY = "baseOutputDirectory";
String KEY_OUTPUT_DIRECTORY = "outputDirectory";
String KEY_CHECKSUMS_DIRECTORY = "checksumDirectory";
Expand Down

0 comments on commit 02c35ae

Please sign in to comment.