Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 317 lines (232 sloc) 10.827 kb
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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
<project basedir="." default="disp" name="GT4.0 Nimbus Context Broker GAR">

    <description>GT4.0 context broker GAR builder</description>

    <!-- load user nimbus.build.properties file, if it exists -->
    <property file="${user.home}/nimbus.build.properties" />

    <!-- load defaults from colocated build.properties file -->
    <property file="build.properties" />


    <!-- *******************************************************************
LOCATE GT DEPENDENCIES
******************************************************************* -->

    <property environment="env"/>
    <property name="abs.deploy.dir"
              location="${env.GLOBUS_LOCATION}"/>
    <property name="gt4_0.lib.dir"
              location="${abs.deploy.dir}/lib"/>
    <property name="build.packages"
              location="${nimbus.messaging.gt4_0.gar.build.packages.xml}"/>
    <property name="build.stubs"
              location="${abs.deploy.dir}/share/globus_wsrf_tools/build-stubs.xml"/>


    <!-- *******************************************************************
GT RELATED PROPERTIES
******************************************************************* -->

    <!-- gar.name -->
    <property name="gar.name"
              value="${nimbusctx.gt4_0.gar.dist.dir}/${nimbusctx.gt4_0.gar.package.name}.gar"/>

    <!-- garjars.id -->
    <fileset dir="${nimbusctx.gt4_0.gar.build.lib.dir}" id="garjars"/>
    <property name="garjars.id" value="garjars"/>

    <!-- garetc.id -->
    <fileset dir="${nimbusctx.gt4_0.gar.build.etc.dir}" id="garEtc"/>
    <property name="garetc.id" value="garEtc"/>

    <!--
<property name="noSchema" value="true"/>
If we want to deploy the WSDL, we must *not* set this property at all
-->

    <property name="garserverdeployment.file"
              location="${nimbusctx.gt4_0.gar.wsddfile}"/>

    <property name="garjndiconfigdeployment.file"
              location="${nimbusctx.gt4_0.gar.jndifile}"/>

    <!-- *********************
unused GAR properties
setting these to avoid build warning messages from GT...
********************* -->

    <!-- garshare.id -->
    <fileset dir="${nimbusctx.gt4_0.gar.build.share.dir}" id="garshare"/>
    <property name="garshare.id" value="garshare"/>

    <!-- garschema.id -->
    <fileset dir="${nimbusctx.gt4_0.gar.build.schema.dir}" id="garschema"/>
    <property name="garschema.id" value="garschema"/>

    <!-- gardocs.id -->
    <fileset dir="${nimbusctx.gt4_0.gar.build.docs.dir}" id="gardocs"/>
    <property name="gardocs.id" value="gardocs"/>

    <!-- garbin.id -->
    <fileset dir="${nimbusctx.gt4_0.gar.build.bin.dir}" id="garbin"/>
    <property name="garbin.id" value="garbin"/>



    <!-- *******************************************************************
MODULE NAME
******************************************************************* -->

    <target name="disp">
        <echo message="**** Module: ${basedir}" />
    </target>


    <!-- *******************************************************************
CHECK MINIMUM JDK
******************************************************************* -->

    <target name="checkjdk">
        <available property="jdk1.4+" classname="java.lang.CharSequence"/>
        <fail message="Aborting: determined you are not building with >= JDK 1.4"
              unless="jdk1.4+" />
    </target>


    <!-- *******************************************************************
INITIALIZE
******************************************************************* -->

    <target name="init" depends="checkjdk">
        <mkdir dir="${nimbusctx.gt4_0.gar.build.dir}"/>
        <mkdir dir="${nimbusctx.gt4_0.gar.build.lib.dir}"/>
        <mkdir dir="${nimbusctx.gt4_0.gar.build.etc.dir}"/>
        <mkdir dir="${nimbusctx.gt4_0.gar.build.share.dir}"/>
        <mkdir dir="${nimbusctx.gt4_0.gar.build.docs.dir}"/>
        <mkdir dir="${nimbusctx.gt4_0.gar.build.bin.dir}"/>
        <mkdir dir="${nimbusctx.gt4_0.gar.dist.dir}"/>
    </target>


    <!-- *******************************************************************
CHECK FOR COMPONENTS
******************************************************************* -->

    <target name="check" depends="init">

        <copy todir="${nimbusctx.gt4_0.gar.build.lib.dir}">

            <fileset dir="${nimbusctx.gt4_0.stubs.dist}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>
            <fileset dir="${nimbusctx.gt4_0.service.dist}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>

        </copy>

    </target>


    <!-- *******************************************************************
COPIES FOR LIB DIRECTORY FOR STANDALONE DISTRIBUTION
******************************************************************* -->
    
    <target name="copy_libraries" depends="init">

        <copy todir="${nimbusctx.gt4_0.gar.build.lib.dir}">

            <fileset dir="${nimbusctx.baselibservices.dir}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>
            <fileset dir="${nimbusctx.service.api.dist.dir}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>
            <fileset dir="${nimbusctx.authzdbmodule.dist.dir}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>
            <fileset dir="${nimbusctx.autocommon.dist.dir}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>
            <fileset dir="${nimbusctx.querygeneral.dist.dir}">
                <include name="*.jar"/>
                <include name="*LICENSE*"/>
            </fileset>
        </copy>
    </target>

    
    <!-- *******************************************************************
COPIES FOR ETC DIRECTORY
******************************************************************* -->

    <target name="etc_copies" depends="init">
        <copy todir="${nimbusctx.gt4_0.gar.build.etc.dir}">
            <fileset dir="${nimbusctx.gt4_0.gar.etc.dir}" />
        </copy>
    </target>

    <target name="copy-bundled-main.xml">
        <copy tofile="${nimbusctx.gt4_0.gar.etc.dir}/other/main.xml"
              file="${nimbusctx.gt4_0.gar.etc.dir}/other/bundled-main.xml" />
        <echo>Broker context: bundled-main.xml</echo>
    </target>

    <target name="copy-standalone-main.xml">
        <copy tofile="${nimbusctx.gt4_0.gar.etc.dir}/other/main.xml"
              file="${nimbusctx.gt4_0.gar.etc.dir}/other/standalone-main.xml" />
        <echo>Broker context: standalone-main.xml</echo>
    </target>

    
    <!-- *******************************************************************
CREATE DISTRIBUTION
******************************************************************* -->

    <target name="_dist" depends="check, etc_copies">
        <ant antfile="${build.packages}" target="makeGar">
            <property name="forget.client-deploy.wsdd" value="x" />
            <reference refid="${garjars.id}"/>
            <reference refid="${garetc.id}"/>
            <reference refid="${garshare.id}"/>
            <reference refid="${garschema.id}"/>
            <reference refid="${gardocs.id}"/>
            <reference refid="${garbin.id}"/>
        </ant>
        <!-- makeGar is also looking at:
- gar.name
- garserverdeployment.file
- garjndiconfigdeployment.file
-->

        <delete dir="tmp"/>
    </target>

    <target name="dist-bundled" depends="disp, copy-bundled-main.xml">
        <echo>Building: ${nimbusctx.gt4_0.gar.print-noun}</echo>
        <antcall target="_dist" />
        <echo>Built: ${nimbusctx.gt4_0.gar.print-noun}
        </echo>
    </target>

    <target name="dist-standalone" depends="disp, copy_libraries, copy-standalone-main.xml">
        <echo>Building: ${nimbusctx.gt4_0.gar.print-noun}</echo>
        <antcall target="_dist" />
        <echo>Built: ${nimbusctx.gt4_0.gar.print-noun}
        </echo>
    </target>


    <!-- *******************************************************************
DEPLOYMENT
******************************************************************* -->

    <target name="assessGarPresence">
        <available property="garIsPresent"
                   type="file"
                   file="${gar.name}" />
    </target>

    <target name="gar.not.present"
            depends="assessGarPresence"
            unless="garIsPresent">

        <echo>



***************** ERROR *****************

Cannot find archive to install: ${gar.name}

Did you build?



        </echo>

        <fail message="Cannot find archive to install: ${gar.name}" />

    </target>

    <target name="_deploy" depends="gar.not.present">
        <ant antfile="${build.packages}" target="deployGar">
            <property name="gar.id" value="${nimbusctx.gt4_0.gar.package.name}"/>
        </ant>
        <delete dir="tmp"/>
    </target>

    <target name="deploy" depends="disp">
        <echo>Installing: ${nimbusctx.gt4_0.gar.print-noun}</echo>
        <antcall target="_deploy" />
        <echo>Installed: ${nimbusctx.gt4_0.gar.print-noun}</echo>
    </target>

    <target name="assessDeployed">

        <available property="isDeployed"
                   type="dir"
                   file="${abs.deploy.dir}/etc/globus_packages/${nimbusctx.gt4_0.gar.package.name}" />

        <condition property="isNotDeployed" value="true">
            <not>
                <isset property="isDeployed" />
            </not>
        </condition>

    </target>

    <target name="printDeployed"
            depends="assessDeployed"
            unless="isDeployed">

        <echo message="Already undeployed: ${nimbusctx.gt4_0.gar.package.name}"/>

    </target>

    <target name="undeploy" depends="printDeployed" unless="isNotDeployed">

        <ant antfile="${build.packages}" target="undeployGar">
            <property name="gar.id" value="${nimbusctx.gt4_0.gar.package.name}"/>
        </ant>

        <echo message="Undeployed: ${nimbusctx.gt4_0.gar.package.name}"/>

    </target>



    <!-- *******************************************************************
CLEAN
******************************************************************* -->

    <target name="clean">
        <delete file=".ant-targets-build.xml"/>
        <delete dir="${nimbusctx.gt4_0.gar.build.dir}"/>
        <delete dir="${nimbusctx.gt4_0.gar.dist.dir}"/>
        <echo message="Cleaned: ${basedir}" />
    </target>

</project>
Something went wrong with that request. Please try again.