Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67712

grunt does not work plugin types that are inside another component

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.9
    • Fix Version/s: 3.9
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Check the git status to make sure that you're clean

        git status
        

      2. Note the status for later

      Run all

      1. Delete all amd/build directories:

        # Delete all build directories
        find . -type d -path '*/amd/build' | sort -r | xargs  rm -rf
        

      2. Run grunt amd

        grunt amd
        

        1. Confirm that there were no changes (Compare against the one you noted earlier)

          git status
          

      Run all amd directories in forward order

      1. Delete all amd/build directories:

        find . -type d -path '*/amd/build' | sort -r | xargs  rm -rf
        

      2. Build all directories:

        for amdDir in `find . -type d -path '*/amd'`; do cd $amdDir; grunt amd; cd -; done
        

        1. Confirm that there were no changes (Compare against the one you noted earlier)

          git status
          

      Run all amd directories in reverse order

      1. Delete all amd/build directories:

        find . -type d -path '*/amd/build' | sort -r | xargs  rm -rf
        

      2. Build all directories in reverse:

        for amdDir in `find . -type d -path '*/amd' | sort -r`; do cd $amdDir; grunt amd; cd -; done
        

        1. Confirm that there were no changes (Compare against the one you noted earlier)

          git status
          

      Build a plugin in a subsystem

      1. Remove all amd/build directories in grade:

        find grade -type d -path '*/amd/build' | sort -r | xargs  rm -rf
        

      2. Build just the gradingform_guide plugin

        cd grade/grading/form/guide
        grunt amd
        

        1. Confirm that only the gradingform/guide plugin was built:

          git status
          

          Expected output:

          Changes not staged for commit:
            (use "git add/rm <file>..." to update what will be committed)
            (use "git checkout -- <file>..." to discard changes in working directory)
           
          	deleted:    ../../../amd/build/edittree_index.min.js
          	deleted:    ../../../amd/build/edittree_index.min.js.map
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/comparison.min.js
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/comparison.min.js.map
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/normalise.min.js
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/normalise.min.js.map
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/point.min.js
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/point.min.js.map
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/repository.min.js
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/repository.min.js.map
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/scale.min.js
          	deleted:    ../../../amd/build/grades/grader/gradingpanel/scale.min.js.map
          	deleted:    ../rubric/amd/build/grades/grader/gradingpanel.min.js
          	deleted:    ../rubric/amd/build/grades/grader/gradingpanel.min.js.map
           
          no changes added to commit (use "git add" and/or "git commit -a")
          

      3. Build just the subsystem:

        cd grade
        grunt amd
        

        1. Confirm that only files in grades/amd/build were built:

          grunt status
          

          Expected output:

          Changes not staged for commit:
            (use "git add/rm <file>..." to update what will be committed)
            (use "git checkout -- <file>..." to discard changes in working directory)
           
          	deleted:    grading/form/rubric/amd/build/grades/grader/gradingpanel.min.js
          	deleted:    grading/form/rubric/amd/build/grades/grader/gradingpanel.min.js.map
           
          no changes added to commit (use "git add" and/or "git commit -a")
          

      Show
      Setup Check the git status to make sure that you're clean git status Note the status for later Run all Delete all amd/build directories: # Delete all build directories find . -type d -path '*/amd/build' | sort -r | xargs rm -rf Run grunt amd grunt amd Confirm that there were no changes (Compare against the one you noted earlier) git status Run all amd directories in forward order Delete all amd/build directories: find . -type d -path '*/amd/build' | sort -r | xargs rm -rf Build all directories: for amdDir in `find . -type d -path '*/amd'`; do cd $amdDir; grunt amd; cd -; done Confirm that there were no changes (Compare against the one you noted earlier) git status Run all amd directories in reverse order Delete all amd/build directories: find . -type d -path '*/amd/build' | sort -r | xargs rm -rf Build all directories in reverse: for amdDir in `find . -type d -path '*/amd' | sort -r`; do cd $amdDir; grunt amd; cd -; done Confirm that there were no changes (Compare against the one you noted earlier) git status Build a plugin in a subsystem Remove all amd/build directories in grade: find grade -type d -path '*/amd/build' | sort -r | xargs rm -rf Build just the gradingform_guide plugin cd grade/grading/form/guide grunt amd Confirm that only the gradingform/guide plugin was built : git status Expected output: Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory)   deleted: ../../../amd/build/edittree_index.min.js deleted: ../../../amd/build/edittree_index.min.js.map deleted: ../../../amd/build/grades/grader/gradingpanel/comparison.min.js deleted: ../../../amd/build/grades/grader/gradingpanel/comparison.min.js.map deleted: ../../../amd/build/grades/grader/gradingpanel/normalise.min.js deleted: ../../../amd/build/grades/grader/gradingpanel/normalise.min.js.map deleted: ../../../amd/build/grades/grader/gradingpanel/point.min.js deleted: ../../../amd/build/grades/grader/gradingpanel/point.min.js.map deleted: ../../../amd/build/grades/grader/gradingpanel/repository.min.js deleted: ../../../amd/build/grades/grader/gradingpanel/repository.min.js.map deleted: ../../../amd/build/grades/grader/gradingpanel/scale.min.js deleted: ../../../amd/build/grades/grader/gradingpanel/scale.min.js.map deleted: ../rubric/amd/build/grades/grader/gradingpanel.min.js deleted: ../rubric/amd/build/grades/grader/gradingpanel.min.js.map   no changes added to commit (use "git add" and/or "git commit -a") Build just the subsystem: cd grade grunt amd Confirm that only files in grades/amd/build were built : grunt status Expected output: Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory)   deleted: grading/form/rubric/amd/build/grades/grader/gradingpanel.min.js deleted: grading/form/rubric/amd/build/grades/grader/gradingpanel.min.js.map   no changes added to commit (use "git add" and/or "git commit -a")
    • Workaround:
      Hide

      grunt amd in root directory

      Show
      grunt amd in root directory
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-67712-master

      Description

      grunt does not build for components which in a sub-directory of another component.
      for example:
      gradingform_* components because their directory is grade/grading/form and the grade component is in the grade directory.

      Steps to reproduce:

      cd grade/grading/form/guide
      rm amd/build -rf
      grunt amd

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              rezaie9 Shamim Rezaie
              Peer reviewer:
              Tim Hunt
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 55 minutes
                  55m