Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9436

refactor createPlugin task in gradle

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Upcoming Release
    • Component/s: None
    • Labels:
      None

      Description

      The createPlugin task suffers from copy-paste pattern that can be substantially reduced, Patch coming up momentarily.

      1. OFBIZ-9436.patch
        7 kB
        Taher Alkhateeb

        Activity

        Hide
        taher Taher Alkhateeb added a comment -

        Attaching diff which refactors the task as detailed below:

        Improved: refactored and improved the createPlugin task in gradle script

        Applied the following changes:

        • reduced the copy-paste pattern in creating the directory structure for a
          new component by converting the mkdir logic into a loop over a list of the
          directory names
        • reduced the copy-paste pattern in creating the files from their templates
          by converting the calls to the generator function to a loop over a list
          of maps containing the arguments to the generator function
        • added missing src/java/main and src/java/test
        • remove duplicate / redundant directories as creating child directory
          automatically creates the parent
        Show
        taher Taher Alkhateeb added a comment - Attaching diff which refactors the task as detailed below: Improved: refactored and improved the createPlugin task in gradle script Applied the following changes: reduced the copy-paste pattern in creating the directory structure for a new component by converting the mkdir logic into a loop over a list of the directory names reduced the copy-paste pattern in creating the files from their templates by converting the calls to the generator function to a loop over a list of maps containing the arguments to the generator function added missing src/java/main and src/java/test remove duplicate / redundant directories as creating child directory automatically creates the parent
        Hide
        taher Taher Alkhateeb added a comment -

        Applied commit in r1800073.

        Show
        taher Taher Alkhateeb added a comment - Applied commit in r1800073.
        Hide
        taher Taher Alkhateeb added a comment -

        Closing given simplicity of this commit. I also thoroughly tested the functionality and everything is passing.

        Hopefully, with the changes made to buildbot we can get the builds to succeed again.

        Show
        taher Taher Alkhateeb added a comment - Closing given simplicity of this commit. I also thoroughly tested the functionality and everything is passing. Hopefully, with the changes made to buildbot we can get the builds to succeed again.

          People

          • Assignee:
            taher Taher Alkhateeb
            Reporter:
            taher Taher Alkhateeb
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development