Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

266 lines (232 sloc) 11.029 kb
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2012, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<project name="modular-config" basedir="." default="all">
<property name="build.resources.dir" value="${basedir}/../build/src/main/resources" />
<property name="server.input.dir" value="${basedir}/../build/target/jboss-as-${jboss.as.release.version}" />
<property name="server.output.dir" value="target/jboss-as-${modular.config.name}-${jboss.as.release.version}" />
<property name="standalone.configs.target" value="${server.output.dir}/standalone/configuration" />
<property name="domain.configs.target" value="${server.output.dir}/domain/configuration" />
<property name="generated.standalone.subsystems" value="${basedir}/target/standalone-subsystems.xml" />
<property name="generated.standalone.dependencies" value="${basedir}/target/standalone-module-dependencies.txt" />
<property name="generated.standalone.configuration" value="${basedir}/target/standalone.xml" />
<property name="generated.domain.subsystems" value="${basedir}/target/domain-subsystems.xml" />
<property name="generated.domain.dependencies" value="${basedir}/target/domain-module-dependencies.txt" />
<property name="generated.domain.configuration" value="${basedir}/target/domain.xml" />
<property name="console.enabled.${console.enabled}" value="${console.enabled}"/>
<property name="domain.enabled.${domain.enabled}" value="${domain.enabled}"/>
<property name="standalone.extra.modules" value="" />
<property name="domain.extra.modules" value="" />
<property name="standalone.bootstrap.modules" value="org.jboss.as.standalone,org.jboss.as.domain-http-error-context" />
<property name="domain.bootstrap.modules" value="org.jboss.as.host-controller" />
<property name="console.modules" value="org.jboss.as.console" />
<!-- See ServerDependenciesProcessor -->
<property name="common.dependencies" value="
sun.jdk,
ibm.jdk,
javaee.api,
javax.api,
org.jboss.logging,
org.jboss.vfs,
org.apache.commons.logging,
org.apache.log4j,
org.slf4j,
org.jboss.logging.jul-to-slf4j-stub"/>
<target name="all" depends="generate-standalone-configs,generate-domain-configs,build-standalone-server,build-domain-server" />
<target name="init" >
<condition property="console.enabled.modules" value="${console.modules}" else="">
<isset property="console.enabled.true"/>
</condition>
</target>
<target name="init.standalone" depends="init">
<property name="standalone.seed.modules" value="${standalone.bootstrap.modules},${standalone.extra.modules},${console.enabled.modules},${common.dependencies}"/>
</target>
<target name="init.domain" depends="init" if="domain.enabled.true">
<property name="domain.seed.modules" value="${domain.bootstrap.modules},${domain.extra.modules},${console.enabled.modules},${common.dependencies}"/>
</target>
<target name="generate-standalone-configs" depends="init.standalone" description="Generate the standalone configurations">
<generate-subsystem-definition
paramConfiguredSubsystems="${standalone.subsystems}"
paramProfiles=""
paramOutputFile="${generated.standalone.subsystems}" />
<generate-module-dependencies
paramGeneratedSubsystems="${generated.standalone.subsystems}"
paramProfile=""
paramResourcesDir="${build.resources.dir}"
paramStaticModules="${standalone.seed.modules}"
paramOutputFile="${generated.standalone.dependencies}" />
<generate-server-config
paramTemplateFile="${standalone.template}"
paramSubsystemsFile="${generated.standalone.subsystems}"
paramOutputFile="${generated.standalone.configuration}" />
</target>
<target name="build-standalone-server" depends="init.standalone" description="Build the standalone server">
<!-- make output file directory -->
<mkdir dir="${server.output.dir}" />
<delete>
<fileset dir="${server.output.dir}">
<include name="**/*" />
</fileset>
</delete>
<!-- Copy the non-generated server files from the standard build -->
<copy todir="${server.output.dir}">
<fileset dir="${server.input.dir}">
<exclude name="standalone/configuration/standalone*.xml" />
<exclude name="domain/**" />
<exclude name="modules/**" />
<exclude name="bin/domain*.*" />
</fileset>
</copy>
<!-- Copy the generated server configurations -->
<copy file="${generated.standalone.configuration}" tofile="${server.output.dir}/standalone/configuration/standalone.xml" />
<!-- Copy the generated modules from the standard build -->
<copy todir="${server.output.dir}/modules">
<fileset dir="${server.input.dir}/modules" includesfile="${generated.standalone.dependencies}"/>
</copy>
<!-- These files contain digested passwords, which should not be visible to external users -->
<chmod perm="600" file="${server.output.dir}/standalone/configuration/mgmt-users.properties" />
<chmod perm="755">
<fileset dir="${server.output.dir}/bin">
<include name="**/*.sh" />
</fileset>
</chmod>
</target>
<target name="generate-domain-configs" depends="init.domain" description="Generate the domain configurations" if="domain.enabled.true">
<generate-subsystem-definition
paramConfiguredSubsystems="${domain.subsystems}"
paramProfiles="default,ha,full,full-ha"
paramOutputFile="${generated.domain.subsystems}" />
<generate-module-dependencies
paramGeneratedSubsystems="skip-subsystems"
paramProfile="default"
paramResourcesDir="${build.resources.dir}"
paramStaticModules="${domain.seed.modules}"
paramOutputFile="${generated.domain.dependencies}" />
<generate-domain-config
paramTemplateFile="${domain.template}"
paramSubsystemsFile="${generated.domain.subsystems}"
paramOutputFile="${generated.domain.configuration}" />
</target>
<target name="build-domain-server" depends="init.domain" description="Build the domain server" if="domain.enabled.true">
<!-- Copy the non-generated server files from the standard build -->
<copy todir="${server.output.dir}">
<fileset dir="${server.input.dir}">
<include name="domain/**" />
<include name="bin/domain*.*" />
<exclude name="domain/configuration/domain*.xml" />
</fileset>
</copy>
<!-- Copy the generated server configurations -->
<copy file="${generated.domain.configuration}" tofile="${server.output.dir}/domain/configuration/domain.xml" />
<!-- Copy the generated modules from the standard build -->
<copy todir="${server.output.dir}/modules">
<fileset dir="${server.input.dir}/modules" includesfile="${generated.domain.dependencies}"/>
</copy>
<!-- These files contain digested passwords, which should not be visible to external users -->
<chmod perm="600" file="${server.output.dir}/domain/configuration/mgmt-users.properties" />
<chmod perm="755">
<fileset dir="${server.output.dir}/bin">
<include name="**/*.sh" />
</fileset>
</chmod>
</target>
<macrodef name="generate-subsystem-definition">
<attribute name="paramConfiguredSubsystems" />
<attribute name="paramProfiles" />
<attribute name="paramOutputFile" />
<sequential>
<echo>Generate subsystems definition for @{paramConfiguredSubsystems} to @{paramOutputFile}</echo>
<java classname="org.jboss.as.config.assembly.GenerateSubsystemsDefinition" fork="true">
<!--jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/-->
<classpath>
<path refid="maven.compile.classpath" />
</classpath>
<arg value="@{paramConfiguredSubsystems}" />
<arg value="@{paramProfiles}" />
<arg value="configuration/subsystems" />
<arg value="@{paramOutputFile}" />
</java>
</sequential>
</macrodef>
<macrodef name="generate-module-dependencies">
<attribute name="paramGeneratedSubsystems" />
<attribute name="paramProfile" />
<attribute name="paramResourcesDir" />
<attribute name="paramStaticModules" />
<attribute name="paramOutputFile" />
<sequential>
<echo>Generate module dependencies from @{paramGeneratedSubsystems} to @{paramOutputFile}</echo>
<echo>Static modules: [@{paramStaticModules}]</echo>
<java classname="org.jboss.as.config.assembly.GenerateModulesDefinition" fork="true">
<classpath>
<path refid="maven.compile.classpath" />
</classpath>
<arg value="@{paramGeneratedSubsystems}" />
<arg value="@{paramProfile}" />
<arg value="@{paramResourcesDir}" />
<arg value="@{paramStaticModules}" />
<arg value="@{paramOutputFile}" />
</java>
</sequential>
</macrodef>
<macrodef name="generate-server-config">
<attribute name="paramTemplateFile" />
<attribute name="paramSubsystemsFile" />
<attribute name="paramOutputFile" />
<sequential>
<generate-configuration
paramTemplateFile="@{paramTemplateFile}"
paramSubsystemsFile="@{paramSubsystemsFile}"
paramOutputFile="@{paramOutputFile}"
className="StandaloneMain" />
</sequential>
</macrodef>
<macrodef name="generate-domain-config">
<attribute name="paramTemplateFile" />
<attribute name="paramSubsystemsFile" />
<attribute name="paramOutputFile" />
<sequential>
<generate-configuration
paramTemplateFile="@{paramTemplateFile}"
paramSubsystemsFile="@{paramSubsystemsFile}"
paramOutputFile="@{paramOutputFile}"
className="DomainMain" />
</sequential>
</macrodef>
<macrodef name="generate-configuration">
<attribute name="paramTemplateFile" />
<attribute name="paramSubsystemsFile" />
<attribute name="paramOutputFile" />
<attribute name="className" />
<sequential>
<echo>Merging standalone @{paramTemplateFile} and @{paramSubsystemsFile} into @{paramOutputFile}, using @{className}</echo>
<java classname="org.jboss.as.config.assembly.@{className}">
<classpath>
<path refid="maven.compile.classpath" />
</classpath>
<arg value="${generated.configs.src.dir}" />
<arg value="${generated.configs.src.dir}/@{paramTemplateFile}" />
<arg value="@{paramSubsystemsFile}" />
<arg value="@{paramOutputFile}" />
</java>
</sequential>
</macrodef>
</project>
Jump to Line
Something went wrong with that request. Please try again.