summaryrefslogtreecommitdiff
path: root/qpid/java/management/eclipse-plugin/build-release.xml
blob: b396974c9a443f4cfbed673bd4199d96941a4671 (plain)
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
<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you under the Apache License, Version 2.0 (the
 - "License"); you may not use this file except in compliance
 - with the License.  You may obtain a copy of the License at
 - 
 -   http://www.apache.org/licenses/LICENSE-2.0
 - 
 - Unless required by applicable law or agreed to in writing,
 - software distributed under the License is distributed on an
 - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - KIND, either express or implied.  See the License for the
 - specific language governing permissions and limitations
 - under the License.
 -
 -->
<project name="Eclipse Plugin Binary Release" default="release-bin">

	<!-- check properties that must be set by caller -->
    <target name="check" description="ensure all required properties are set">
    	<condition property="properties.set">
    		<and>
    	        <!-- common properties -->
                <isset property ="mcplugin.filename"/>
                <isset property ="jmxremote.sasl.manifest"/>
                <isset property ="qpidmanagementcommon.manifest"/>
                <!-- platform specific properties -->
                <isset property ="qpidmc.ini"/>
                <isset property ="qpidmc.executable"/>
                <isset property ="release.name"/>
                <isset property ="release.subdir"/>
                <isset property ="rcp.libs"/>
                <isset property ="rcp.configuration.dir"/>
    		    <or>
    		        <isset property ="release.zip"/>
    		        <isset property ="release.tar.gz"/>
    		    </or>
        	</and>
            <!-- Optional Properties:

    	    For linux libcairo-swt.so file:
            qpidmc.companion.library
            
            -->
        </condition>

        <fail unless="properties.set" message="some required properties were not set"/>
    </target>

    <target name="release-bin-prepare">
        <mkdir dir="${release.subdir}"/>
    </target>

    <target name="release-bin-qpid-mc-plugin">
        <!-- Copy the qpid management-eclipse-plugin module jar -->
        <copy tofile="${release.subdir}/plugins/${mcplugin.filename}.jar" flatten="true" failonerror="true">
            <fileset file="${build.lib}/qpid-management-eclipse-plugin-${project.version}.jar"/>
        </copy>
    </target>

    <target name="release-bin-jmxremote-plugin">
        <!-- Copy the jmxremote.sasl plugin's manifest, creating its plugin directory -->
        <copy todir="${release.subdir}/plugins/jmxremote.sasl_1.0.1/META-INF" flatten="true" failonerror="true">
            <fileset file="${jmxremote.sasl.manifest}"/>
        </copy>
    </target>

    <target name="release-bin-qpidmanagementcommon-plugin">
        <!-- Copy the management common plugin's manifest, creating its plugin directory -->
        <copy todir="${release.subdir}/plugins/qpid-management-common_1.0.0/META-INF" flatten="true" failonerror="true">
            <fileset file="${qpidmanagementcommon.manifest}"/>
        </copy>
        <!-- Copy the qpid management-common module jar -->
        <copy tofile="${release.subdir}/plugins/qpid-management-common_1.0.0/qpid-management-common.jar" flatten="true" failonerror="true">
            <fileset file="${build.lib}/qpid-management-common-${project.version}.jar"/>
        </copy>
    </target>
    
    <target name="release-bin-executable-companion-library" if="qpidmc.companion.library">
        <!-- Copy the rcp executable companion library file -->
        <copy todir="${release.subdir}" flatten="true" failonerror="true">
            <fileset file="${qpidmc.companion.library}"/>
        </copy>
    </target>
    
    <target name="release-bin-rcp-deps" description="copy eclipse-rcp dependencies into module release"
        depends="release-bin-executable-companion-library">
        
        <!-- Copy the rcp executable file -->
        <copy todir="${release.subdir}" flatten="true" failonerror="true">
            <fileset file="${qpidmc.executable}"/>
        </copy>
        <chmod dir="${release.subdir}" perm="u+rx" includes="**/*"/>
        
        <!-- Copy remaining startup & license files -->
        <copy todir="${release.subdir}" flatten="true" failonerror="true">
            <fileset file="${qpidmc.ini}"/>
        </copy>

        <!-- Copy the rcp module libs -->
        <copy todir="${release.subdir}/plugins" failonerror="true">
            <fileset dir="${project.root}" includes="${rcp.libs}"/>
            <globmapper from="lib/*" to="*"/>
        </copy>

        <!-- Copy the relevant configuration dir -->
        <copy todir="${release.subdir}/configuration" failonerror="true">
            <fileset dir="${rcp.configuration.dir}"/>
        </copy>
        <chmod dir="${release.subdir}/configuration" perm="ugo+r" includes="**/*"/>
    </target>
  
    <target name="release-bin-zip" if="release.zip" description="build mc zip archive">
        <zip destfile="${release.zip}">
            <zipfileset dir="${release.subdir}" prefix="${release.name}" filemode="755">
                <include name="qpidmc*"/>
                <exclude name="qpidmc.ini"/>
            </zipfileset>
            
            <zipfileset dir="${release.subdir}" prefix="${release.name}" filemode="644">
                <include name="qpidmc.ini"/>
            </zipfileset>

            <zipfileset dir="${release.subdir}" prefix="${release.name}" filemode="644" dirmode="755">
                <exclude name="qpidmc*"/>
            </zipfileset>
        </zip>
    </target>    		

    <target name="release-bin-gzip" if="release.tar.gz" description="build mc tar.gz archive">
        <tar destfile="${release.tar.gz}" longfile="gnu">
            <tarfileset dir="${release.subdir}" prefix="${release.name}" filemode="755">
                <include name="qpidmc*"/>
                <exclude name="qpidmc.ini"/>
            </tarfileset>

            <tarfileset dir="${release.subdir}" prefix="${release.name}" filemode="644">
                <include name="qpidmc.ini"/>
            </tarfileset>

            <tarfileset dir="${release.subdir}" prefix="${release.name}" filemode="644" dirmode="755">
                <exclude name="qpidmc*"/>
            </tarfileset>
        </tar>
    </target>

    
    <target name="release-bin" depends="check,release-bin-prepare,release-bin-rcp-deps,
        release-bin-qpid-mc-plugin,release-bin-qpidmanagementcommon-plugin,release-bin-jmxremote-plugin,release-bin-zip,release-bin-gzip"/>
    
</project>