Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-2280

Being able to use ~ as the top level package root directory

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Duplicate
    • Major
    • 2.x Future
    • 2.15.1.Final
    • UI - Shell
    • None

    Description

      In Forge 1.x there was this notion of project root (with ~) but also the top level package root (with {}). So we could write something like that :

      new-project --named test --topLevelPackage com.mycomp.myproj
      java new-class --named Test --package ~.constraints
      Wrote com.mycomp.myproj.constraints.Test.java
      

      With the --package .constraints paramater, it will create a class under com.mycomp.myproj.constraints because {} represents the top level package com.mycomp.myproj.

      This is not possible with Forge 2.x. The same code in Forge 2.x produces the following exception :

      project-new --named test --topLevelPackage com.mycomp.myproj
      java-new-class --named Test --targetPackage ~.constraints
      Exception when parsing/running: java-new-class --named Test6 --targetPackage ~.constraints, Invalid identifier : >~<
      

      When writing Forge scripts, it's much easier and reusable to be able to use the ~ represents the top level package.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: