-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK-361 and SDK-356 - Update wizard to support custom distributions and more platform and distribution versions #315
Conversation
… the same version as options
|
||
String customDistroMessage = "Please specify distribution artifact"; | ||
String customDistroDefault = SDKConstants.REFERENCEAPPLICATION_2_4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding these to this top-level wizard step, we move the option to specify a custom distribution out from under the RefApp 2.x section and into the top-level section where it belongs. This then allows us to focus the refapp 2.x section on paging through the published versions in Maven
} | ||
|
||
return answer; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main code that now drives the Wizard when one is selecting a platform, 2.x refapp or 3.x refapp version. This downloads all suggested versions and allows paging through all of them, rather than just presenting the most recent 5 or 6 or whatever.
Artifact artifact = new Artifact(REFAPP_3X_ARTIFACT_ID, "3.0.0", REFAPP_3X_GROUP_ID, REFAPP_3X_TYPE); | ||
String version = promptForArtifactVersion("Please choose a " + REFAPP_3X_PROMPT + " version", artifact, null, versionsHelper); | ||
artifact.setVersion(version); | ||
return artifact; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much more straightforward and simplified methods here for prompting for versions, and able to remove the web of other methods below that are no longer used or needed.
if (!version.toString().endsWith("-SNAPSHOT") && optionsMap.size() < MAX_OPTIONS_SIZE) { | ||
optionsMap.put(String.format(optionTemplate, version), | ||
artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something that was easier NOT to support in this change, and it didn't seem like something we need anymore now that 3.0.0 has been released. This particular distro artifact was only ever a snapshot/beta/alpha of 3.0.0, so there should not be any need for it anymore. Someone could still choose to install it via the custom distribution option, by specifying the full maven coordinate string, but I don't think we need this sitting in the list of versions in the Wizard, so I removed it.
String dockerMachineIp = dockerHost.substring(beginIndex + 2, endIndex); | ||
return String.format(SDKConstants.URI_MYSQL_DOCKER, dockerMachineIp); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, this method wasn't used, so I cleaned it out.
return entry.toFile().isDirectory(); | ||
} | ||
})) { | ||
try (DirectoryStream<Path> subDirectories = Files.newDirectoryStream(openMRS, entry -> entry.toFile().isDirectory())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE-suggested code cleanup.
see https://openmrs.atlassian.net/browse/SDK-361
see https://openmrs.atlassian.net/browse/SDK-356
See ticket details for description of changes.