forked from picketlink/picketlink-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
165 lines (135 loc) · 8.29 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!--
~ JBoss, Home of Professional Open Source
~ Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
~ as indicated by the @author tags. All rights reserved.
~ See the copyright.txt in the distribution for a
~ full listing of individual contributors.
~
~ This copyrighted material is made available to anyone wishing to use,
~ modify, copy, or redistribute it subject to the terms and conditions
~ of the GNU Lesser General Public License, v. 2.1.
~ This program is distributed in the hope that it will be useful, but WITHOUT A
~ 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,
~ v.2.1 along with this distribution; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
~ MA 02110-1301, USA.
-->
<project name="PicketLink AS7 Installer" default="install" basedir=".">
<property file="installer.properties"/>
<property name="installer.dir" value="${basedir}"/>
<target name="install" depends="prepare,backup-as7-files,install-picketlink-eap,install-picketlink-wildfly">
<echo>
################################################################
Thanks for using PicketLink.
################################################################
</echo>
</target>
<target name="prepare">
<mkdir dir="./tmp"/>
<echo>
####################################################################################
Welcome to the PicketLink Installer
This installer will update your JBoss Application Server installation with the
following libraries and their dependencies:
- PicketLink Core ${picketlink.version}
- PicketLink Identity Management ${picketlink.version}
- PicketLink Federation ${picketlink.version}
New modules will be added to your installation.
####################################################################################
</echo>
<input message="Which JBoss Application Server are you using ?" addproperty="target.container" defaultvalue="eap" validargs="eap,wildfly"/>
<input message="Please enter the path to your JBoss Application Server installation: " addproperty="jboss.as.dist.dir"/>
<script language="javascript">
<![CDATA[
serverLocation = project.getProperty("jboss.as.dist.dir");
if(serverLocation.isEmpty()){
println("You must specify a valid location to a existing JBoss Application Server installation..");
java.lang.System.exit(1)
}
]]>
</script>
<property name="modules.dir" value="${jboss.as.dist.dir}/modules/system/layers/base"/>
</target>
<target name="re-install-check">
<condition property="reinstall.check">
<and>
<available file="${jboss.as.dist.dir}/standalone/configuration/standalone.xml.bkp"/>
</and>
</condition>
</target>
<target name="eap.check.test">
<condition property="eap.check">
<equals arg1="${target.container}" arg2="eap"/>
</condition>
</target>
<target name="wildfly.check.test">
<condition property="wildfly.check">
<equals arg1="${target.container}" arg2="wildfly"/>
</condition>
</target>
<target name="backup-as7-files" if="reinstall.check" depends="re-install-check"
description="Backup the standalone.xml.">
<echo message="Backing up the original standalone.xml file and org/picketlink/main directory."/>
<delete dir="${modules.dir}/org/picketlink/main/"/>
<copydir src="${modules.dir}/org/picketlink.bkp" dest="${modules.dir}/org/picketlink" />
<copy file="${jboss.as.dist.dir}/standalone/configuration/standalone.xml.bkp" failonerror="false" overwrite="true"
tofile="${jboss.as.dist.dir}/standalone/configuration/standalone.xml"/>
<delete dir="${modules.dir}/org/picketlink/common/"/>
<delete dir="${modules.dir}/org/picketlink/config/"/>
<delete dir="${modules.dir}/org/picketlink/core/"/>
<delete dir="${modules.dir}/org/picketlink/idm/"/>
<delete dir="${modules.dir}/org/picketlink/federation/"/>
</target>
<target name="pre-install-picketlink" description="Update the PicketLink Module libraries and definition">
<echo>Updating PicketLink Modules ...</echo>
<copydir src="${modules.dir}/org/picketlink" dest="${modules.dir}/org/picketlink.bkp" forceoverwrite="true" />
<copy file="${jboss.as.dist.dir}/standalone/configuration/standalone.xml"
tofile="${jboss.as.dist.dir}/standalone/configuration/standalone.xml.bkp"/>
<copydir src="config/${target.container}/module" dest="${modules.dir}/org/picketlink/" forceoverwrite="true"/>
<property name="picketlink.common.lib.file" value="${installer.dir}/config/lib/picketlink-common-${picketlink.version}.jar"/>
<property name="picketlink.config.lib.file" value="${installer.dir}/config/lib/picketlink-config-${picketlink.version}.jar"/>
<property name="picketlink.core.api.lib.file" value="${installer.dir}/config/lib/picketlink-api-${picketlink.version}.jar"/>
<property name="picketlink.core.impl.lib.file" value="${installer.dir}/config/lib/picketlink-impl-${picketlink.version}.jar"/>
<property name="picketlink.idm.api.lib.file" value="${installer.dir}/config/lib/picketlink-idm-api-${picketlink.version}.jar"/>
<property name="picketlink.idm.impl.lib.file" value="${installer.dir}/config/lib/picketlink-idm-impl-${picketlink.version}.jar"/>
<property name="picketlink.idm.schema.lib.file" value="${installer.dir}/config/lib/picketlink-idm-simple-schema-${picketlink.version}.jar"/>
<copy todir="${modules.dir}/org/picketlink/common/main" file="${picketlink.common.lib.file}" />
<copy todir="${modules.dir}/org/picketlink/config/main" file="${picketlink.config.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/core/api/main" file="${picketlink.core.api.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/core/main" file="${picketlink.core.impl.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/idm/api/main" file="${picketlink.idm.api.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/idm/main" file="${picketlink.idm.impl.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/idm/schema/main" file="${picketlink.idm.schema.lib.file}"/>
<delete>
<fileset dir="${modules.dir}/org/picketlink/main">
<include name="*.jar"/>
</fileset>
</delete>
</target>
<target name="install-picketlink-eap" description="Update the PicketLink Module libraries and definition" depends="eap.check.test,pre-install-picketlink" if="eap.check">
<echo>Updating PicketLink Module for JBoss Enterprise Application Platform 6...</echo>
<property name="picketlink.federation.lib.file" value="${installer.dir}/config/lib/picketlink-federation-${picketlink.version}.jar"/>
<property name="picketlink.bindings.jbas7.lib.file" value="${installer.dir}/config/lib/picketlink-jbas7-${picketlink.version}.jar"/>
<copy todir="${modules.dir}/org/picketlink/federation/main" file="${picketlink.federation.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/federation/bindings/main" file="${picketlink.bindings.jbas7.lib.file}"/>
<delete>
<fileset dir="${modules.dir}/org/picketlink/main">
<include name="*.jar"/>
</fileset>
</delete>
</target>
<target name="install-picketlink-wildfly" description="Update the PicketLink Module libraries and definition" depends="wildfly.check.test,pre-install-picketlink" if="wildfly.check">
<echo>Updating PicketLink Module for Wildfly...</echo>
<property name="picketlink.federation.lib.file" value="${installer.dir}/config/lib/picketlink-federation-${picketlink.version}.jar"/>
<property name="picketlink.bindings.wildfly8.lib.file" value="${installer.dir}/config/lib/picketlink-wildfly8-${picketlink.version}.jar"/>
<copy todir="${modules.dir}/org/picketlink/federation/main" file="${picketlink.federation.lib.file}"/>
<copy todir="${modules.dir}/org/picketlink/federation/bindings/main" file="${picketlink.bindings.wildfly8.lib.file}"/>
<delete>
<fileset dir="${modules.dir}/org/picketlink/main">
<include name="*.jar"/>
</fileset>
</delete>
</target>
</project>