Skip to content

Commit

Permalink
ZCS-4380 Removing zimbra jars from service/WEB-INF/lib (Zimbra#557)
Browse files Browse the repository at this point in the history
* ZCS-4380 Removing zimbra jars from service/WEB-INF/lib

* ZCS-4380 Replacing + in pkg name

* ZCS-4380 Replacing + in pkg name

* ZCS-4380 Adding common jars pkg

* ZCS-4380 Fixes as per review comments

* ZCS-4380 adding common and native to pkg

* ZCS-4380 Fixes as per code review

* ZCS-4380 Fixes as per code review
  • Loading branch information
rupalid authored Mar 15, 2018
1 parent 88f9ece commit e278454
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 9 deletions.
10 changes: 9 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@
<ant dir="./store" target="test" inheritAll="true"/>
<echo append="true" file="${test-results-file}" message="END&#xD;" />
</target>

<target name="dist">
<ant dir="./native" target="dist" inheritAll="false"/>
<ant dir="./common" target="dist" inheritAll="false"/>
<ant dir="./soap" target="dist" inheritAll="false"/>
<ant dir="./client" target="dist" inheritAll="false"/>
<ant dir="./store" target="dist" inheritAll="false"/>
</target>

<target name="pkg" depends="clean-pkg,all">
<target name="pkg" depends="clean-pkg,all,dist">
<exec dir="." executable="./pkg-builder.pl" failonerror="true"/>
</target>

Expand Down
7 changes: 7 additions & 0 deletions client/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@
<param name="implementation.title" value="Zimbra Client"/>
</antcall>
</target>

<target name="dist" depends="jar" description="Copies jar to dist dir">
<copy todir="${dist.dir}">
<fileset dir="${build.dir}" />
<globmapper from="zm-client-*.jar" to="zm-client.jar" />
</copy>
</target>
</project>
15 changes: 11 additions & 4 deletions common/build.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<project name="zm-common" default="jar">

<import file="../build-common.xml"/>

<!-- Targets -->
<target name="jar" depends="compile" description="Creates the jar file">
<antcall target="zimbra-jar">
<param name="implementation.title" value="Zimbra Common"/>
</antcall>
<antcall target="zimbra-jar">
<param name="implementation.title" value="Zimbra Common"/>
</antcall>
</target>

<!-- mailboxd will not start without zm-common library, so this target does not attempt to start it -->
Expand All @@ -32,4 +32,11 @@
<antcall target="start-webserver"/>
</target>

<target name="dist" depends="jar" description="Copies jar to dist dir">
<copy todir="${dist.dir}">
<fileset dir="${build.dir}" />
<globmapper from="zm-common-*.jar" to="zm-common.jar" />
</copy>
</target>

</project>
7 changes: 7 additions & 0 deletions native/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,11 @@
<target name="clean" description="Removes build files and undeploys extension">
<delete dir="${build.dir}" />
</target>

<target name="dist" depends="jar" description="Copies jar to dist dir">
<copy todir="${dist.dir}">
<fileset dir="${build.dir}" />
<globmapper from="zm-native-*.jar" to="zm-native.jar" />
</copy>
</target>
</project>
27 changes: 26 additions & 1 deletion pkg-builder.pl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ($)
hard_deps => [
"zimbra-mbox-war",
"zimbra-mbox-conf",
"zimbra-core-jar"
],
soft_deps => [
"zimbra-common-mbox-conf",
Expand Down Expand Up @@ -188,6 +189,18 @@ ($)
file_list => ['/opt/zimbra/*'],
stage_fun => sub { &stage_zimbra_common_mbox_docs(@_); },
},

"zimbra-core-jar" => {
summary => "Zimbra Core Jars",
version => "1.0.0",
revision => 1,
hard_deps => [],
soft_deps => [],
other_deps => ["zimbra-core-components"],
replaces => ["zimbra-core"],
file_list => ['/opt/zimbra/*'],
stage_fun => sub { &stage_zimbra_core_jars(@_); },
},
);


Expand Down Expand Up @@ -437,6 +450,18 @@ ()
return ["store/docs"];
}

sub stage_zimbra_core_jars()
{
my $stage_base_dir = shift;

cpy_file( "store/build/dist/zm-store.jar", "$stage_base_dir/opt/zimbra/lib/jars/zimbrastore.jar");
cpy_file( "soap/build/dist/zm-soap.jar", "$stage_base_dir/opt/zimbra/lib/jars/zimbrasoap.jar");
cpy_file( "client/build/dist/zm-client.jar", "$stage_base_dir/opt/zimbra/lib/jars/zimbraclient.jar");
cpy_file( "common/build/dist/zm-common.jar", "$stage_base_dir/opt/zimbra/lib/jars/zimbracommon.jar");
cpy_file( "native/build/dist/zm-native.jar", "$stage_base_dir/opt/zimbra/lib/jars/zimbranative.jar");
return ["."];
}

sub stage_zimbra_mbox_service(%)
{
my $stage_base_dir = shift;
Expand All @@ -460,7 +485,7 @@ ($)

my $timestamp = git_timestamp_from_dirs( &$stage_fun($stage_base_dir) );

$pkg_info->{_version_ts} = $pkg_info->{version} . ( $timestamp ? ( "+" . $timestamp ) : "" );
$pkg_info->{_version_ts} = $pkg_info->{version} . ( $timestamp ? ( "." . $timestamp ) : "" );

my @cmd = (
"../zm-pkg-tool/pkg-build.pl",
Expand Down
7 changes: 7 additions & 0 deletions soap/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,12 @@
<target name="deploy" depends="deploy-no-start">
<antcall target="start-webserver"/>
</target>

<target name="dist" depends="jar" description="Copies jar to dist dir">
<copy todir="${dist.dir}">
<fileset dir="${build.dir}" />
<globmapper from="zm-soap-*.jar" to="zm-soap.jar" />
</copy>
</target>

</project>
10 changes: 7 additions & 3 deletions store/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,8 @@
<ivy:install organisation="javax.jws" module="jsr181-api" revision="2.2.6" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="org.ehcache" module="ehcache" revision="3.1.2" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="javax.ws.rs" module="jsr311-api" revision="1.1.1" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="zimbra" module="zm-soap" revision="latest.integration" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<ivy:install organisation="zimbra" module="zm-client" revision="latest.integration" settingsRef="dev.settings" from="chain-resolver" to="build-tmp" overwrite="true" transitive="true" type="jar"/>
<war warfile="${warfile}" webxml="${war.web.xml}">
<fileset dir="WebRoot"/>
<lib file="${build.dir}/${jar.file}"/>
<lib dir="${build.tmp.dir}" includes="*.jar"/>
<!-- /lib -->
<classes dir="${config.dir}" includes="sieveConfig.xml"/>
Expand Down Expand Up @@ -416,4 +413,11 @@
<fileset dir="data/unittest" includes="**"/>
</copy>
</target>

<target name="dist" depends="jar" description="Copies jar to dist dir">
<copy todir="${dist.dir}">
<fileset dir="${build.dir}" />
<globmapper from="zm-store-*.jar" to="zm-store.jar" />
</copy>
</target>
</project>

0 comments on commit e278454

Please sign in to comment.