Skip to content

Commit

Permalink
SDK-306: Integrated Micro Frontend Tooling Setup in OpenMRS SDK - Ref…
Browse files Browse the repository at this point in the history
…actoring
  • Loading branch information
wikumChamith committed Jun 21, 2023
1 parent 077d6ca commit 4134f8c
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ public String promptForRefAppVersion(VersionsHelper versionsHelper, String custo

public String promptForO3RefAppVersion(VersionsHelper versionsHelper, String customMessage)
throws MojoExecutionException {
Map<String, String> optionsMap = getO3VersionsOptionsMap(versionsHelper, REFAPP_OPTION_TMPL,
O3_ARTIFACT_TMPL);
Map<String, String> optionsMap = getO3VersionsOptionsMap(versionsHelper
);
return promptForO3Version(optionsMap, customMessage);
}

Expand Down Expand Up @@ -771,17 +771,14 @@ private Map<String, String> getDistroVersionsOptionsMap(Set<String> versions, Ve
/**
* Returns a map of options based on the versions of O3
*
* @param versionsHelper The VersionsHelper object to retrieve the artifact versions from.
* @param optionTemplate The template for generating option keys in the map.
* @param artifactTemplate The template for generating artifact values in the map.
* @param versionsHelper The VersionsHelper object to retrieve the artifact versions from.
* @return A LinkedHashMap containing the generated options map.
*/
private Map<String, String> getO3VersionsOptionsMap(VersionsHelper versionsHelper,
String optionTemplate, String artifactTemplate) {
private Map<String, String> getO3VersionsOptionsMap(VersionsHelper versionsHelper) {
Map<String, String> optionsMap = new LinkedHashMap<>();
Artifact artifact = new Artifact("referenceapplication-distro", "version", "org.openmrs.distro", "zip");
Artifact artifact = new Artifact("referenceapplication-distro", null, "org.openmrs.distro", "zip");
for (ArtifactVersion version : versionsHelper.getAllVersions(artifact, MAX_OPTIONS_SIZE)) {
optionsMap.put(String.format(optionTemplate, version.toString()), String.format(artifactTemplate, version));
optionsMap.put(String.format(DefaultWizard.REFAPP_OPTION_TMPL, version.toString()), String.format(DefaultWizard.O3_ARTIFACT_TMPL, version));
}
return optionsMap;
}
Expand Down

0 comments on commit 4134f8c

Please sign in to comment.