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

Being able to clear parts of the generated code (or all the project)

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 2.0.0.Beta3
    • UI - Shell
    • None

      When prototyping using a Forge script, sometimes I would like to have a command that would delete parts of a project (or everything) from dependencies in the pom.xml to source code. Something like :

      jpa-clear              # deletes the code of the entities and the JPA dependencies
      jsf-clear              # deletes the backing bean and pages
      ...
      project-clear          # deletes everything (source code, and pom dependencies) leaving empty directories and artifactId and groupId
      

      And then I would be able to start again from scratch without leaving the CLI.

            [FORGE-1381] Being able to clear parts of the generated code (or all the project)

            This is what the resource transaction API is for.

            transaction-start
            
            // do some commands
            jpa-setup
            jpa-new-entity
            
            // OOPS did it wrong
            
            transaction-rollback
            

            Energy should be spent making this transaction API as robust and comprehensive as possible.

            Lincoln Baxter III (Inactive) added a comment - This is what the resource transaction API is for. transaction-start // do some commands jpa-setup jpa- new -entity // OOPS did it wrong transaction-rollback Energy should be spent making this transaction API as robust and comprehensive as possible.

            What do you mean be uninstalling facets ? Does this also mean deleting the code that has been generated ? I'm using Forge to do some quick prototyping and sometimes just want to erase and start everything again, something like :

            jpa-new-entity Customer
            jpa-new-field string name
            # got it wrong
            jpa-clear
            

            Antonio Goncalves (Inactive) added a comment - What do you mean be uninstalling facets ? Does this also mean deleting the code that has been generated ? I'm using Forge to do some quick prototyping and sometimes just want to erase and start everything again, something like : jpa- new -entity Customer jpa- new -field string name # got it wrong jpa-clear

            The implementation of these commands should preferably uninstall project facets (calling project.getFacet(XXX.class).uninstall())

            George Gastaldi added a comment - The implementation of these commands should preferably uninstall project facets (calling project.getFacet(XXX.class).uninstall())

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

                Created:
                Updated:
                Resolved: