Browse Source

Ant打包修复

wangxl 8 years ago
parent
commit
b7c60c5d69
1 changed files with 19 additions and 17 deletions
  1. 19 17
      display-client/build/build.xml

+ 19 - 17
display-client/build/build.xml

68
			-I ${android-jar} -S ${project_home}/${res-dir}"/>
68
			-I ${android-jar} -S ${project_home}/${res-dir}"/>
69
  		<for list="${libraries}" param="library">
69
  		<for list="${libraries}" param="library">
70
            <sequential>
70
            <sequential>
71
            	<available property="isExist_library_res" file="@{library}/res" type="dir" />
71
            	<available property="isExist_library_res_r" file="@{library}/res" type="dir" />
72
72
73
    			<if>
73
    			<if>
74
    			    <equals arg1="${isExist_library_res}" arg2="true" />
74
    			    <equals arg1="${isExist_library_res_r}" arg2="true" />
75
    			    <then>
75
    			    <then>
76
                        <var name="p" value="${p} -S @{library}/${res-dir}"/>
76
                        <var name="p" value="${p} -S @{library}/${res-dir}"/>
77
    			    </then>
77
    			    </then>
88
	
88
	
89
	<target name="aapt_gererateR_library">
89
	<target name="aapt_gererateR_library">
90
		<echo>gererate R.java with ${library}</echo>
90
		<echo>gererate R.java with ${library}</echo>
91
		<available property="isExist_library_res" file="${library}/res" type="dir" />
91
		<available property="isExist_library_r_l" file="${library}/res" type="dir" />
92
		<!-- 是否需要参数 -S ${library}/${res-dir} -->
92
		<!-- 是否需要参数 -S ${library}/${res-dir} -->
93
		<if>
93
		<if>
94
		    <equals arg1="${isExist_library_res}" arg2="true" />
94
		    <equals arg1="${isExist_library_r_l}" arg2="true" />
95
		    <then>
95
		    <then>
96
		    	<var name="param" value="-S ${library}/${res-dir}"/>
96
		    	<var name="param" value="-S ${library}/${res-dir}"/>
97
		    </then>
97
		    </then>
127
	<!-- 编译java文件为class文件 -->
127
	<!-- 编译java文件为class文件 -->
128
	<target name="compile">
128
	<target name="compile">
129
129
130
        <available property="isExist_host_libs" file="${host-libs}" type="dir" />
130
        <available property="isExist_host_libs_h" file="${host-libs}" type="dir" />
131
131
132
        <if>
132
        <if>
133
            <equals arg1="${isExist_host_libs}" arg2="true" />
133
            <equals arg1="${isExist_host_libs_h}" arg2="true" />
134
            <then>
134
            <then>
135
                <copydir src="${host-libs}"
135
                <copydir src="${host-libs}"
136
                 dest="${host-bin}/libs"/>
136
                 dest="${host-bin}/libs"/>
138
        </if>
138
        </if>
139
        <for list="${libraries}" param="library">
139
        <for list="${libraries}" param="library">
140
            <sequential>
140
            <sequential>
141
                <available property="isExist_library_libs" file="@{library}/libs" type="dir" />
141
                <available property="isExist_library_libs_l" file="@{library}/libs" type="dir" />
142
142
143
                <if>
143
                <if>
144
                    <equals arg1="${isExist_library_libs}" arg2="true" />
144
                    <equals arg1="${isExist_library_libs_l}" arg2="true" />
145
                    <then>
145
                    <then>
146
                        <copydir src="@{library}/libs"
146
                        <copydir src="@{library}/libs"
147
                                 dest="${host-bin}/libs"
147
                                 dest="${host-bin}/libs"
200
	    <echo>Packaging dex...</echo>
200
	    <echo>Packaging dex...</echo>
201
        <var name="dex_p" value="--dex --output=${intermediate-dex} ${host-classes}"/>
201
        <var name="dex_p" value="--dex --output=${intermediate-dex} ${host-classes}"/>
202
202
203
        <available property="isExist_host_libs" file="${host-libs}" type="dir" />
203
        <available property="isExist_host_libs_dx" file="${host-libs}" type="dir" />
204
204
205
        <if>
205
        <if>
206
            <equals arg1="${isExist_host_libs}" arg2="true" />
206
            <equals arg1="${isExist_host_libs_dx}" arg2="true" />
207
            <then>
207
            <then>
208
                <var name="dex_p" value="${dex_p} ${host-libs}"/>
208
                <var name="dex_p" value="${dex_p} ${host-libs}"/>
209
            </then>
209
            </then>
211
211
212
        <for list="${libraries}" param="library">
212
        <for list="${libraries}" param="library">
213
            <sequential>
213
            <sequential>
214
                <available property="isExist_library_libs" file="@{library}/libs" type="dir" />
214
                <available property="isExist_host_libs_dx_l" file="@{library}/libs" type="dir" />
215
215
216
                <if>
216
                <if>
217
                    <equals arg1="${isExist_library_libs}" arg2="true" />
217
                    <equals arg1="${isExist_host_libs_dx_l}" arg2="true" />
218
                    <then>
218
                    <then>
219
                        <var name="dex_p" value="${dex_p} @{library}/libs"/>
219
                        <var name="dex_p" value="${dex_p} @{library}/libs"/>
220
                    </then>
220
                    </then>
236
        <var name="temp" value=""/>
236
        <var name="temp" value=""/>
237
        <for list="${libraries}" param="library">
237
        <for list="${libraries}" param="library">
238
            <sequential>
238
            <sequential>
239
                <available property="isExist_library_res" file="@{library}/res" type="dir" />
239
                <available property="isExist_library_res_aapt" file="@{library}/res" type="dir" />
240
240
241
                <if>
241
                <if>
242
                    <equals arg1="${isExist_library_res}" arg2="true" />
242
                    <equals arg1="${isExist_library_res_aapt}" arg2="true" />
243
                    <then>
243
                    <then>
244
                        <var name="temp" value="${temp} -S @{library}/${res-dir}"/>
244
                        <var name="temp" value="${temp} -S @{library}/${res-dir}"/>
245
                    </then>
245
                    </then>
248
            </sequential>
248
            </sequential>
249
        </for>
249
        </for>
250
250
251
        <echo>------------------------------</echo>
252
        <echo>${temp}</echo>
253
251
        <var name="res_p" value="package -f -M ${project_home}/${manifest-xml} -S ${project_home}/${res-dir} ${temp} -A ${project_home}/${asset-dir} -I ${android-jar} -F ${resources-package} --auto-add-overlay"/>
254
        <var name="res_p" value="package -f -M ${project_home}/${manifest-xml} -S ${project_home}/${res-dir} ${temp} -A ${project_home}/${asset-dir} -I ${android-jar} -F ${resources-package} --auto-add-overlay"/>
252
255
253
		<exec executable="${aapt}" failonerror="true">
256
		<exec executable="${aapt}" failonerror="true">
263
        <var name="temp" value=""/>
266
        <var name="temp" value=""/>
264
        <for list="${libraries}" param="library">
267
        <for list="${libraries}" param="library">
265
            <sequential>
268
            <sequential>
266
                <available property="isExist_library_libs" file="@{library}/libs" type="dir" />
269
                <available property="isExist_library_libs_builder" file="@{library}/libs" type="dir" />
267
270
268
                <if>
271
                <if>
269
                    <equals arg1="${isExist_library_libs}" arg2="true" />
272
                    <equals arg1="${isExist_library_libs_builder}" arg2="true" />
270
                    <then>
273
                    <then>
271
                        <var name="temp" value="${temp} -nf @{library}/libs -rj @{library}/libs"/>
274
                        <var name="temp" value="${temp} -nf @{library}/libs -rj @{library}/libs"/>
272
                    </then>
275
                    </then>
273
                </if>
276
                </if>
274
            </sequential>
277
            </sequential>
275
        </for>
278
        </for>
276
277
        <var name="apkBuild_p" value="${out-unsigned-package} -u -z ${resources-package} -f ${intermediate-dex} -rf ${host-src} ${temp}"/>
279
        <var name="apkBuild_p" value="${out-unsigned-package} -u -z ${resources-package} -f ${intermediate-dex} -rf ${host-src} ${temp}"/>
278
280
279
	    <java classpath="${android_apk_tools}/lib/sdklib.jar" classname="com.android.sdklib.build.ApkBuilderMain" fork="true" failonerror="true">
281
	    <java classpath="${android_apk_tools}/lib/sdklib.jar" classname="com.android.sdklib.build.ApkBuilderMain" fork="true" failonerror="true">