Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 266 lines (232 sloc) 11.029 kB
308a6e5 @tdiesler [AS7-5494] Add support for a modular AS7 build
tdiesler authored
1 <!--
2 ~ JBoss, Home of Professional Open Source.
3 ~ Copyright 2012, Red Hat, Inc., and individual contributors
4 ~ as indicated by the @author tags. See the copyright.txt file in the
5 ~ distribution for a full listing of individual contributors.
6 ~
7 ~ This is free software; you can redistribute it and/or modify it
8 ~ under the terms of the GNU Lesser General Public License as
9 ~ published by the Free Software Foundation; either version 2.1 of
10 ~ the License, or (at your option) any later version.
11 ~
12 ~ This software is distributed in the hope that it will be useful,
13 ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ~ Lesser General Public License for more details.
16 ~
17 ~ You should have received a copy of the GNU Lesser General Public
18 ~ License along with this software; if not, write to the Free
19 ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 -->
22
23 <project name="modular-config" basedir="." default="all">
24
25 <property name="build.resources.dir" value="${basedir}/../build/src/main/resources" />
26 <property name="server.input.dir" value="${basedir}/../build/target/jboss-as-${jboss.as.release.version}" />
27 <property name="server.output.dir" value="target/jboss-as-${modular.config.name}-${jboss.as.release.version}" />
28 <property name="standalone.configs.target" value="${server.output.dir}/standalone/configuration" />
29 <property name="domain.configs.target" value="${server.output.dir}/domain/configuration" />
30 <property name="generated.standalone.subsystems" value="${basedir}/target/standalone-subsystems.xml" />
31 <property name="generated.standalone.dependencies" value="${basedir}/target/standalone-module-dependencies.txt" />
32 <property name="generated.standalone.configuration" value="${basedir}/target/standalone.xml" />
33 <property name="generated.domain.subsystems" value="${basedir}/target/domain-subsystems.xml" />
34 <property name="generated.domain.dependencies" value="${basedir}/target/domain-module-dependencies.txt" />
35 <property name="generated.domain.configuration" value="${basedir}/target/domain.xml" />
36 <property name="console.enabled.${console.enabled}" value="${console.enabled}"/>
37 <property name="domain.enabled.${domain.enabled}" value="${domain.enabled}"/>
38 <property name="standalone.extra.modules" value="" />
39 <property name="domain.extra.modules" value="" />
40
41 <property name="standalone.bootstrap.modules" value="org.jboss.as.standalone,org.jboss.as.domain-http-error-context" />
42 <property name="domain.bootstrap.modules" value="org.jboss.as.host-controller" />
43 <property name="console.modules" value="org.jboss.as.console" />
44
45 <!-- See ServerDependenciesProcessor -->
46 <property name="common.dependencies" value="
47 sun.jdk,
48 ibm.jdk,
49 javaee.api,
50 javax.api,
51 org.jboss.logging,
52 org.jboss.vfs,
53 org.apache.commons.logging,
54 org.apache.log4j,
55 org.slf4j,
56 org.jboss.logging.jul-to-slf4j-stub"/>
57
58 <target name="all" depends="generate-standalone-configs,generate-domain-configs,build-standalone-server,build-domain-server" />
59
60 <target name="init" >
61 <condition property="console.enabled.modules" value="${console.modules}" else="">
62 <isset property="console.enabled.true"/>
63 </condition>
64 </target>
65
66 <target name="init.standalone" depends="init">
67 <property name="standalone.seed.modules" value="${standalone.bootstrap.modules},${standalone.extra.modules},${console.enabled.modules},${common.dependencies}"/>
68 </target>
69
70 <target name="init.domain" depends="init" if="domain.enabled.true">
71 <property name="domain.seed.modules" value="${domain.bootstrap.modules},${domain.extra.modules},${console.enabled.modules},${common.dependencies}"/>
72 </target>
73
74 <target name="generate-standalone-configs" depends="init.standalone" description="Generate the standalone configurations">
75
76 <generate-subsystem-definition
77 paramConfiguredSubsystems="${standalone.subsystems}"
78 paramProfiles=""
79 paramOutputFile="${generated.standalone.subsystems}" />
80
81 <generate-module-dependencies
82 paramGeneratedSubsystems="${generated.standalone.subsystems}"
83 paramProfile=""
84 paramResourcesDir="${build.resources.dir}"
85 paramStaticModules="${standalone.seed.modules}"
86 paramOutputFile="${generated.standalone.dependencies}" />
87
88 <generate-server-config
89 paramTemplateFile="${standalone.template}"
90 paramSubsystemsFile="${generated.standalone.subsystems}"
91 paramOutputFile="${generated.standalone.configuration}" />
92
93 </target>
94
95 <target name="build-standalone-server" depends="init.standalone" description="Build the standalone server">
96 <!-- make output file directory -->
97 <mkdir dir="${server.output.dir}" />
98 <delete>
99 <fileset dir="${server.output.dir}">
100 <include name="**/*" />
101 </fileset>
102 </delete>
103
104 <!-- Copy the non-generated server files from the standard build -->
105 <copy todir="${server.output.dir}">
106 <fileset dir="${server.input.dir}">
107 <exclude name="standalone/configuration/standalone*.xml" />
108 <exclude name="domain/**" />
109 <exclude name="modules/**" />
110 <exclude name="bin/domain*.*" />
111 </fileset>
112 </copy>
113
114 <!-- Copy the generated server configurations -->
115 <copy file="${generated.standalone.configuration}" tofile="${server.output.dir}/standalone/configuration/standalone.xml" />
116
117 <!-- Copy the generated modules from the standard build -->
118 <copy todir="${server.output.dir}/modules">
119 <fileset dir="${server.input.dir}/modules" includesfile="${generated.standalone.dependencies}"/>
120 </copy>
121
122 <!-- These files contain digested passwords, which should not be visible to external users -->
123 <chmod perm="600" file="${server.output.dir}/standalone/configuration/mgmt-users.properties" />
124 <chmod perm="755">
125 <fileset dir="${server.output.dir}/bin">
126 <include name="**/*.sh" />
127 </fileset>
128 </chmod>
129 </target>
130
131 <target name="generate-domain-configs" depends="init.domain" description="Generate the domain configurations" if="domain.enabled.true">
132
133 <generate-subsystem-definition
134 paramConfiguredSubsystems="${domain.subsystems}"
135 paramProfiles="default,ha,full,full-ha"
136 paramOutputFile="${generated.domain.subsystems}" />
137
138 <generate-module-dependencies
139 paramGeneratedSubsystems="skip-subsystems"
140 paramProfile="default"
141 paramResourcesDir="${build.resources.dir}"
142 paramStaticModules="${domain.seed.modules}"
143 paramOutputFile="${generated.domain.dependencies}" />
144
145 <generate-domain-config
146 paramTemplateFile="${domain.template}"
147 paramSubsystemsFile="${generated.domain.subsystems}"
148 paramOutputFile="${generated.domain.configuration}" />
149
150 </target>
151
152 <target name="build-domain-server" depends="init.domain" description="Build the domain server" if="domain.enabled.true">
153
154 <!-- Copy the non-generated server files from the standard build -->
155 <copy todir="${server.output.dir}">
156 <fileset dir="${server.input.dir}">
157 <include name="domain/**" />
158 <include name="bin/domain*.*" />
159 <exclude name="domain/configuration/domain*.xml" />
160 </fileset>
161 </copy>
162
163 <!-- Copy the generated server configurations -->
164 <copy file="${generated.domain.configuration}" tofile="${server.output.dir}/domain/configuration/domain.xml" />
165
166 <!-- Copy the generated modules from the standard build -->
167 <copy todir="${server.output.dir}/modules">
168 <fileset dir="${server.input.dir}/modules" includesfile="${generated.domain.dependencies}"/>
169 </copy>
170
171 <!-- These files contain digested passwords, which should not be visible to external users -->
172 <chmod perm="600" file="${server.output.dir}/domain/configuration/mgmt-users.properties" />
173 <chmod perm="755">
174 <fileset dir="${server.output.dir}/bin">
175 <include name="**/*.sh" />
176 </fileset>
177 </chmod>
178 </target>
179
180 <macrodef name="generate-subsystem-definition">
181 <attribute name="paramConfiguredSubsystems" />
182 <attribute name="paramProfiles" />
183 <attribute name="paramOutputFile" />
184 <sequential>
185 <echo>Generate subsystems definition for @{paramConfiguredSubsystems} to @{paramOutputFile}</echo>
186 <java classname="org.jboss.as.config.assembly.GenerateSubsystemsDefinition" fork="true">
187 <!--jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/-->
188 <classpath>
189 <path refid="maven.compile.classpath" />
190 </classpath>
191 <arg value="@{paramConfiguredSubsystems}" />
192 <arg value="@{paramProfiles}" />
193 <arg value="configuration/subsystems" />
194 <arg value="@{paramOutputFile}" />
195 </java>
196 </sequential>
197 </macrodef>
198
199 <macrodef name="generate-module-dependencies">
200 <attribute name="paramGeneratedSubsystems" />
201 <attribute name="paramProfile" />
202 <attribute name="paramResourcesDir" />
203 <attribute name="paramStaticModules" />
204 <attribute name="paramOutputFile" />
205 <sequential>
206 <echo>Generate module dependencies from @{paramGeneratedSubsystems} to @{paramOutputFile}</echo>
207 <echo>Static modules: [@{paramStaticModules}]</echo>
208 <java classname="org.jboss.as.config.assembly.GenerateModulesDefinition" fork="true">
209 <classpath>
210 <path refid="maven.compile.classpath" />
211 </classpath>
212 <arg value="@{paramGeneratedSubsystems}" />
213 <arg value="@{paramProfile}" />
214 <arg value="@{paramResourcesDir}" />
215 <arg value="@{paramStaticModules}" />
216 <arg value="@{paramOutputFile}" />
217 </java>
218 </sequential>
219 </macrodef>
220
221 <macrodef name="generate-server-config">
222 <attribute name="paramTemplateFile" />
223 <attribute name="paramSubsystemsFile" />
224 <attribute name="paramOutputFile" />
225 <sequential>
226 <generate-configuration
227 paramTemplateFile="@{paramTemplateFile}"
228 paramSubsystemsFile="@{paramSubsystemsFile}"
229 paramOutputFile="@{paramOutputFile}"
230 className="StandaloneMain" />
231 </sequential>
232 </macrodef>
233
234 <macrodef name="generate-domain-config">
235 <attribute name="paramTemplateFile" />
236 <attribute name="paramSubsystemsFile" />
237 <attribute name="paramOutputFile" />
238 <sequential>
239 <generate-configuration
240 paramTemplateFile="@{paramTemplateFile}"
241 paramSubsystemsFile="@{paramSubsystemsFile}"
242 paramOutputFile="@{paramOutputFile}"
243 className="DomainMain" />
244 </sequential>
245 </macrodef>
246
247 <macrodef name="generate-configuration">
248 <attribute name="paramTemplateFile" />
249 <attribute name="paramSubsystemsFile" />
250 <attribute name="paramOutputFile" />
251 <attribute name="className" />
252 <sequential>
253 <echo>Merging standalone @{paramTemplateFile} and @{paramSubsystemsFile} into @{paramOutputFile}, using @{className}</echo>
254 <java classname="org.jboss.as.config.assembly.@{className}">
255 <classpath>
256 <path refid="maven.compile.classpath" />
257 </classpath>
258 <arg value="${generated.configs.src.dir}" />
259 <arg value="${generated.configs.src.dir}/@{paramTemplateFile}" />
260 <arg value="@{paramSubsystemsFile}" />
261 <arg value="@{paramOutputFile}" />
262 </java>
263 </sequential>
264 </macrodef>
265 </project>
Something went wrong with that request. Please try again.