Development and Pipeline

Development and Pipeline

Development and Pipeline

Connecting mainframe application developers to discuss efficiently creating and maintaining z/OS applications

 View Only
  • 1.  Programmatically creating a COBOL local project

    Posted 05/28/21 02:58 PM
    Hello,
    I have written an eclipse plugin to help set up our development environment in git. Part of that process is creating and populating a COBOL local project (which is also poorly named for searching in the create project wizard - it's called "Local Project" in the "Workstation COBOL or PL/I" folder.

    When I create the eclipse project and add the nature, it doesn't show up in the "z/OS Projects" view until I restart IDz. I assume this is because there is a check on startup. Is there a way to refresh the view, so I don't need to restart IDz?

    I am using something similar to the following:
    public static final String COBOL_LOCAL_PROJECT_NATURE_ID = "com.ibm.ftt.ui.views.project.navigator.local";
    public static final String[] COBOL_PROJECT_NATURES = new String[] { COBOL_LOCAL_PROJECT_NATURE_ID };
    String projectName = "copybooks";
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IProject project = workspaceRoot.getProject(projectName);
    if (!project.exists()) {
        project.create(null);
    }
    if(!project.isOpen()) {
        project.open(null);
    }
    IProjectDescription description = project.getDescription();
    description.setNatureIds(natures);
    project.setDescription(description, null);
    project.refreshLocal(IResource.DEPTH_INFINITE, null);
    ​


    Thanks,

    Adam Britt



    ------------------------------
    Adam Britt
    ------------------------------


  • 2.  RE: Programmatically creating a COBOL local project

    Posted 06/04/21 09:29 AM

    Hi Adam,

    In IDz 15 we tried to clarify the "poorly named" wizard.  We got rid of the "Workstation COBOL or PL/I" entry in the New ... wizards list. We also renamed the Local Project entry to now be named Local z/OS Project.

    More time will be required to investigate why a restart seems to be required for your programmatically created project, and if there is a way for you to refresh the z/OS Projects view.



    ------------------------------
    William Alexander
    Senior Software Engineer
    IBM
    ------------------------------