custom_rules.xml 1.39 KB
Newer Older
Lee Jaebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
<?xml version="1.0" encoding="UTF-8"?>
<project>

    <target name="gradle-build" >
        <antcall target="-pre-build" />
    </target>

    <target name="-pre-build" >

        <antcall target="not_use_widget" />
        <antcall target="homeApp" />
         
    </target>

    <target
        name="homeApp"
        if="${isHomeApp}" >

        <echo message="Home app is true" />

        <replaceregexp
            encoding="UTF-8"
            file="./AndroidManifest.xml"
            flags="gs"
            match="HOME START"
            replace="HOME START -->" />

        <replaceregexp
            encoding="UTF-8"
            file="./AndroidManifest.xml"
            flags="gs"
            match="HOME END"
            replace="&lt;!-- HOME END" />
    </target>

    <target
        name="not_use_widget"
        if="${not_use_widget}" >

        <echo message="not.use.widget is true" />

        <replaceregexp
            encoding="UTF-8"
            file="./AndroidManifest.xml"
            flags="gs"
            match="&lt;receiver android:name=&quot;jp.agentec.abook.abv.ui.widget.ABVAppWidgetProvider&quot;>.*?&lt;/receiver>"
            replace="" />
    </target>

    <target name="-post-build" >

        <move
            encoding="utf-8"
            file="./AndroidManifest.xml_bk"
            overwrite="true"
            tofile="./AndroidManifest.xml" >
        </move>
    </target>

</project>