티스토리 뷰

## Ant manual

http://ant.apache.org/manual/index.html


## ant 설치

http://ant.apache.org/


## path설정

ANT_HOME=D:\dev\build\apache-ant-1.9.7

PATH=%ANT_HOME%\bin;


## ant-contrib 설치 (파일 읽기)

http://ant-contrib.sourceforge.net/

ant-contrib-0.6-bin.zip



- build.properties -

sourcePath = /dev/worksspace/Solution
bashPath = C:\\Program Files\\Git\\bin\\bash


javaToClass.sh -

cat filelist | sed 's/\\/\//g' | sed 's/src\//bin\//g' | sed 's/\.java/\*\.class/g' > filelist2


- build.xml -

<project name="Class Extraction" default="export:class" basedir="D:\dev\build">
	<description>Test</description>
	<property file="${basedir}/build.properties"/>
	<echo message="${sourcePath}"/>
	
	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="ant-contrib-0.6-bin/lib/ant-contrib-0.6.jar"/>
		</classpath>
	</taskdef>

	<target name="runShell">
		<exec executable="${bashPath}">
			<arg value="javaToClass.sh"/>
		</exec>
	</target>

	<target name="clear">
		<delete dir="result"/>
		<mkdir dir="result"/>
	</target>

	<target name="loadfile:class">
		<loadfile property="filelist" srcfile="filelist2"/>
	</target>

	<target name="loadfile:java">
		<loadfile property="filelist" srcfile="filelist"/>
	</target>

	<target name="filecopy">
		<for param="line" list="${filelist}" delimiter="${line.separator}">
			<sequential>
				<copy todir="result">
					<fileset dir="${sourcePath}">
						<include name="@{line}"/>
					</fileset>
				</copy>
			</sequential>
		</for>

		<resourcecount property="count"> 
            <fileset dir="result"/>
        </resourcecount> 

        <echo message="------------------------------------------ "/> 
        <echo message="---------------- ${count} files ----------------"/> 
	</target>

	<target name="export:class" depends="runShell,loadfile:class,clear,filecopy"/>
	<target name="export:java" depends="loadfile:java,clear,filecopy"/>

</project>


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
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
글 보관함