<?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="<!-- 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="<receiver android:name="jp.agentec.abook.abv.ui.widget.ABVAppWidgetProvider">.*?</receiver>" replace="" /> </target> <target name="-post-build" > <move encoding="utf-8" file="./AndroidManifest.xml_bk" overwrite="true" tofile="./AndroidManifest.xml" > </move> </target> </project>