본문 바로가기
server/linux

ant 설정

by "뭉치" 2021. 8. 26.
728x90

했던거 다시 봐도 모르것네..

<?xml version="1.0" encoding="utf-8"?>
<project name="family" default="default">
	<!-- <property environment="env" /> -->
	<property name="name" value="${ant.project.name}" />
	<property name="baseDir" location="WebContent" />
	<property name="common" location="${baseDir}/common" />
	<property name="css" location="${baseDir}/css" />
	<property name="images" location="${baseDir}/images" />
	<property name="js" location="${baseDir}/js" />
	<property name="resources" location="${baseDir}/resources" />
	
	<property name="target.common" location="${baseDir}/common" />
	<property name="target.css" location="${baseDir}/css" />
	<property name="target.images" location="${baseDir}/images" />
	<property name="target.js" location="${baseDir}/js" />
	<property name="target.resources" location="${baseDir}/resources" />
	
	<property name="src" location="src" />
	<property name="src.webappsPath" location="WebContent" />
	<property name="bin" location="build/classes" />
	
	<!-- <property name="deploy.target.basedir" location="${env.deploy.target.basedir}/${name}" />
	<property name="deploy.target.wasPath.lib" location="${env.deploy.target.wasPath}/lib" />
	<property name="deploy.target.webappsPath" location="${deploy.target.basedir}/WebContent" />
	 -->
	 <property name="deploy.target.basedir" location="c:/server/family"/>
	 <property name="deploy.target.wasPath.lib" location="C:/server/tomcat/apache-tomcat-8.5.23/lib" />
	 <property name="deploy.target.webappsPath" location="${deploy.target.basedir}/WebContent" />
	 
	<path id="compile.classpath">
		<fileset dir="${deploy.target.wasPath.lib}" />
		<fileset dir="${src.webappsPath}/WEB-INF/lib" />
		<fileset dir="${src.webappsPath}/WEB-INF/classes" />
	</path>
	
	<target name="default" depends="copy web source" description="copy changed web source files" />
	
	<!-- static Web 소스를 HTML 폴더로부터 복사한다. -->
	<target name="copy web source" description="copy web source files">
		<echo message="copy web source files..." />
		<copy todir="${target.common}">
			<fileset dir="${common}" />
		</copy>
		<copy todir="${target.css}">
			<fileset dir="${css}" />
		</copy>
		<copy todir="${target.images}">
			<fileset dir="${images}" />
		</copy>
		<copy todir="${target.js}">
			<fileset dir="${js}" />
		</copy>
		<copy todir="${target.resources}">
			<fileset dir="${resources}" />
		</copy>
	</target>
	
	<!-- 컴파일 후 배포 -->
	<target name="deploy" depends="compile, copy webapps source" description="Cleaning target directory and copy changed source files" />
	
	<!-- 배포 대상 경로 초기화 -->
	<target name="init" description="Deploy target path initializing.">
		<mkdir dir="${deploy.target.basedir}" />
	</target>
	
	<!-- 배포 대상 경로를 삭제한다. -->
	<target name="clean target" description="Clean files" depends="init">
		<delete dir="${deploy.target.webappsPath}" />
	</target>
	
	<!-- 소스코드를 컴파일 한다. -->
	<target name="compile" description="Compile Java source files" depends="init">
		<mkdir dir="${bin}" />
		<copy todir="${bin}">
			<fileset dir="${src}">
				<include name="**/**.xml"/>
				<include name="**/**.properties"/>
			</fileset>
		</copy>
		<javac srcdir="${src}" destdir="${bin}" debug="on" deprecation="on" target="1.8" classpathref="compile.classpath" encoding="ms949" includeantruntime="false" />
	</target>
	
	<!-- Web Application 파일들을 배포 대상경로에 복사한다. -->
	<target name="copy webapps source" description="Copy webapps files">
		<copy todir="${deploy.target.webappsPath}">
			<fileset dir="${src.webappsPath}" />
		</copy>
		<copy todir="${deploy.target.webappsPath}/WEB-INF/classes">
			<fileset dir="${bin}" />
		</copy>
	</target>
	
	<!-- <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
		<fileset dir="src/html/myapp" />
		<fileset dir="src/jsp/myapp" />
		<lib dir="thirdparty/libs">
			<exclude name="jdbc1.jar" />
		</lib>
		<classes dir="build/main" />
		<zipfileset dir="src/graphics/images/gifs" prefix="images" />
	</war> -->
	
</project>
728x90

'server > linux' 카테고리의 다른 글

linux 기본기능 스크롤 업..  (0) 2021.08.25
기본설정  (0) 2021.08.24
SSH Key 만들기  (0) 2021.08.23
linux root password && useradd  (0) 2021.08.22
메모리 확인  (0) 2021.08.21

댓글