123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project name="ebidBuild" default="default" basedir=".">
- <property file="build.properties" />
-
- <target name="default">
- <echo message="selete target." />
- <echo message="profile active ${profiles.active}" />
- <echo message="java version ${java.version}" />
- <echo message="ant java version ${ant.java.version}" />
- <echo message="ant version ${ant.version}" />
- <echo message="oracle home ${oracle.home}" />
- </target>
-
- <target name="datetime" description="create current date" depends="default">
- <tstamp prefix="build-info">
- <format property="current-date" pattern="yyyy-MM-dd" />
- <format property="current-time" pattern="HH:mm:ss" />
- </tstamp>
- <echo message="Build started at : ${build-info.current-date} ${build-info.current-time}" />
- </target>
-
- <property name="build-directory" value="build"/>
- <property name="source-directory" value="java"/>
- <property name="web-directory" value="web"/>
- <property name="web-inf-directory" value="${build-directory}/${web-directory}/WEB-INF"/>
- <property name="lib-directory" value="${web-inf-directory}/lib"/>
- <property name="classes-directory" value="${web-inf-directory}/classes"/>
- <property name="class-path" value="WEB-INF/classes"/>
- <property name="war-file-name" value="ebidApp"/>
- <property name="war-portal-file-name" value="ebidPortalApp"/>
- <property name="weblogic.jar.file" value="${oracle.home}/wlserver_10.3/server/lib/weblogic.jar"/>
-
- <path id="classpath">
- <fileset file="${weblogic.jar.file}" />
- <fileset dir="${lib-directory}" includes="*.jar" />
- <fileset dir="${oracle.home}/modules" includes="*.jar" />
- </path>
-
- <target name="clean">
- <delete dir="${build-directory}" />
- <mkdir dir="${build-directory}" />
- </target>
-
- <target name="copy-non-java-files" depends="clean">
- <!-- web폴더의 모든 파일을 build폴더로 복사 'WEB-INF/classes'폴더 제외 -->
- <copy todir="${build-directory}/${web-directory}" includeemptydirs="false">
- <fileset dir="${web-directory}">
- <exclude name="${class-path}/" />
- </fileset>
- </copy>
- <!-- 소스폴더의 *.java 파일을 제외한 나머지 파일을 'WEB-INF/classes'폴더로 복사 -->
- <copy todir="${classes-directory}" includeemptydirs="false">
- <fileset dir="${source-directory}" excludes="**/*.java" />
- </copy>
-
- <!-- waf 설정을 build 파일에 포함 -->
- <!--copy todir="${build-directory}/${web-directory}/resources" includeemptydirs="false">
- <fileset dir="resources/${profiles.active}" />
- </copy-->
- </target>
-
- <!-- webPortal 설정 -->
- <target name="web-portal-files" depends="copy-non-java-files">
- <copy file="webPortal/jsp/ko_KR/index.jsp" tofile="${build-directory}/${web-directory}/jsp/ko_KR/index.jsp" overwrite="true" />
- </target>
-
- <target name="compile">
- <javac debug="yes" debuglevel="lines,vars,source" includeantruntime="false"
- destdir="${classes-directory}" source="1.6" target="1.6"
- encoding="UTF8">
- <src path="${source-directory}" />
- <classpath refid="classpath" />
- </javac>
-
- <!--jar jarfile="${lib-directory}/ebid.jar" basedir="${classes-directory}" />
- <delete dir="${classes-directory}" /-->
- </target>
-
- <target name="compile_web" depends="copy-non-java-files,compile" />
- <target name="compile_web_portal" depends="web-portal-files,compile" />
-
- <target name="war_web" depends="datetime,compile_web">
- <war warfile="${build-directory}/${war-file-name}.war" webxml="${web-inf-directory}/web.xml">
- <fileset dir="${build-directory}/${web-directory}" />
- <manifest>
- <attribute name="Built-On" value="${build-info.current-date}"/>
- <attribute name="Built-At" value="${build-info.current-time}"/>
- </manifest>
- </war>
- </target>
-
- <target name="war_web_portal" depends="datetime,compile_web_portal">
- <war warfile="${build-directory}/${war-portal-file-name}.war" webxml="${web-inf-directory}/web.xml">
- <fileset dir="${build-directory}/${web-directory}" />
- <manifest>
- <attribute name="Built-On" value="${build-info.current-date}"/>
- <attribute name="Built-At" value="${build-info.current-time}"/>
- </manifest>
- </war>
- </target>
- <taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy" classpath="${weblogic.jar.file}"/>
- <taskdef name="wlserver" classname="weblogic.ant.taskdefs.management.WLServer" classpath="${weblogic.jar.file}"/>
-
- <target name="undeploy">
- <wldeploy
- action="undeploy" verbose="true" debug="true"
- adminurl="${weblogic.deploy.url.admin}" targets="${weblogic.deploy.target}"
- user="${weblogic.deploy.user}" password="${weblogic.deploy.password}"
- name="${weblogic.deploy.name}" failonerror="false" usenonexclusivelock="true" />
- </target>
-
- <target name="deploy" depends="undeploy">
- <sleep seconds="10" />
- <wldeploy
- action="deploy" verbose="true" debug="true" remote="true" upload="true"
- user="${weblogic.deploy.user}" password="${weblogic.deploy.password}"
- adminurl="${weblogic.deploy.url.admin}" targets="${weblogic.deploy.target}"
- name="${weblogic.deploy.name}" source="${build-directory}/${war-file-name}.war"
- nostage="true" usenonexclusivelock="true" />
- <sleep seconds="10" />
- <wldeploy
- action="start" verbose="true" debug="true"
- user="${weblogic.deploy.user}" password="${weblogic.deploy.password}"
- adminurl="${weblogic.deploy.url.admin}" targets="${weblogic.deploy.target}"
- name="${weblogic.deploy.name}" />
- </target>
-
- <target name="undeploy_portal">
- <wldeploy
- action="undeploy" verbose="true" debug="true"
- adminurl="${weblogic.deploy.url.admin}" targets="${weblogic.deploy.portal.target}"
- user="${weblogic.deploy.user}" password="${weblogic.deploy.password}"
- name="${weblogic.deploy.portal.name}" failonerror="false" usenonexclusivelock="true" />
- </target>
-
- <target name="deploy_portal" depends="undeploy_portal">
- <sleep seconds="10" />
- <wldeploy
- action="deploy" verbose="true" debug="true" remote="true" upload="true"
- user="${weblogic.deploy.user}" password="${weblogic.deploy.password}"
- adminurl="${weblogic.deploy.url.admin}" targets="${weblogic.deploy.portal.target}"
- name="${weblogic.deploy.portal.name}" source="${build-directory}/${war-portal-file-name}.war"
- nostage="true" usenonexclusivelock="true" />
- <sleep seconds="10" />
- <wldeploy
- action="start" verbose="true" debug="true"
- user="${weblogic.deploy.user}" password="${weblogic.deploy.password}"
- adminurl="${weblogic.deploy.url.admin}" targets="${weblogic.deploy.portal.target}"
- name="${weblogic.deploy.portal.name}" />
- </target>
-
- <!-- 전자조달 시스템 빌드,배포 -->
- <target name="start" depends="war_web,deploy" />
- <target name="startNonWar" depends="compile_web,deploy" />
-
- <!-- 전자조달 시스템 협력사 빌드,배포 -->
- <target name="startPortal" depends="war_web_portal,deploy_portal" />
- <target name="startPortalNonWar" depends="compile_web_portal,deploy_portal" />
- </project>
|