|
544 | 544 | <if>
|
545 | 545 | <not><equals arg1="${js_source_path}" arg2="__NOT_FOUND__"/></not>
|
546 | 546 | <then>
|
| 547 | + <property name="has-js-path" value="true"/> |
547 | 548 | <if>
|
548 | 549 | <available type="dir" file="${upgrade_export}/plugins/${plugin}/${js_source_path}"/>
|
549 | 550 | <then>
|
| 551 | + <property name="js-required" value="true"/> |
550 | 552 | <copy todir="${upgrade_export}/plugins/${plugin}/${js_source_path}">
|
551 | 553 | <fileset dir="${local_repository_root}/plugins/${plugin}/${js_source_path}" defaultexcludes="false">
|
552 | 554 | <include name="*/**"/>
|
|
559 | 561 | <if>
|
560 | 562 | <not><equals arg1="${css_source_path}" arg2="__NOT_FOUND__"/></not>
|
561 | 563 | <then>
|
| 564 | + <property name="has-css-path" value="true"/> |
562 | 565 | <if>
|
563 | 566 | <available type="dir" file="${upgrade_export}/plugins/${plugin}/${css_source_path}"/>
|
564 | 567 | <then>
|
| 568 | + <property name="css-required" value="true"/> |
565 | 569 | <copy todir="${upgrade_export}/plugins/${plugin}/${css_source_path}">
|
566 | 570 | <fileset dir="${local_repository_root}/plugins/${plugin}/${css_source_path}" defaultexcludes="false">
|
567 | 571 | <include name="*/**"/>
|
|
571 | 575 | </if>
|
572 | 576 | </then>
|
573 | 577 | </if>
|
574 |
| - <echo message="REBUILD JS FOR PLUGIN ${plugin}"/> |
575 |
| - <copy todir="${upgrade_export}/plugins/${plugin}"> |
576 |
| - <fileset dir="${local_repository_root}/plugins/${plugin}"> |
577 |
| - <include name="Gruntfile.js"/> |
578 |
| - <include name="package.json"/> |
579 |
| - </fileset> |
580 |
| - </copy> |
581 |
| - <phingcall target="grunt"> |
582 |
| - <property name="plugin_abs_dir" override="true" value="${upgrade_export}/plugins/${plugin}"/> |
583 |
| - </phingcall> |
| 578 | + <if> |
| 579 | + <or> |
| 580 | + <available property="js-required"/> |
| 581 | + <available property="css-required"/> |
| 582 | + </or> |
| 583 | + <then> |
| 584 | + <echo message="REBUILDING JS FOR PLUGIN ${plugin}"/> |
| 585 | + <copy todir="${upgrade_export}/plugins/${plugin}"> |
| 586 | + <fileset dir="${local_repository_root}/plugins/${plugin}"> |
| 587 | + <include name="Gruntfile.js"/> |
| 588 | + <include name="package.json"/> |
| 589 | + </fileset> |
| 590 | + </copy> |
| 591 | + |
| 592 | + <property name="grunt-target" value=""/> |
| 593 | + <if> |
| 594 | + <and> |
| 595 | + <available property="js-required"/> |
| 596 | + <available property="has-css-path"/> |
| 597 | + <not><available property="css-required"/></not> |
| 598 | + </and> |
| 599 | + <then> |
| 600 | + <property name="grunt-target" value="type:js"/> |
| 601 | + </then> |
| 602 | + <elseif> |
| 603 | + <available property="css-required"/> |
| 604 | + <available property="has-js-path"/> |
| 605 | + <not><available property="js-required"/></not> |
| 606 | + <then> |
| 607 | + <property name="grunt-target" value="type:css"/> |
| 608 | + </then> |
| 609 | + </elseif> |
| 610 | + </if> |
| 611 | + |
| 612 | + <phingcall target="grunt"> |
| 613 | + <property name="plugin_abs_dir" override="true" value="${upgrade_export}/plugins/${plugin}"/> |
| 614 | + <property name="grunt_target" value="${grunt-target}"/> |
| 615 | + </phingcall> |
| 616 | + </then> |
| 617 | + </if> |
584 | 618 | </then>
|
585 | 619 | </if>
|
586 | 620 | <!-- Looking for Composer.json File -->
|
|
610 | 644 | </target>
|
611 | 645 |
|
612 | 646 | <target name="grunt">
|
| 647 | + <if> |
| 648 | + <available property="grunt_target"/> |
| 649 | + <then> |
| 650 | + <property name="command" value="grunt ${grunt_target}"/> |
| 651 | + </then> |
| 652 | + <else> |
| 653 | + <property name="command" value="grunt"/> |
| 654 | + </else> |
| 655 | + </if> |
613 | 656 | <if>
|
614 | 657 | <available file="${plugin_abs_dir}/package.json"/>
|
615 | 658 | <then>
|
616 | 659 | <!-- BUILD JAVASCRIPT -->
|
617 | 660 | <exec command="npm install" dir="${plugin_abs_dir}" passthru="true"/>
|
618 |
| - <exec command="grunt" dir="${plugin_abs_dir}" passthru="true"/> |
| 661 | + <exec command="${command}" dir="${plugin_abs_dir}" passthru="true"/> |
619 | 662 | <delete dir="${plugin_abs_dir}/node_modules"/>
|
620 | 663 | </then>
|
621 | 664 | </if>
|
|
0 commit comments