Skip to content

Commit 9f76da1

Browse files
authored
chore: [CO-988] use project mvn revision property to generate build info class + SOAP API changelog (#451)
* chore: [CO-988] ant use project revision property from mvn simplify carbonio.buildinfo.version management * chore: generate shared properties during validate mvn phase * refactor: minor refactoring/cleanup of BuildInfo class * chore: add common properties to shared mvn-ant property file * chore: cleanup of already shared mvn-ant properties they are shared by the mvn-ant property file and set by ant-build-common.xml * chore: basline soapapi-desc.json for 24.4.0-SNAPSHOT * chore: update soap api changelog template * chore: add ant generate-soap-api-changelog & update-baseline-apidesc * chore: dynamic formation of build timestamp * chore: update used carbonio version info message in ant build * chore: remove unncesarry resources * chore: update changelog template and stylesheet * chore: update frameset size in soap docs * chore: update modifiers as suggested
1 parent 1243af6 commit 9f76da1

17 files changed

+1699
-266
lines changed

ant-build-common.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,21 @@
5555
<property location="${client.dir}/target/zimbraclient.jar" name="client.jarfile"/>
5656
<property location="${zm-mailbox.basedir}/store-conf/conf/msgs" name="msgs.dir"/>
5757

58+
<!--import mvn-ant shared build properties-->
59+
<property file="${maven.build.dir}/mvn-ant-shared-build.properties"/>
5860

5961
<target name="require-version" depends="carbonio-version" >
6062
<!-- For retro-compatibility -->
6163
<property name="zimbra.buildinfo.version" value="${carbonio.buildinfo.version}"/>
62-
<echo level="info" message="Using version ${zimbra.buildinfo.version}"/>
64+
<echo level="info" message="Using ${zimbra.buildinfo.version} as carbonio.buildinfo.version"/>
6365
</target>
6466

67+
<tstamp>
68+
<format property="current.date" pattern="YYYYMM"/>
69+
</tstamp>
70+
6571
<target name="carbonio-version">
66-
<property name="carbonio.buildinfo.version" value="24.4.0_ZEXTRAS_202404"/>
72+
<property name="carbonio.buildinfo.version" value="${mvn_revision}_ZEXTRAS_${current.date}"/>
6773
<fail
6874
message="Missing build version. Define proper version like -Dcarbonio.buildinfo.version">
6975
<condition>

pom.xml

+29
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,35 @@
898898
<artifactId>maven-antrun-plugin</artifactId>
899899
<groupId>org.apache.maven.plugins</groupId>
900900
<version>3.1.0</version>
901+
<executions>
902+
<execution>
903+
<id>generate-ant-properties</id>
904+
<phase>validate</phase>
905+
<configuration>
906+
<target>
907+
<pathconvert property="compile_classpath_value" refid="maven.compile.classpath"/>
908+
<pathconvert property="runtime_classpath_value" refid="maven.runtime.classpath"/>
909+
<pathconvert property="test_classpath_value" refid="maven.test.classpath"/>
910+
<!--mvn properties shared with all modules while building project-->
911+
<propertyfile file="${project.build.directory}/mvn-ant-shared-build.properties">
912+
<!--required to set carbonio.buildinfo.version-->
913+
<entry key="mvn_revision" value="${revision}"/>
914+
915+
<!--properties needed by some ant tasks-->
916+
<entry key="compile_classpath" value="${compile_classpath_value}"/>
917+
<entry key="runtime_classpath" value="${runtime_classpath_value}"/>
918+
<entry key="test_classpath" value="${test_classpath_value}"/>
919+
</propertyfile>
920+
<propertyfile file="${project.build.directory}/mvn-ant-shared-build.properties">
921+
<entry key="mvn_revision" value="${revision}"/>
922+
</propertyfile>
923+
</target>
924+
</configuration>
925+
<goals>
926+
<goal>run</goal>
927+
</goals>
928+
</execution>
929+
</executions>
901930
</plugin>
902931
<!-- Testing -->
903932
<plugin>

soap/ant-generate-soap-docs.xml

+23-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<property name="soapdocs.output.dir" location="${build.dir}/docs/soap" />
1111
<property name="soapdocs.src.dir" location="soap/src/main/java" />
1212
<property name="soapdocs.apidesc.file" location="${build.dir}/soapapi-desc.json" />
13-
<property name="soapdocs.apidesc.baseline.file" location="soap/baseline-soapapi-desc.json.gz" />
13+
<property name="soapdocs.apidesc.baseline.file" location="baseline-soapapi-desc.json.gz" />
1414
<property name="soapapi.changelog.output.dir" location="${soapdocs.output.dir}/api-changelog" />
1515
<property name="soapapi.doc.file" location="${build.dir}/docs/soapapi-doc.zip" />
1616
<property name="soapapi.changelog.file" location="${build.dir}/docs/soapapi-changelog.zip" />
@@ -49,6 +49,28 @@
4949
</java>
5050
</target>
5151

52+
53+
<target name="generate-soap-api-changelog" depends="generate-soap-api-doc">
54+
<delete dir="${soapapi.changelog.output.dir}" quiet="true"/>
55+
<mkdir dir="${soapapi.changelog.output.dir}"/>
56+
<copy todir="${soapapi.changelog.output.dir}">
57+
<fileset dir="${templates.dir}/changelog">
58+
<exclude name="**/*.ftl"/>
59+
</fileset>
60+
</copy>
61+
<java classname="com.zimbra.doc.soap.changelog.SoapApiChangeLog" classpathref="class.path" fork="true" failonerror="true">
62+
<arg line="--output-dir ${soapapi.changelog.output.dir}"/>
63+
<arg line="--templates-dir ${templates.dir}"/>
64+
<arg line="--baseline-apidesc ${soapdocs.apidesc.baseline.file}"/>
65+
<arg line="--current-apidesc ${soapdocs.apidesc.file}"/>
66+
</java>
67+
</target>
68+
69+
<target name="update-baseline-apidesc" depends="generate-soap-api-doc" description="Update baseline description of SOAP API">
70+
<gzip src="${soapdocs.apidesc.file}" destfile="${soapdocs.apidesc.baseline.file}"/>
71+
</target>
72+
73+
5274
<target name="generate-soap-api-doc" depends="generate-wsdl">
5375

5476
<path id="soapdocs.doclet.class.path">

soap/baseline-soapapi-desc.json.gz

142 KB
Binary file not shown.

soap/pom.xml

+27-21
Original file line numberDiff line numberDiff line change
@@ -129,64 +129,70 @@
129129
<!-- generate SOAP docs -->
130130
<plugin>
131131
<artifactId>maven-antrun-plugin</artifactId>
132+
<groupId>org.apache.maven.plugins</groupId>
132133
<dependencies>
133134
<dependency>
135+
<groupId>ant-contrib</groupId>
134136
<artifactId>ant-contrib</artifactId>
137+
<version>1.0b3</version>
135138
<exclusions>
136139
<exclusion>
137-
<artifactId>ant</artifactId>
138140
<groupId>ant</groupId>
141+
<artifactId>ant</artifactId>
139142
</exclusion>
140143
</exclusions>
141-
<groupId>ant-contrib</groupId>
142-
<version>1.0b3</version>
143144
</dependency>
144145
<dependency>
145-
<artifactId>ant-nodeps</artifactId>
146146
<groupId>org.apache.ant</groupId>
147+
<artifactId>ant-nodeps</artifactId>
147148
<version>1.8.1</version>
148149
</dependency>
149150
</dependencies>
150151
<executions>
151152
<execution>
153+
<id>generate-soap-docs</id>
154+
<goals>
155+
<goal>run</goal>
156+
</goals>
152157
<configuration>
153158
<target>
154-
<property name="compile_classpath" refid="maven.compile.classpath"/>
155-
<property name="runtime_classpath" refid="maven.runtime.classpath"/>
156-
<property name="test_classpath" refid="maven.test.classpath"/>
157-
<taskdef classpathref="maven.plugin.classpath"
158-
resource="net/sf/antcontrib/antlib.xml"/>
159+
<taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"/>
159160
<ant antfile="${basedir}/ant-generate-soap-docs.xml">
160161
<target name="generate-soap-api-doc"/>
161162
</ant>
162163
</target>
163164
</configuration>
165+
</execution>
166+
<execution>
167+
<id>generate-soap-api-changelog</id>
164168
<goals>
165169
<goal>run</goal>
166170
</goals>
167-
<id>generate-soap-docs</id>
168-
</execution>
169-
<execution>
170171
<configuration>
171172
<target>
172-
<property name="compile_classpath" refid="maven.compile.classpath"/>
173-
<property name="runtime_classpath" refid="maven.runtime.classpath"/>
174-
<property name="test_classpath" refid="maven.test.classpath"/>
175-
<taskdef classpathref="maven.plugin.classpath"
176-
resource="net/sf/antcontrib/antlib.xml"/>
173+
<taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"/>
177174
<ant antfile="${basedir}/ant-generate-soap-docs.xml">
178-
<target name="generate-wsdl"/>
175+
<target name="generate-soap-api-changelog"/>
179176
</ant>
180177
</target>
181178
</configuration>
179+
</execution>
180+
<execution>
181+
<id>generate-wsdl</id>
182+
<phase>prepare-package</phase>
182183
<goals>
183184
<goal>run</goal>
184185
</goals>
185-
<phase>prepare-package</phase>
186-
<id>generate-wsdl</id>
186+
<configuration>
187+
<target>
188+
<taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"/>
189+
<ant antfile="${basedir}/ant-generate-soap-docs.xml">
190+
<target name="generate-wsdl"/>
191+
</ant>
192+
</target>
193+
</configuration>
187194
</execution>
188195
</executions>
189-
<groupId>org.apache.maven.plugins</groupId>
190196
</plugin>
191197
</plugins>
192198
</build>

soap/templates/api-reference/index.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Carbonio SOAP API Reference ${build.version}
2929
</SCRIPT>
3030
</HEAD>
3131
<FRAMESET cols="22%,78%" title="" onLoad="top.loadFrames()">
32-
<FRAMESET rows="42%,58%" title="" onLoad="top.loadFrames()">
32+
<FRAMESET rows="30%,70%" title="" onLoad="top.loadFrames()">
3333
<FRAME src="overview-frame.html" name="serviceListFrame" title="All Commands">
3434

3535
<FRAME src="allcommands-frame.html" name="serviceFrame" title="All Commands">

soap/templates/changelog/images/favicon.ico

Whitespace-only changes.

soap/templates/changelog/images/favicon.ico.license

Whitespace-only changes.

soap/templates/changelog/images/logo.png

Whitespace-only changes.

soap/templates/changelog/images/logo.png.license

Whitespace-only changes.

soap/templates/changelog/images/super_nav_bg.png

Whitespace-only changes.

soap/templates/changelog/images/super_nav_bg.png.license

Whitespace-only changes.

soap/templates/changelog/images/super_nav_separator.png

Whitespace-only changes.

soap/templates/changelog/images/super_nav_separator.png.license

Whitespace-only changes.

0 commit comments

Comments
 (0)