-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
119 lines (111 loc) · 4.41 KB
/
build.xml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<project name="nsen" default="ProductionWar">
<description>WARファイル作成 build.xml</description>
<property name="build.FilePath" value="target/nsen.war"/>
<property name="build.OutputDir" value="src/main/webapp/WEB-INF/classes"/>
<property name="build.SourceDir" value="src/main/java"/>
<property name="build.ResourceDir" value="src/main/resources"/>
<property name="build.webinf" value="src/main/webapp/WEB-INF"/>
<property name="Tomcat" value="C:\Users\admin\pleiades\tomcat\7.0"/>
<!-- 本番用設定ファイルパス -->
<property name="build.Production" value="src/main/resources/production"/>
<!-- ビルドに必要なファイル群 -->
<path id="build.classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${build.webinf}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${Tomcat}\lib">
<include name="*.jar"/>
</fileset>
</path>
<!-- 本番環境用のWARファイルを作成 -->
<target name="ProductionWar">
<antcall target="Clean"/>
<antcall target="Compile"/>
<antcall target="CopyProductionFile"/>
<antcall target="ProductionPackage"/>
<!-- 再度コンパイルをすることで開発環境の状態に戻します。 -->
<antcall target="Compile"/>
</target>
<!-- コンパイル先を整備 -->
<target name="Clean">
<delete dir="target"/>
<mkdir dir="target"/>
<delete>
<fileset dir="${build.OutputDir}"/>
</delete>
</target>
<!-- コンパイル -->
<target name="Compile">
<javac destdir="${build.OutputDir}"
encoding="UTF-8"
includeantruntime="false"
fork="false">
<src>
<pathelement location="${build.SourceDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.OutputDir}" overwrite="true">
<fileset dir="${build.ResourceDir}">
<include name="*.dicon"/>
<include name="*.properties"/>
<include name="**/*.xls"/>
<include name="**/*.sql"/>
<include name="**/*.ftl"/>
<!-- env.txtを含まなければCoolDeployとなります -->
</fileset>
</copy>
</target>
<!-- 本番環境用の設定ファイルをコピー -->
<target name="CopyProductionFile">
<copy todir="${build.OutputDir}" overwrite="true">
<fileset dir="${build.Production}">
<include name="*.dicon"/>
<include name="*.properties"/>
</fileset>
</copy>
</target>
<!-- WARファイルを作成 -->
<target name="Package">
<war destfile="${build.FilePath}" webxml="${basedir}/${build.webinf}/web.xml">
<webinf dir="${basedir}/${build.webinf}/">
<include name="*.xml"/>
<include name="**/*.tld"/>
<include name="view/**"/>
<exclude name="web.xml"/>
</webinf>
<lib dir="${basedir}/${build.webinf}/lib" includes="*.jar"/>
<classes dir="${build.OutputDir}"/>
<fileset dir="${basedir}/src/main/webapp">
<include name="css/**"/>
<include name="img/**"/>
<include name="js/**"/>
<include name="font/**"/>
<include name="favicon.ico"/>
</fileset>
</war>
</target>
<!-- 本番用WARファイルを作成 -->
<target name="ProductionPackage">
<war destfile="${build.FilePath}" webxml="${basedir}/${build.webinf}/web.xml">
<webinf dir="${basedir}/${build.webinf}/">
<include name="*.xml"/>
<include name="**/*.tld"/>
<include name="view/**"/>
<exclude name="web.xml"/>
</webinf>
<lib dir="${basedir}/${build.webinf}/lib" includes="*.jar"/>
<classes dir="${build.OutputDir}"/>
<fileset dir="${basedir}/src/main/webapp">
<include name="css/**"/>
<include name="img/**"/>
<include name="js/**"/>
<include name="font/**"/>
<include name="favicon.ico"/>
</fileset>
</war>
</target>
</project>