android - Converting custom_rules.xml to a gradle version -
i'm working on existing project relies heavily on lot of configuration custom_rules.xml ant build. i've looked around online have yet come across explicitly dealing such task in great detail. i've played around gradle , tried doing suggested approaches nothing has worked yet. if point me in right direction appreciate it.
edit: need rebuild using gradle. love rid off doing via command line not mention handling dependencies , etc.
<?xml version="1.0" encoding="utf-8"?>
set pre compile
<!-- ========================================================================================= --> <!-- once update android sdk, please copy target build.xml under android sdk --> <!-- ========================================================================================= --> <!-- updates pre-processed png cache --> <target name="-crunch"> <echo>set crunch</echo> <exec executable="${aapt}" taskname="crunch"> <arg value="crunch" /> <arg value="-v" /> <arg value="-s" /> <arg path="${resource.absolute.dir}" /> <arg value="-c" /> <arg path="${out.res.absolute.dir}" /> </exec> </target> <!-- ========================================================================================= --> <!-- once update android sdk, please copy target build.xml under android sdk --> <!-- ========================================================================================= --> <!-- puts project's resources output package file can create multiple resource package in case custom apk specific configuration have been declared in default.properties. --> <target name="-package-resources" depends="-crunch"> <!-- package resources if *not* library project --> <echo>made crunch</echo> <do-only-if-not-library elsetext="library project: not package resources..." > <aapt executable="${aapt}" command="package" versioncode="${version.code}" versionname="${version.name}" debug="${build.is.packaging.debug}" manifest="${out.manifest.abs.file}" assets="${asset.absolute.dir}" androidjar="${project.target.android.jar}" apkfolder="${out.absolute.dir}" nocrunch="${build.packaging.nocrunch}" resourcefilename="${resource.package.file.name}" resourcefilter="${aapt.resource.filter}" libraryresfolderpathrefid="project.library.res.folder.path" librarypackagesrefid="project.library.packages" libraryrfilerefid="project.library.bin.r.file.path" previousbuildtype="${build.last.target}" buildtype="${build.target}" ignoreassets="${aapt.ignore.assets}" manifestpackage="com.myproj"> <res path="${out.res.absolute.dir}" /> <res path="${resource.absolute.dir}" /> <!-- <nocompress /> forces no compression on files in assets or res/raw --> <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets , res/raw --> </aapt> </do-only-if-not-library> </target> <target name="-post-package" > <property name="config_path" location="${cert.dir}" /> <property name="out.pre.signlib.signed.file" location="${out.absolute.dir}/${ant.project.name}-release-pre-signlib-sign.apk" /> <property name="out.signlib.signed.file" location="${out.absolute.dir}/${ant.project.name}-release-signlib-signed.apk" /> <echo>sign signlib certificate</echo> <touch file="res/raw/my.properties"/> <copy file="${out.packaged.file}" tofile="${out.pre.signlib.signed.file}"/> <java jar="apksigtool.jar" failonerror="true" fork="true"> <arg value="${out.packaged.file}"/> <arg value="private_key.der" /> <arg value="my.crt" /> </java> <copy file="${out.packaged.file}" tofile="${out.signlib.signed.file}"/> </target>
Comments
Post a Comment