`

如何打包引入第三方的UIAutomator项目

阅读更多

项目下新建custom_rules.xml文件

内空:

<?xml version="1.0" encoding="UTF-8"?>
<project name="custom_rules" default="release">
	<!-- Include external libs -->
	<property name="jar.libs.dir" value="libs" />
	<property name="jar.libs.absolute.dir" location="${jar.libs.dir}" />
	<path id="classpath">
		<fileset dir="${jar.libs.absolute.dir}">
			<include name="**/*.jar" />
		</fileset>
	</path>

	<!-- overwrite the compile target in uibuild.xml to include to external 
		jars -->
	<target name="compile" depends="-build-setup, -pre-compile">
		<javac encoding="${java.encoding}" source="${java.source}"
			target="${java.target}" debug="true" extdirs="" includeantruntime="false"
			destdir="${out.classes.absolute.dir}" bootclasspathref="project.target.class.path"
			verbose="${verbose}" fork="${need.javac.fork}">
			<src path="${source.absolute.dir}" />
			<classpath refid="classpath" />
			<compilerarg line="${java.compilerargs}" />
		</javac>
	</target>

	<!-- Converts this project's .class files into .dex files -->
	<target name="-dex" depends="compile, -post-compile">
		<dex executable="${dx}" output="${intermediate.dex.file}"
			nolocals="@{nolocals}" verbose="${verbose}">
			<fileset dir="${jar.libs.absolute.dir}">
				<include name="**/*.jar" />
			</fileset>
			<path path="${out.classes.absolute.dir}" />
		</dex>
	</target>

</project>

 

这样就ok了。 

 

参考:

 

 

Adding external jars to an Android UIautomator project

Ant如何打包UIAutomator项目用到的第三方JAR包

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics