Annotations Creation
 

Annotations Creation

8 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    443 posts
    Registered:
    29 Jun 2018
    12 Feb
    Link to this post
    We have been trying to get the annotations built in VS CODE with the Ant Target Runner but have been unsuccessful. What should the value of autoTargetTriggerFilename be and where should that be set.

    The following is from the VS CODE terminal output

    PS C:\ProgressWrk\OspreyPOS_128109\OspreyPOS_LegacyPOS> cd "c:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend"
    PS C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend> ant -lib c:\Progress\OpenEdge\PCT\pct.jar ExtractClassAnnotationsVsCode
    Buildfile: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\build.xml

    init:
         [echo] Using DLC             : C:/Progress/OpenEdge
         [echo] Using Assemblies from : C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Assemblies
         [echo] assemblies = C:/ProgressWrk/OspreyCommon_128109/SmartComponentLibrary/Assemblies
         [echo] autoTargetTriggerFilename = ${autoTargetTriggerFilename}

    ExtractClassAnnotationsVsCode:
         [echo] autoTargetTriggerFilename ${autoTargetTriggerFilename}
         [echo] Build Files: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\${autoTargetTriggerFilename}
         [echo] File Mask:   *BusinessEntity.cls,*Task.cls,*Service.cls,I*.cls,*Enum.cls,*Parameter.cls

    BUILD FAILED
    C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\build.xml:58: The following error occurred while executing this line:
    C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ExtractClassAnnotations\extract-class-annotations.xml:30: No .cls files in => [C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\${autoTargetTriggerFilename}]

    Total time: 0 seconds
    PS C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend> 
  2. Peter Judge
    Peter Judge avatar
    16 posts
    Registered:
    11 Aug 2022
    12 Feb in reply to Roger Blanchard
    Link to this post
    The Ant Target Runner extension is meant to set that value, to the filename that was saved. And it does. Sometimes. We've been having all kinds of high jinks with the extension, both internally and at various customer projects, to the point that we are going to create a replacement for it. That should be available sometime in March.

    In the meantime, you can create a task in VS Code to let you manually generate the annotations. I would suggest adding it to the workspace tasks. In your .code-workspace file, add the below. If you have tasks already defined in the workspace, then just add the task itself (inside the tasks array).

    You'll need to correct the value of the cwd property, and potentially also the path to the OpenEdge install..

    You can then run it using F1/SHIFT-CTRL-P and selecting Tasks: Run Build Task. "Run annotation builder" should appear in the dropdown that appears. You need to be in the program that you want to generate the annotations for.

    "tasks": {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "Run annotation builder",
                "type": "shell",
                "options": {
                    "cwd": "/path/to/project"
                },
                "command": "c:/Progress/OpenEdge/bin/proant -lib c:/Progress/OpenEdge/PCT/PCT.jar -f annotations.xml ExtractClassAnnotationsVsCode -DautoTargetTriggerFilename=${fileBasename}",
                "args": [],
                "problemMatcher": [],
                "presentation": {
                    "reveal": "always"
                },
                "group": "build"
            }
        ]
    }
  3. Roger Blanchard
    Roger Blanchard avatar
    443 posts
    Registered:
    29 Jun 2018
    12 Feb in reply to Peter Judge
    Link to this post
    Hey Peter,

    I will give that a try. I have been pulling my hair out and I don't have much left!!
  4. Mike Fechner
    Mike Fechner avatar
    369 posts
    Registered:
    14 Sep 2016
    12 Feb in reply to Roger Blanchard
    Link to this post
    To save Roger from loosing more hair and support file editing outside an IDE (Claude Code, VI, ...) we will implement a file-watcher based regeneration of the .annotation files in the next couple of weeks. 
  5. Mike Fechner
    Mike Fechner avatar
    369 posts
    Registered:
    14 Sep 2016
    12 Feb in reply to Mike Fechner
    Link to this post
    And there is still hope that in 13.x OpenEdge will improve native support for annotations in the language.
  6. Roger Blanchard
    Roger Blanchard avatar
    443 posts
    Registered:
    29 Jun 2018
    12 Feb in reply to Peter Judge
    Link to this post
    Well,

    I think I am closer.

    The C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\PhysicalInvAddItemWizardTask is actually C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\Osprey\Pos\PhysicalInv\PhysicalInvAddItemWizardTask

    I must be missing something else. 

    Buildfile: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\build.xml

    init:
         [echo] Using DLC             : C:/Progress/OpenEdge
         [echo] Using Assemblies from : C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Assemblies
         [echo] assemblies = C:/ProgressWrk/OspreyCommon_128109/SmartComponentLibrary/Assemblies
         [echo] autoTargetTriggerFilename = PhysicalInvAddItemWizardTask

    ExtractClassAnnotationsVsCode:
         [echo] autoTargetTriggerFilename PhysicalInvAddItemWizardTask
         [echo] Build Files: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\PhysicalInvAddItemWizardTask
         [echo] File Mask:   *BusinessEntity.cls,*Task.cls,*Service.cls,I*.cls,*Enum.cls,*Parameter.cls

    BUILD FAILED
    C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\build.xml:58: The following error occurred while executing this line:
    C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ExtractClassAnnotations\extract-class-annotations.xml:30: No .cls files in => [C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\PhysicalInvAddItemWizardTask]

    Total time: 0 seconds
     *  Terminal will be reused by tasks, press any key to close it.
  7. Peter Judge
    Peter Judge avatar
    16 posts
    Registered:
    11 Aug 2022
    12 Feb in reply to Roger Blanchard
    Link to this post
    I would expect this line to have a .cls on the end.
        [echo] autoTargetTriggerFilename = PhysicalInvAddItemWizardTask

    In your build.xml file, there's a line that looks something like this
        <property name="absolute.path" location="${autoTargetTriggerFilename}"/>

    If you replace that line with the below you may see more success
            <property="fileMask" value="${autoTargetTriggerFilename}" />
            <property name="absolute.path" value=""/>



  8. Roger Blanchard
    Roger Blanchard avatar
    443 posts
    Registered:
    29 Jun 2018
    12 Feb in reply to Peter Judge
    Link to this post
    I assume we will need to propath this process as the project we are running this task against references other projects. I tried adding the propath entries to the build.xml and I get BUILD FAILED
    C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\build.xml:59: unsupported element propath

    Buildfile: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\build.xml

    init:
         [echo] Using DLC             : C:/Progress/OpenEdge
         [echo] Using Assemblies from : C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Assemblies
         [echo] assemblies = C:/ProgressWrk/OspreyCommon_128109/SmartComponentLibrary/Assemblies
         [echo] autoTargetTriggerFilename = PhysicalInvAddItemWizardTask

    ExtractClassAnnotationsVsCode:
         [echo] autoTargetTriggerFilename PhysicalInvAddItemWizardTask
         [echo] Build Files: 
         [echo] File Mask:   *BusinessEntity.cls,*Task.cls,*Service.cls,I*.cls,*Enum.cls,*Parameter.cls
         [echo] Temp-File:   c:\temp\annotation1241351178
       [PCTRun] [ExtractClassParameter] Working-Directoy:        C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend 
       [PCTRun] [ExtractClassParameter] Directoy:                ./Osprey 
       [PCTRun] [ExtractClassParameter] FileMask:                *BusinessEntity.cls,*Task.cls,*Service.cls,I*.cls,*Enum.cls,*Parameter.cls 
       [PCTRun] [ExtractClassParameter] Build Files:             c:\temp\annotation1241351178 
       [PCTRun] [ExtractClassParameter] # Build Files:           1 
       [PCTRun] [ExtractClassParameter] ExcludeAnnotations:      @Test,@TestIgnore,@BusinessEntityGenerator,@lowercase,@TempTableMetaInformation 
       [PCTRun] [ExtractClassParameter] OnlyWriteModified:       yes 
       [PCTRun] [ExtractClassParameter] OverwriteWriteProtected: yes
       [PCTRun] [ExtractClassAnnotations] Initializing Annotation Generator.
       [PCTRun] poParameter:BuildFiles= c:\temp\annotation1241351178
       [PCTRun] [ExtractClassParameter] Processing: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\Osprey\Drizly\DrizlyExportTask.cls
       [PCTRun] [ExtractClassAnnotations] 1/0 - Osprey/Drizly/DrizlyExportTask.cls
       [PCTRun] An Consultingwerk.Studio.Proparse.ProparseException has occurred:
       [PCTRun] org.prorefactor.refactor.RefactorException: Error parsing DrizlyExportTask.cls
       [PCTRun] 
       [PCTRun] Original Exception: java.io.IOException: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\Osprey\Drizly\DrizlyExportTask.cls: Could not find include file: Osprey\Framework\GetGlobals.i
       [PCTRun] 
       [PCTRun]     at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:74)
       [PCTRun]     at com.joanju.proparse.Postlexer.<bridge>nextToken(Postlexer.java:1)
       [PCTRun]     at com.joanju.proparse.TokenList.build(TokenList.java:37)
       [PCTRun]     at com.joanju.proparse.DoParse.doParse(DoParse.java:149)
       [PCTRun]     at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:261)
       [PCTRun]     at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:224)
       [PCTRun]     at org.prorefactor.treeparser.ParseUnit.treeParser01(ParseUnit.java:325)
       [PCTRun]     at cli.Progress.ClrBridge.ClrApi.InvokeMethod(Unknown Source)
       [PCTRun]     at cli.Progress.ClrBridge.ClrFromPro.InvokeMethod(Unknown Source)
       [PCTRun]
       [PCTRun] java.lang.RuntimeException: java.io.IOException: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\Osprey\Drizly\DrizlyExportTask.cls: Could not find include file: Osprey\Framework\GetGlobals.i
       [PCTRun] java.io.IOException: C:\ProgressWrk\OspreyPOS_128109\OspreyPOSBackend\Osprey\Drizly\DrizlyExportTask.cls: Could not find include file: Osprey\Framework\GetGlobals.i
       [PCTRun] ParseFile Consultingwerk.Studio.Proparse.ProparseHelper at line 2039  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\Proparse\ProparseHelper.r)
       [PCTRun] ClassAnnotationParser Consultingwerk.Studio.ClassAnnotationParser at line 695  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ClassAnnotationParser.r)
       [PCTRun] Run Consultingwerk.Studio.ExtractClassAnnotations.ExtractClassAnnotationsJob at line 1164  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ExtractClassAnnotations\ExtractClassAnnotationsJob.r)   
       [PCTRun] Consultingwerk/Studio/ExtractClassAnnotations/extract-class-annotations.p at line 752  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ExtractClassAnnotations\extract-class-annotations.r)        
       [PCTRun] C:\Users\rblan\AppData\Local\Temp\pctinit254487785.p at line 56  (C:\Users\rblan\AppData\Local\Temp\pctinit254487785.p)
       [PCTRun]
       [PCTRun] Original Stack Trace:
       [PCTRun] ParseFile Consultingwerk.Studio.Proparse.ProparseHelper at line 2029  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\Proparse\ProparseHelper.r)
       [PCTRun] ClassAnnotationParser Consultingwerk.Studio.ClassAnnotationParser at line 695  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ClassAnnotationParser.r)
       [PCTRun] Run Consultingwerk.Studio.ExtractClassAnnotations.ExtractClassAnnotationsJob at line 1164  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\ExtractClassAnnotations\ExtractClassAnnotationsJob.r)   
       [PCTRun] Consultingwerk/Studio/ExtractClassAnnotations/extract-class-annotations.p at line 752  (C:\ProgressWrk\OspreyCommon_128109\SmartComponentLibrary\Consultingwerk\Studio\Ex
8 posts, 0 answered