-
Notifications
You must be signed in to change notification settings - Fork 87
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
O3-3776: Ensure sdk generates a content package template project #284
Conversation
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.
Nice work! A few improvements to make.
I think that ideally in the test here, we'd have a reference
. See here.
archetype-module-content/pom.xml
Outdated
<extension> | ||
<groupId>org.apache.maven.archetype</groupId> | ||
<artifactId>archetype-packaging</artifactId> | ||
<version>2.2</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.
Let's update to the newest version (3.2.1)
<requiredProperty key="moduleName" /> | ||
<requiredProperty key="moduleDescription"/> | ||
<requiredProperty key="moduleAuthor"> | ||
<defaultValue>mherman22</defaultValue> |
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.
Heh... I don't think you want this?
archetype-module-content/src/main/resources/META-INF/maven/archetype-metadata.xml
Outdated
Show resolved
Hide resolved
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<requiredProperties> | ||
<requiredProperty key="groupId"> | ||
<defaultValue>org.openmrs.module</defaultValue> |
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.
<defaultValue>org.openmrs.module</defaultValue> | |
<defaultValue>org.openmrs.content</defaultValue> |
<requiredProperty key="moduleAuthor"> | ||
<defaultValue>mherman22</defaultValue> | ||
</requiredProperty> | ||
<requiredProperty key="moduleClassnamePrefix" /> |
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.
We don't need this for content packages, I don't think.
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.
True that! I will add a check that skips adding that property for content-package type.
</includes> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
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.
</assembly> | |
</assembly> | |
<groupId>org.openmrs.content</groupId> | ||
<artifactId>content-package</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<name></name> |
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.
<name></name> | |
<name>${moduleName}</name> |
<groupId>org.openmrs.content</groupId> | ||
<artifactId>content-package</artifactId> | ||
<version>1.0.0-SNAPSHOT</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.
<groupId>org.openmrs.content</groupId> | |
<artifactId>content-package</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<groupId>${groupId}</groupId> | |
<artifactId>${artifactId}</artifactId> | |
<version>${version}</version> |
<scm> | ||
<connection>scm:git:[email protected]:openmrs/openmrs-content-hiv.git</connection> | ||
<developerConnection>scm:git:[email protected]:openmrs/openmrs-content-hiv.git</developerConnection> | ||
<url>https://github.com/openmrs/openmrs-content-hiv.git</url> | ||
</scm> |
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.
<scm> | |
<connection>scm:git:[email protected]:openmrs/openmrs-content-hiv.git</connection> | |
<developerConnection>scm:git:[email protected]:openmrs/openmrs-content-hiv.git</developerConnection> | |
<url>https://github.com/openmrs/openmrs-content-hiv.git</url> | |
</scm> | |
<scm> | |
<connection>scm:git:[email protected]:openmrs/openmrs-content-${artifactId}.git</connection> | |
<developerConnection>scm:git:[email protected]:openmrs/openmrs-content-${artifactId}.git</developerConnection> | |
<url>https://github.com/openmrs/openmrs-content-${artifactId}.git</url> | |
</scm> |
@@ -269,6 +281,10 @@ private void createModule() throws MojoExecutionException { | |||
"What is the lowest version of the Reference Application (-D%s) you want to support?", refapp, "refapp", | |||
"2.4"); | |||
archetypeArtifactId = SDKConstants.REFAPP_ARCH_ARTIFACT_ID; | |||
} else if (TYPE_CONTENT_PACKAGE.equals(type)) { | |||
contentpackage = wizard.promptForValueIfMissingWithDefault("What is the lowest version of the content package (-D%s) you want to support?", contentpackage, "contentpackage", |
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.
I don't really understand what this question is prompting for?
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.
It didn't make sense to me either. Was just going by the convention overthere, I can skip the prompt.
Thanks
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.
Oh, yeah. For other things we care about the platform version, etc. We currently don't for content packages, but maybe we should?
Does this need a re-review? |
Looks ok to me |
artifactId=content-package | ||
openmrsContentPackageVersion=1.0.0 | ||
package=org.openmrs.content.content-package | ||
version=${package.getClass().forName("java.lang.String").getConstructor($package.getClass().forName("java.lang.String")).newInstance("1.0.0-SNAPSHOT")} |
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.
We don't need the weird expression here.
version=${package.getClass().forName("java.lang.String").getConstructor($package.getClass().forName("java.lang.String")).newInstance("1.0.0-SNAPSHOT")} | |
version=1.0.0-SNAPSHOT |
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.
Is this required to get the test to pass or something?
Description of what I changed
Issue I worked on
see https://openmrs.atlassian.net/browse/O3-3776
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean install
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute the above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master