-
Notifications
You must be signed in to change notification settings - Fork 161
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
[ARCHETYPE-274] Conditionally include or exclude a file from archetype during generation #244
base: master
Are you sure you want to change the base?
Conversation
f3f3af6
to
aaa74e8
Compare
aaa74e8
to
e980722
Compare
I'd like to know if we would want something like this, where the property must resolve to either true or false. <fileSet includeCondition="${extraSupport}">
...
</fileSet> Perhaps there are other ways forward. |
@@ -162,6 +162,13 @@ | |||
<required>false</required> | |||
<description>Encoding to use when filtering content.</description> | |||
</field> | |||
<field xml.attribute="true"> |
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.
where does xml.attribute come from? Per XML 1.0 spec "Names beginning with the string 'xml', or with any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification."
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.
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.
Wow, that is seriously broken. Not something we can fix in this PR, but another reason to avoid Modello.
package=com.company.project | ||
|
||
extraSupport=true | ||
anotherSupport=false |
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.
missing new line at end here, and in other files
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 think we should consider adding something like. Either in parent pom or in this project
<pluginManagement>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<formats>
<format>
<includes>
<include>**.java</include>
<include>**pom.xml</include>
<include>**.txt</include>
<include>**.groovy</include>
<include>**.properties</include>
</includes>
<endWithNewline />
</format>
</formats>
</configuration>
</plugin>
</pluginManagement>
</plugins>
@@ -162,6 +162,13 @@ | |||
<required>false</required> | |||
<description>Encoding to use when filtering content.</description> | |||
</field> | |||
<field xml.attribute="true"> | |||
<name>includeCondition</name> | |||
<version>1.0.0+</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.
I think about put 1.1.0+ here ... we also need update version for model in plugin configuration
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 should be backwards compatible so that's why I put it in v1.0.0, but I'm fine with both. I'm not sure what the implications would be when adding it for 1.0.0
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 will publish next schema version, for backward compatible users can use old schema without new field ....
<version>1.0.0+</version> | ||
<type>String</type> | ||
<required>false</required> | ||
<description>Condition to include the fileset based on a property value.</description> |
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.
Should contains more details ...
after looking into code and test I see that it is evaluated be velocity ... and should have a true
value
778b5f5
to
6c5e4b7
Compare
I think I've resolved all the feedback on the PR. Is there anything I can do to help moving this feature forwards, or am I missing some more comments that I need to implement still? |
PoC to make it possible to optionally include filesets.
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[ARCHETYPE-XXX] SUMMARY
,where you replace
ARCHETYPE-XXX
andSUMMARY
with the appropriate JIRA issue.[ARCHETYPE-XXX] SUMMARY
.Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.