[jira] [Commented] (GROOVY-11269) GroovyClassDoc has empty 'enumConstants' when call method GroovyDocParser.getClassDocsFromSingleSource(...)

2024-01-15 Thread Dmitry (Jira)


[ 
https://issues.apache.org/jira/browse/GROOVY-11269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17806731#comment-17806731
 ] 

Dmitry commented on GROOVY-11269:
-

[~paulk] 

I tried to use old old parser (set the {{groovy.antlr4}} system property to 
{{{}false{}}}):
 
 {{./gradlew clean -x test server:dslDocs -Dgroovy.antlr4=false}}
but it failed with our first exception:
 {{}}
{code:java}
Execution failed for task ':server:dslDocs'.
> startup failed:
  TaggableClasses.groovy: 21: unexpected token: 2 @ line 21, column 15.
COURSE_CLASS(2),
   ^
  
  1 error{code}
{{}}
{{}}
{{}}
When we updated gradle to 8.2.1 and try to execute server:dslDocs without 
'GroovyDocParser' with getClassDocsFromSingleSource - we use or old 
implementation (parseGroovy method in 59 line): 
[https://github.com/ishgroup/oncourse/blob/main/buildSrc/apidoc/src/main/groovy/au/com/ish/docs/DslGroovyRootDocBuilder.groovy]
{{}}
I got the same Exception with 'TaggableClasses.groovy'
{{}}
here I created the issue with the same case: 
https://issues.apache.org/jira/browse/GROOVY-10886
{{}}
and here we've already discussed this: 
https://issues.apache.org/jira/browse/GROOVY-11130
{{}}
{{}}
{{}}

> GroovyClassDoc has empty 'enumConstants' when call method 
> GroovyDocParser.getClassDocsFromSingleSource(...)
> ---
>
> Key: GROOVY-11269
> URL: https://issues.apache.org/jira/browse/GROOVY-11269
> Project: Groovy
>  Issue Type: Bug
>  Components: parser
>Affects Versions: 2.5.12, 3.0.17
>Reporter: Dmitry
>Assignee: Paul King
>Priority: Major
> Fix For: 4.0.18, 5.0.0-alpha-5
>
> Attachments: image-2024-01-05-20-21-01-570.png, 
> image-2024-01-05-20-21-42-826.png, image-2024-01-05-20-28-41-678.png, 
> image-2024-01-05-20-30-29-173.png, image-2024-01-05-20-32-52-646.png, 
> image-2024-01-05-20-32-58-921.png
>
>
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> In our project we try to update gradle from 6.8.2 to 8.2.1.
> And gradle 6.8.2 -> use groovy 2.5.12
> But gradle 8.2.1 -> use groovy 3.0.17
> How we parse java/groovy files now ->
> 59 line 
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file){code}
> [https://github.com/ishgroup/oncourse/blob/main/buildSrc/apidoc/src/main/groovy/au/com/ish/docs/DslGroovyRootDocBuilder.groovy]
>  
> But it doesn't work for gradle 8.2.1 (groovy 3.0.17).
> After discussion this issue in these tasks:
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> I try to use GroovyDocParser from org.codehaus.groovy.tools.groovydoc.antlr4
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file)
>   throws RecognitionException, TokenStreamException {
>GroovyDocParser groovyDocParser = new GroovyDocParser(links, properties)
>def GroovyClassDocMap = 
> groovyDocParser.getClassDocsFromSingleSource(packagePath, file, src)
>return GroovyClassDocMap
> }{code}
>  
> And It seems to work. But I found this problem:
> When I parse groovy enums, GroovyClassDoc has empty 'enumConstants' and all 
> enum values are in 'fields'.
> !image-2024-01-05-20-21-42-826.png!!image-2024-01-05-20-21-01-570.png!
> But our old implementation has:
> !image-2024-01-05-20-30-29-173.png!
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (GROOVY-11269) GroovyClassDoc has empty 'enumConstants' when call method GroovyDocParser.getClassDocsFromSingleSource(...)

2024-01-15 Thread Dmitry (Jira)


[ 
https://issues.apache.org/jira/browse/GROOVY-11269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17806724#comment-17806724
 ] 

Dmitry commented on GROOVY-11269:
-

[~paulk] hi,

1) we can't use latest groovy snapshot, because the gradle forces us to use the 
default groovy version from gradle. In our case, gradle 8.2.1 uses groovy 
3.0.17.

2) How and where should I set set the {{groovy.antlr4}} system property to 
{{false? To create GroovyClassDoc I use this one:}}
{{}}
{code:java}
GroovyDocParser groovyDocParser = new GroovyDocParser(links, properties)
def GroovyClassDocMap = 
groovyDocParser.getClassDocsFromSingleSource(packagePath, file, src) {code}
{{ here you can find full file: 
https://github.com/ishgroup/oncourse/pull/1192/files#diff-33ed7c0380b15143b4e46d30aa40b05e3d35998a58fcbed6da2ce3c6c349861a}}

> GroovyClassDoc has empty 'enumConstants' when call method 
> GroovyDocParser.getClassDocsFromSingleSource(...)
> ---
>
> Key: GROOVY-11269
> URL: https://issues.apache.org/jira/browse/GROOVY-11269
> Project: Groovy
>  Issue Type: Bug
>  Components: parser
>Affects Versions: 2.5.12, 3.0.17
>Reporter: Dmitry
>Assignee: Paul King
>Priority: Major
> Fix For: 4.0.18, 5.0.0-alpha-5
>
> Attachments: image-2024-01-05-20-21-01-570.png, 
> image-2024-01-05-20-21-42-826.png, image-2024-01-05-20-28-41-678.png, 
> image-2024-01-05-20-30-29-173.png, image-2024-01-05-20-32-52-646.png, 
> image-2024-01-05-20-32-58-921.png
>
>
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> In our project we try to update gradle from 6.8.2 to 8.2.1.
> And gradle 6.8.2 -> use groovy 2.5.12
> But gradle 8.2.1 -> use groovy 3.0.17
> How we parse java/groovy files now ->
> 59 line 
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file){code}
> [https://github.com/ishgroup/oncourse/blob/main/buildSrc/apidoc/src/main/groovy/au/com/ish/docs/DslGroovyRootDocBuilder.groovy]
>  
> But it doesn't work for gradle 8.2.1 (groovy 3.0.17).
> After discussion this issue in these tasks:
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> I try to use GroovyDocParser from org.codehaus.groovy.tools.groovydoc.antlr4
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file)
>   throws RecognitionException, TokenStreamException {
>GroovyDocParser groovyDocParser = new GroovyDocParser(links, properties)
>def GroovyClassDocMap = 
> groovyDocParser.getClassDocsFromSingleSource(packagePath, file, src)
>return GroovyClassDocMap
> }{code}
>  
> And It seems to work. But I found this problem:
> When I parse groovy enums, GroovyClassDoc has empty 'enumConstants' and all 
> enum values are in 'fields'.
> !image-2024-01-05-20-21-42-826.png!!image-2024-01-05-20-21-01-570.png!
> But our old implementation has:
> !image-2024-01-05-20-30-29-173.png!
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (GROOVY-11269) GroovyClassDoc has empty 'enumConstants' when call method GroovyDocParser.getClassDocsFromSingleSource(...)

2024-01-11 Thread Paul King (Jira)


[ 
https://issues.apache.org/jira/browse/GROOVY-11269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17805465#comment-17805465
 ] 

Paul King commented on GROOVY-11269:


If you can try the latest snapshot to see if the problem is fixed, that would 
be great.

> GroovyClassDoc has empty 'enumConstants' when call method 
> GroovyDocParser.getClassDocsFromSingleSource(...)
> ---
>
> Key: GROOVY-11269
> URL: https://issues.apache.org/jira/browse/GROOVY-11269
> Project: Groovy
>  Issue Type: Bug
>  Components: parser
>Affects Versions: 2.5.12, 3.0.17
>Reporter: Dmitry
>Priority: Major
> Attachments: image-2024-01-05-20-21-01-570.png, 
> image-2024-01-05-20-21-42-826.png, image-2024-01-05-20-28-41-678.png, 
> image-2024-01-05-20-30-29-173.png, image-2024-01-05-20-32-52-646.png, 
> image-2024-01-05-20-32-58-921.png
>
>
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> In our project we try to update gradle from 6.8.2 to 8.2.1.
> And gradle 6.8.2 -> use groovy 2.5.12
> But gradle 8.2.1 -> use groovy 3.0.17
> How we parse java/groovy files now ->
> 59 line 
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file){code}
> [https://github.com/ishgroup/oncourse/blob/main/buildSrc/apidoc/src/main/groovy/au/com/ish/docs/DslGroovyRootDocBuilder.groovy]
>  
> But it doesn't work for gradle 8.2.1 (groovy 3.0.17).
> After discussion this issue in these tasks:
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> I try to use GroovyDocParser from org.codehaus.groovy.tools.groovydoc.antlr4
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file)
>   throws RecognitionException, TokenStreamException {
>GroovyDocParser groovyDocParser = new GroovyDocParser(links, properties)
>def GroovyClassDocMap = 
> groovyDocParser.getClassDocsFromSingleSource(packagePath, file, src)
>return GroovyClassDocMap
> }{code}
>  
> And It seems to work. But I found this problem:
> When I parse groovy enums, GroovyClassDoc has empty 'enumConstants' and all 
> enum values are in 'fields'.
> !image-2024-01-05-20-21-42-826.png!!image-2024-01-05-20-21-01-570.png!
> But our old implementation has:
> !image-2024-01-05-20-30-29-173.png!
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (GROOVY-11269) GroovyClassDoc has empty 'enumConstants' when call method GroovyDocParser.getClassDocsFromSingleSource(...)

2024-01-06 Thread Dmitry (Jira)


[ 
https://issues.apache.org/jira/browse/GROOVY-11269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17803815#comment-17803815
 ] 

Dmitry commented on GROOVY-11269:
-

And one more question.
[~paulk] wrote in https://issues.apache.org/jira/browse/GROOVY-11130 comment:
??GroovyRootDocBuilder calls getClassDocsFromSingleSource() for all Groovy 
versions. It uses the legacy parser underneath for Groovy versions prior to 3. 
It uses the new parser only for versions 4 and above. In Groovy 3, it defaults 
to the new parser but can be configured to use the old parser.??

 

How can I use old parser for groovy 3.0.17? How can I configure 
GroovyRootDocBuilder?

> GroovyClassDoc has empty 'enumConstants' when call method 
> GroovyDocParser.getClassDocsFromSingleSource(...)
> ---
>
> Key: GROOVY-11269
> URL: https://issues.apache.org/jira/browse/GROOVY-11269
> Project: Groovy
>  Issue Type: Bug
>  Components: parser
>Affects Versions: 2.5.12, 3.0.17
>Reporter: Dmitry
>Priority: Major
> Attachments: image-2024-01-05-20-21-01-570.png, 
> image-2024-01-05-20-21-42-826.png, image-2024-01-05-20-28-41-678.png, 
> image-2024-01-05-20-30-29-173.png, image-2024-01-05-20-32-52-646.png, 
> image-2024-01-05-20-32-58-921.png
>
>
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> In our project we try to update gradle from 6.8.2 to 8.2.1.
> And gradle 6.8.2 -> use groovy 2.5.12
> But gradle 8.2.1 -> use groovy 3.0.17
> How we parse java/groovy files now ->
> 59 line 
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file){code}
> [https://github.com/ishgroup/oncourse/blob/main/buildSrc/apidoc/src/main/groovy/au/com/ish/docs/DslGroovyRootDocBuilder.groovy]
>  
> But it doesn't work for gradle 8.2.1 (groovy 3.0.17).
> After discussion this issue in these tasks:
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> I try to use GroovyDocParser from org.codehaus.groovy.tools.groovydoc.antlr4
> {code:java}
> private Map parseGroovy(String src, String 
> packagePath, String file)
>   throws RecognitionException, TokenStreamException {
>GroovyDocParser groovyDocParser = new GroovyDocParser(links, properties)
>def GroovyClassDocMap = 
> groovyDocParser.getClassDocsFromSingleSource(packagePath, file, src)
>return GroovyClassDocMap
> }{code}
>  
> And It seems to work. But I found this problem:
> When I parse groovy enums, GroovyClassDoc has empty 'enumConstants' and all 
> enum values are in 'fields'.
> !image-2024-01-05-20-21-42-826.png!!image-2024-01-05-20-21-01-570.png!
> But our old implementation has:
> !image-2024-01-05-20-30-29-173.png!
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)