custom_rules.xml 2.7 KB
Newer Older
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
<?xml version="1.0" encoding="UTF-8"?>
<project name="custom_rules">
	<property name="mediastreamer.package.name" value="org.linphone.mediastream" />

	<target name="partial-clean">
	    <delete file="bin/${ant.project.name}.ap_" />
	</target>

	<target name="javadoc">
		<echo level="info">Generate Javadoc</echo>
		<javadoc 
			destdir="${javadoc.dir}"
			verbose="off" 
			use="true" 
			classpath="${sdk.dir}/platforms/${target}/android.jar:libs/android-support-v4.jar:libs/gcm.jar"
			sourcepath="${source.dir}:gen"
			linkoffline="http://developer.android.com/reference file:/${sdk.dir}/docs/reference"
			stylesheetfile="${sdk.dir}/docs/assets/android-developer-docs.css">
		</javadoc>
	</target>

	<target name="-package-resources" depends="-crunch">	    
		<!-- only package resources if *not* a library project -->
		<do-only-if-not-library elseText="Library project: do not package resources...">
			<exec executable="${aapt}" failonerror="true">
				<arg value="package" />
				<arg value="-f" />
				<arg value="-v" />
				<arg value="--version-code" />
				<arg value="${version.code}" />
				<arg value="--version-name" />
				<arg value="${version.name}" />
				<arg value="--debug-mode" />
				<arg value="-m" />
				<arg value="-u" />
				<arg value="-J" />
				<arg path="${gen.absolute.dir}" />
				<arg value="-M" />
				<arg path="${out.manifest.abs.file}" />
				<arg value="-I" />
				<arg path="${project.target.android.jar}" />
				<arg value="-F" />
				<arg path="${out.absolute.dir}/${resource.package.file.name}" />
				<arg value="-S" />
				<arg path="${resource.absolute.dir}" />
				<arg value="--rename-manifest-package" />
				<arg value="${mediastreamer.package.name}" />
				<arg value="--custom-package" />
				<arg value="${mediastreamer.package.name}" />
			</exec> 
		</do-only-if-not-library>
	</target>

	<target name="run">
		<exec executable="adb">
			<arg value="shell" />
			<arg value="am" />
			<arg value="start" />
			<arg value="-a" />
			<arg value="android.intent.action.MAIN" />
			<arg value="-n" />
			<arg value="${mediastreamer.package.name}/org.linphone.mediastream.MediastreamerActivity" />
		</exec>
	</target>

	<target name="mediastreamer2-sdk">
		<echo level="info">Creating library output jar file...</echo>
		<property name="out.library.jar.file" location="${out.absolute.dir}/libmediastreamer2.jar" />
		<jar destfile="${out.library.jar.file}">
			<fileset dir="${out.classes.absolute.dir}"
				includes="org/linphone/mediastream/**/*.class" />
		</jar>
		<zip destfile="libmediastreamer2-sdk-${version.name}.zip">
			<zipfileset dir="libs" prefix="libs" includes="**/*.so" />
			<zipfileset dir="${out.absolute.dir}" includes="libmediastreamer2.jar" prefix="libs"/>
		</zip>
	</target>

</project>