-
Notifications
You must be signed in to change notification settings - Fork 119
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
Don't add revnumber attr when project.version is unspecified #512
Don't add revnumber attr when project.version is unspecified #512
Conversation
@@ -770,7 +771,7 @@ abstract class AbstractAsciidoctorBaseTask extends DefaultTask { | |||
'gradle-project-name': (Object) project.name | |||
] | |||
|
|||
if (project.version != null) { | |||
if (project.version != null && project.version.toString() != Project.DEFAULT_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.
EMI, but what does project.DEFAULT_VERSION
provide ?
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.
Hey @lhotari Can you base your PR against |
Yes. working on it. |
202e5bf
to
191d4df
Compare
It's rebased now for development-3.x. I also added another fix in this same PR that I came across at the same time. I can move that to a separate PR if that's required. The 2nd commit doesn't add |
Keep in the same one. There is enough material being contributed such that we can release 3.1.0 shortly. // cc @Mogztter |
@lhotari There still seem to be one test failure. |
will check it now. |
- Fixes asciidoctor#329 - project.version defaults to 'unspecified' in Gradle
191d4df
to
2a3f882
Compare
@ysb33r I pushed a fix for the test failure, https://github.com/asciidoctor/asciidoctor-gradle-plugin/pull/512/files#diff-5479704be335de86c1fe2110ef764cbbR1033-R1040 . Had to use CompileDynamic to resolve the issue. It seems that the signature of |
private Set<String> trimOverridableAttributeNotation(Set<String> attributeKeys) { | ||
// remove possible trailing '@' character that is used to encode that the attribute can be overridden | ||
// in the document itself | ||
attributeKeys.collect { k -> k - ~/@$/ } as Set |
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 have a utility to deal with that which will avoid dynamic compilation.
Transform.toSet (attributeKeys) { k -> k - ~/@$/ }
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.
Thanks. good to know. Using Transform.toSet
now.
- internal default for 'revnumber@' should not override the one provided by the user
2a3f882
to
f6a41a7
Compare
Project.DEFAULT_VERSION
(which isunspecified
).