[ 
https://issues.apache.org/jira/browse/GROOVY-11269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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<String, GroovyClassDoc> 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<String, GroovyClassDoc> 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)

Reply via email to