Skip to content

Commit

Permalink
implemented requested changes
Browse files Browse the repository at this point in the history
added issue link to TODO
adjusted javadocs
  • Loading branch information
jan-vcapgemini committed Apr 3, 2023
1 parent 01ef924 commit 950aaa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ConfigurationConstants {
/** Template Set filename for Freemarker functions */
public static final String TEMPLATE_SET_FREEMARKER_FUNCTIONS_FILE_NAME = "functions.ftl";

/** Filename of the {@link Properties} used to customize cobigen properties and template relocation. */
/** Filename of the {@link Properties} used to customize CobiGen properties and template relocation. */
public static final String COBIGEN_PROPERTIES = "cobigen.properties";

/** Resource folder containing templates */
Expand All @@ -44,7 +44,7 @@ public class ConfigurationConstants {
/** Delimiter splitting the template folder and value of references in templates.xml files */
public static final String REFERENCE_DELIMITER = "::";

// configuration resource constants of cobigen home
// configuration resource constants of CobiGen home

/** Default directory name in the home folder in case of {@link #DEFAULT_HOME} */
public static final String DEFAULT_HOME_DIR_NAME = ".cobigen";
Expand Down Expand Up @@ -114,20 +114,23 @@ public class ConfigurationConstants {
public static final String CONFIG_PROPERTY_TEMPLATE_SETS_INSTALLED = "template-sets.installed";

/**
* Default (public) cobigen GroupId
* Default (public) CobiGen GroupId
*/
public static final String CONFIG_PROPERTY_TEMPLATE_SETS_DEFAULT_GROUPID = "com.devonfw.cobigen.templates";

// cobigen configuration environment variables
// CobiGen configuration environment variables

/** Name of the environment variable pointing to cobigen configuration file */
/** Name of the environment variable pointing to CobiGen configuration file */
public static final String CONFIG_ENV_HOME = "COBIGEN_HOME";

/** Name of the backup folder containing the old configuration */
public static final String BACKUP_FOLDER = "backup";

/**
* Default cobigen version TODO retrieve the version dynamically(not as a constant) at runtime.
* Default CobiGen version
*
* TODO: retrieve the version dynamically (not as a constant) at runtime, see:
* https://github.com/devonfw/cobigen/issues/1669
*/
public static final String CONFIG_PROPERTY_TEMPLATE_SETS_DEFAULT_VERSION = "2021.12.007";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ private void writeNewPomFile(Path cobigenTemplates, Path newTemplateFolder,
+ "</groupId>");
content = content.replaceAll("</groupId>\n" + " <artifactId>.*</artifactId>", "</groupId>\n" + " <artifactId>"
+ newTemplateFolder.getFileName().toString().replace('_', '-') + "</artifactId>");
// TODO: retrieve the version dynamically (not as a constant) at runtime, see:
// https://github.com/devonfw/cobigen/issues/1669
content = content.replaceAll("</artifactId>\n" + " <version>([0-9]+(\\.[0-9]+)+)</version>", "</artifactId>\n"
+ " <version>" + ConfigurationConstants.CONFIG_PROPERTY_TEMPLATE_SETS_DEFAULT_VERSION + "</version>");
content = content.replaceAll("</version>\n" + " <name>.*</name>",
Expand Down

0 comments on commit 950aaa7

Please sign in to comment.