Skip to content

Commit ebbb72e

Browse files
authored
Merge pull request #639 from sosy-lab/638-include-javadocsources-for-all-solvers
Add JavaDoc and sources for JavaSMT and all solvers
2 parents 7d5d447 + 9342fe6 commit ebbb72e

15 files changed

Lines changed: 282 additions & 53 deletions

build/build-documentation.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ SPDX-License-Identifier: Apache-2.0
6060
<exclude name="**/*Test.java"/>
6161
<exclude name="${documentation.javadoc.exclude}"/>
6262
</fileset>
63-
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/"/>
63+
<link href="https://docs.oracle.com/en/java/javase/17/docs/api/"/>
6464
<link href="https://guava.dev/releases/snapshot/api/docs/"/>
6565
<link href="https://truth.dev/api/latest/"/>
6666
<link href="https://sosy-lab.github.io/java-common-lib/api/"/>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
This file is part of JavaSMT,
5+
an API wrapper for a collection of SMT solvers:
6+
https://github.com/sosy-lab/java-smt
7+
8+
SPDX-FileCopyrightText: 2026 Dirk Beyer <https://www.sosy-lab.org>
9+
10+
SPDX-License-Identifier: Apache-2.0
11+
-->
12+
13+
<project name="documentation-yices2" basedir=".">
14+
<!-- Targets for building documentation for the Yices2 bindings. -->
15+
<property name="yices.javadoc" value="downloads/javadoc/javasmt-yices"/>
16+
17+
<target name="javadoc-yices2" depends="build-project">
18+
<delete dir="yices.javadoc"/>
19+
<javadoc destdir="${yices.javadoc}"
20+
classpathref="classpath"
21+
locale="en_US"
22+
encoding="utf-8"
23+
windowtitle="${ant.project.name}"
24+
failonerror="true"
25+
failonwarning="true">
26+
<fileset dir="${source.dir}/org/sosy_lab/java_smt/solvers/yices2">
27+
<include name="**/*.java"/>
28+
<exclude name="**/*Test.java"/>
29+
</fileset>
30+
<link href="https://docs.oracle.com/en/java/javase/17/docs/api/"/>
31+
<link href="https://guava.dev/releases/snapshot/api/docs/"/>
32+
<link href="https://sosy-lab.github.io/java-common-lib/api/"/>
33+
<link href="https://sosy-lab.github.io/java-smt/api/"/>
34+
<arg line="${javadoc.doclint}"/>
35+
</javadoc>
36+
</target>
37+
38+
<target name="javadoc-jar-yices2" depends="javadoc-yices2,determine-version,build" description="Pack Javadoc into a JAR">
39+
<property name="javadoc-jar.file" value="javasmt-yices2-${version}-javadoc.jar"/>
40+
<jar jarfile="${javadoc-jar.file}">
41+
<metainf dir="." includes="LICENSE"/>
42+
<fileset dir="${yices.javadoc}"/>
43+
</jar>
44+
</target>
45+
</project>

build/build-publish-solvers/solver-bitwuzla.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ SPDX-License-Identifier: Apache-2.0
106106

107107
<!-- Compile java proxies and create jar file -->
108108
<mkdir dir="${bitwuzla.path}/install/java/build"/>
109-
<javac release="11" debug="true" srcdir="${source.path}/libbitwuzla/src/" destdir="${bitwuzla.path}/install/java/build" includeantruntime="false" failonerror="true">
109+
<javac release="17" debug="true" srcdir="${source.path}/libbitwuzla/src/" destdir="${bitwuzla.path}/install/java/build" includeantruntime="false" failonerror="true">
110110
<include name="org/sosy_lab/java_smt/solvers/bitwuzla/api/*.java"/>
111111
</javac>
112112
<jar destfile="${bitwuzla.dist.dir}/bitwuzla-${bitwuzla.version}.jar" basedir="${bitwuzla.path}/install/java/build"/>

build/build-publish-solvers/solver-cvc5.xml

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file is part of JavaSMT,
55
an API wrapper for a collection of SMT solvers:
66
https://github.com/sosy-lab/java-smt
77
8-
SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org>
8+
SPDX-FileCopyrightText: 2026 Dirk Beyer <https://www.sosy-lab.org>
99
1010
SPDX-License-Identifier: Apache-2.0
1111
-->
@@ -18,16 +18,20 @@ SPDX-License-Identifier: Apache-2.0
1818
<property name="cvc5.downloads" value="./downloads/cvc5"/>
1919
<property name="cvc5.distDir" value="${ivy.solver.dist.dir}/cvc5"/>
2020

21-
<target name="download-cvc5">
21+
<target name="init-cvc5" description="Clean up CVC5 binaries and Java bindings.">
2222
<fail unless="cvc5.version">
2323
Please specify a version with the flag -Dcvc5.version=XXX.
2424
The version must match one of the daily builds from https://github.com/cvc5/cvc5/releases
2525
</fail>
2626

27+
<delete dir="${cvc5.distDir}" quiet="true"/>
28+
2729
<mkdir dir="${cvc5.downloads}"/>
2830
<mkdir dir="${cvc5.distDir}/x64"/>
2931
<mkdir dir="${cvc5.distDir}/arm64"/>
32+
</target>
3033

34+
<target name="download-cvc5" depends="init-cvc5" description="Download CVC5 binaries and Java bindings.">
3135
<!-- Download binaries for Linux on x64 -->
3236
<get src="${cvc5.url}/cvc5-Linux-x86_64-static-${cvc5.version}.zip" dest="${cvc5.downloads}" verbose="true"/>
3337
<unzip src="${cvc5.downloads}/cvc5-Linux-x86_64-static-${cvc5.version}.zip" dest="${cvc5.distDir}/x64">
@@ -63,17 +67,87 @@ SPDX-License-Identifier: Apache-2.0
6367
<mapper type="merge" to="libcvc5jni-${cvc5.version}.dll"/>
6468
</unzip>
6569

70+
<!-- Download binaries for Windows on arm64 -->
6671
<get src="${cvc5.url}/cvc5-Win64-arm64-static-${cvc5.version}.zip" dest="${cvc5.downloads}" verbose="true"/>
6772
<unzip src="${cvc5.downloads}/cvc5-Win64-arm64-static-${cvc5.version}.zip" dest="${cvc5.distDir}/arm64">
6873
<patternset><include name="cvc5-Win64-arm64-static/bin/cvc5jni.dll"/></patternset>
6974
<mapper type="merge" to="libcvc5jni-${cvc5.version}.dll"/>
7075
</unzip>
7176

7277
<!-- Download the Java bindings -->
73-
<get src="${cvc5.url}/cvc5-Linux-arm64-java-api-${cvc5.version}.jar" dest="${cvc5.distDir}/cvc5-${cvc5.version}.jar" verbose="true"/>
78+
<get src="${cvc5.url}/cvc5-Linux-arm64-java-api-${cvc5.version}.jar" dest="${cvc5.downloads}/cvc5-${cvc5.version}.jar" verbose="true"/>
79+
<!-- Remove bundled binary -->
80+
<zip destfile="${cvc5.distDir}/cvc5-${cvc5.version}.jar">
81+
<zipfileset src="${cvc5.downloads}/cvc5-${cvc5.version}.jar">
82+
<exclude name="cvc5-libs/**/*"/>
83+
</zipfileset>
84+
</zip>
85+
</target>
86+
87+
<target name="download-cvc5-sources" depends="init-cvc5" description="Download CVC5 source code.">
88+
<!-- Download the source code and get the exact version matching the downloaded binaries -->
89+
<delete dir="${cvc5.downloads}/cvc5-sources" quiet="true"/>
90+
<exec executable="git" dir="${cvc5.downloads}" failonerror="true">
91+
<arg value="clone"/>
92+
<arg value="https://github.com/cvc5/cvc5.git"/>
93+
<arg value="cvc5-sources"/>
94+
</exec>
95+
<!-- Get the git revision from CVC5 version -->
96+
<loadresource property="cvc5.gitVersion">
97+
<concat>${cvc5.version}</concat>
98+
<filterchain>
99+
<replaceregex pattern="\d{4}-\d{2}-\d{2}-(.*)" replace="\1"/>
100+
</filterchain>
101+
</loadresource>
102+
<!-- Checkout the matching version -->
103+
<exec executable="git" dir="${cvc5.downloads}/cvc5-sources" failonerror="true">
104+
<arg value="checkout"/>
105+
<arg value="${cvc5.gitVersion}"/>
106+
</exec>
107+
</target>
108+
109+
<target name="package-cvc5-sources" depends="download-cvc5-sources" description="Package CVC5 source code into a JAR file.">
110+
<jar destfile="${cvc5.distDir}/cvc5-${cvc5.version}-sources.jar" whenmanifestonly="fail">
111+
<zipfileset dir="${cvc5.downloads}/cvc5-sources/src/api/java" includes="**/*.java"/>
112+
<zipfileset dir="${cvc5.downloads}/cvc5-sources" includes="COPYING" prefix="META-INF"/>
113+
<manifest>
114+
<attribute name="Implementation-Title" value="cvc5"/>
115+
<attribute name="Implementation-Version" value="${cvc5.version}"/>
116+
</manifest>
117+
</jar>
118+
</target>
119+
120+
<target name="package-cvc5-javadoc" depends="download-cvc5-sources" description="Generate Javadoc for CVC5 Java API and package it into a JAR file.">
121+
<delete dir="${cvc5.downloads}/cvc5-javadoc" quiet="true"/>
122+
<javadoc destdir="${cvc5.downloads}/cvc5-javadoc"
123+
classpathref="classpath"
124+
locale="en_US"
125+
encoding="utf-8"
126+
windowtitle="cvc5"
127+
failonerror="true"
128+
failonwarning="false">
129+
<fileset dir="${cvc5.downloads}/cvc5-sources/src/api/java">
130+
<include name="**/*.java"/>
131+
</fileset>
132+
<link href="https://docs.oracle.com/en/java/javase/17/docs/api/"/>
133+
<doctitle><![CDATA[<h1>cvc5</h1>]]></doctitle>
134+
<tag name="api.note" description="Note:"/>
135+
<arg line="${javadoc.doclint}"/>
136+
<arg line="--allow-script-in-comments"/>
137+
<!-- JVM inherits system language. We need to force it to use en_US instead of local language. -->
138+
<arg value="-J-Duser.language=en" />
139+
<arg value="-J-Duser.country=US" />
140+
<arg value="-locale" /><arg value="en_US" />
141+
<arg value="-docencoding" /><arg value="UTF-8" />
142+
<arg value="-charset" /><arg value="UTF-8" />
143+
</javadoc>
144+
<jar jarfile="${cvc5.distDir}/cvc5-${cvc5.version}-javadoc.jar" whenmanifestonly="fail">
145+
<zipfileset dir="${cvc5.downloads}/cvc5-sources" includes="COPYING" prefix="META-INF"/>
146+
<zipfileset dir="${cvc5.downloads}/cvc5-javadoc"/>
147+
</jar>
74148
</target>
75149

76-
<target name="publish-cvc5" depends="download-cvc5, load-ivy" description="Publish CVC5 binaries to Ivy repository.">
150+
<target name="publish-cvc5" depends="download-cvc5, package-cvc5-sources, package-cvc5-javadoc, load-ivy" description="Publish CVC5 binaries to Ivy repository.">
77151
<ivy:resolve conf="solver-cvc5" file="solvers_ivy_conf/ivy_cvc5.xml"/>
78152
<publishToRepository solverName="CVC5" solverVersion="${cvc5.version}" distDir="${cvc5.distDir}"/>
79153

build/build-publish-solvers/solver-opensmt.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ SPDX-License-Identifier: Apache-2.0
194194
<target name="build-opensmt-bindings-jni" depends="build-opensmt-wrapper">
195195
<!-- compile java proxies and create jar file -->
196196
<mkdir dir="${source.path}/build"/>
197-
<javac release="11" srcdir="${source.path}/src/" destdir="${source.path}/build" includeantruntime="false" failonerror="true">
197+
<javac release="17" srcdir="${source.path}/src/" destdir="${source.path}/build" debug="true" includeantruntime="false" failonerror="true">
198198
<include name="org/sosy_lab/java_smt/solvers/opensmt/api/*.java"/>
199199
</javac>
200200
<jar destfile="${opensmt.dist.dir}/opensmt-${opensmt.version}.jar" basedir="${source.path}/build"/>

build/build-publish-solvers/solver-yices.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ SPDX-License-Identifier: Apache-2.0
256256
<copy file="${yices2.buildDir}/yices2_java_bindings/dist/lib/libyices2java.so" tofile="${yices2.distDir}/x64/libyices2java-${yices2.version}.so" failonerror="true"/>
257257
<copy file="${yices2.buildDir}/yices2_java_bindings/dist/lib/yices2java.dll" tofile="${yices2.distDir}/x64/yices2java-${yices2.version}.dll" failonerror="true"/>
258258
<copy file="${yices2.buildDir}/yices2_java_bindings/dist/lib/yices.jar" tofile="${yices2.distDir}/yices-${yices2.version}.jar" failonerror="true"/>
259+
<copy file="${yices2.buildDir}/yices2_java_bindings/dist/lib/yices-sources.jar" tofile="${yices2.distDir}/yices-${yices2.version}-sources.jar" failonerror="true"/>
260+
<copy file="${yices2.buildDir}/yices2_java_bindings/dist/lib/yices-javadoc.jar" tofile="${yices2.distDir}/yices-${yices2.version}-javadoc.jar" failonerror="true"/>
259261

260262
<ivy:resolve conf="solver-yices2" file="solvers_ivy_conf/ivy_yices2.xml" />
261263

@@ -276,7 +278,9 @@ SPDX-License-Identifier: Apache-2.0
276278
</target>
277279

278280
<import file="build-jar-yices2.xml"/>
279-
<target name="dist-yices2" depends="jar-yices2, sources-yices2" description="Make a distributable release with yices2 only"/>
281+
<import file="build-documentation-yices2.xml"/>
282+
283+
<target name="dist-yices2" depends="jar-yices2, sources-yices2, javadoc-jar-yices2" description="Make a distributable release with yices2 only"/>
280284

281285
<target name="publish-artifacts-yices2" depends="load-ivy, determine-version, dist-yices2"
282286
description="Publish Java bindings for Yices2 to Ivy repo.">

build/build-publish-solvers/solver-z3-legacy.xml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ SPDX-License-Identifier: Apache-2.0
1414
<project name="publish-solvers-z3-legacy" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
1515

1616
<property name="z3legacy.dist.dir" value="${ivy.solver.dist.dir}/z3legacy"/>
17+
<property name="z3legacy.project.name" value="Java Bindings for Z3 (4.5.0)"/>
18+
<property name="z3legacy.javadoc.dir" value="downloads/javadoc/z3-legacy"/>
1719

1820
<import file="macros.xml"/>
1921

@@ -74,7 +76,7 @@ SPDX-License-Identifier: Apache-2.0
7476
<arg value="--java"/>
7577
</exec>
7678
<exec executable="make" dir="${z3.path}/build" failonerror="true">
77-
<arg value="-j"/>
79+
<arg value="-j8"/>
7880
</exec>
7981
<exec executable="make" dir="${z3.path}/build" failonerror="true">
8082
<arg value="install"/>
@@ -99,7 +101,7 @@ SPDX-License-Identifier: Apache-2.0
99101
<arg value="--java"/>
100102
</exec>
101103
<exec executable="make" dir="${z3.path}/build" failonerror="true">
102-
<arg value="-j"/>
104+
<arg value="-j8"/>
103105
</exec>
104106
<exec executable="make" dir="${z3.path}/build" failonerror="true">
105107
<arg value="install"/>
@@ -130,7 +132,54 @@ SPDX-License-Identifier: Apache-2.0
130132
<copy file="${z3.installPathLinuxX64}/lib/com.microsoft.z3legacy.jar" tofile="${z3legacy.dist.dir}/com.microsoft.z3legacy-${z3.legacy.version}.jar" failonerror="true"/>
131133
</target>
132134

133-
<target name="publish-z3-legacy" depends="package-z3-legacy, load-ivy"
135+
<target name="prepare-z3-legacy-sources" depends="set-properties-for-z3-legacy">
136+
<delete dir="${z3.path}/build"/>
137+
<exec executable="python3" dir="${z3.path}" failonerror="true">
138+
<arg value="scripts/mk_make.py"/>
139+
<arg value="--java"/>
140+
</exec>
141+
</target>
142+
143+
<target name="package-z3-legacy-sources" depends="prepare-z3-legacy-sources">
144+
<jar destfile="${z3legacy.dist.dir}/com.microsoft.z3legacy-${z3.legacy.version}-sources.jar" whenmanifestonly="fail">
145+
<zipfileset dir="${z3.path}/src/api/java" includes="**/*.java"/>
146+
<zipfileset dir="${z3.path}/" includes="LICENSE.txt" prefix="META-INF"/>
147+
<manifest>
148+
<attribute name="Implementation-Title" value="${z3legacy.project.name}"/>
149+
<attribute name="Implementation-Version" value="${z3.legacy.version}"/>
150+
</manifest>
151+
</jar>
152+
</target>
153+
154+
<target name="package-z3-legacy-javadoc" depends="prepare-z3-legacy-sources">
155+
<delete dir="${z3legacy.javadoc.dir}" quiet="true"/>
156+
<javadoc destdir="${z3legacy.javadoc.dir}"
157+
classpathref="classpath"
158+
locale="en_US"
159+
encoding="utf-8"
160+
windowtitle="${z3legacy.project.name}"
161+
failonerror="false"
162+
failonwarning="false">
163+
<fileset dir="${z3.path}/src/api/java">
164+
<include name="**/*.java"/>
165+
</fileset>
166+
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/"/>
167+
<doctitle><![CDATA[<h1>${z3legacy.project.name}</h1>]]></doctitle>
168+
<arg line="${javadoc.doclint}"/>
169+
<!-- JVM inherits system language. We need to force it to use en_US instead of local language. -->
170+
<arg value="-J-Duser.language=en" />
171+
<arg value="-J-Duser.country=US" />
172+
<arg value="-locale" /><arg value="en_US" />
173+
<arg value="-docencoding" /><arg value="UTF-8" />
174+
<arg value="-charset" /><arg value="UTF-8" />
175+
</javadoc>
176+
<jar jarfile="${z3legacy.dist.dir}/com.microsoft.z3legacy-${z3.legacy.version}-javadoc.jar" whenmanifestonly="fail">
177+
<zipfileset dir="${z3.path}/" includes="LICENSE.txt" prefix="META-INF"/>
178+
<fileset dir="${z3legacy.javadoc.dir}"/>
179+
</jar>
180+
</target>
181+
182+
<target name="publish-z3-legacy" depends="package-z3-legacy, package-z3-legacy-sources, package-z3-legacy-javadoc, load-ivy"
134183
description="Publish Z3 legacy binaries to Ivy repo.">
135184
<ivy:resolve conf="solver-z3-legacy,solver-z3-legacy-x64" file="solvers_ivy_conf/ivy_z3-legacy.xml"/>
136185
<publishToRepository solverName="Z3-legacy" solverVersion="${z3.legacy.version}" distDir="${z3legacy.dist.dir}"/>

build/build-publish-solvers/solver-z3.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ SPDX-License-Identifier: Apache-2.0
164164
windowtitle="${z3.project.name}"
165165
failonerror="false"
166166
failonwarning="false"
167-
overview="doc/javadoc_overview.html"
168167
>
169168
<fileset dir="${z3.path}/src/api/java">
170169
<include name="**/*.java"/>

doc/Developers-How-to-Release-into-Ivy.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -439,40 +439,32 @@ In `solvers_ivy_conf/ivy_javasmt_yices2.xml` update the version of the `javasmt-
439439
dependency:
440440

441441
```xml
442-
<dependency org="org.sosy_lab" name="javasmt-solver-yices2" rev="2.8.0-prerelease" conf="runtime->solver-yices2"/>
442+
<dependency org="org.sosy_lab" name="javasmt-solver-yices2" rev="2.8.0-prerelease" .../>
443443
```
444444

445445
Then, in `lib/ivy.xml` start looking for the following section:
446446

447447
```xml
448448
<!-- additional JavaSMT components with Solver Binaries -->
449-
<dependency org="org.sosy_lab" name="javasmt-yices2" rev="5.0.1-722-g90a66d7fa" conf="runtime-yices2->runtime; contrib->sources"/>
449+
<dependency org="org.sosy_lab" name="javasmt-yices2" rev="6.0.0-141-g04134287c" conf="runtime-yices2->runtime; contrib->sources,javadoc"/>
450450
```
451451

452-
Remove the dependency and replace it with the line from `ivy_javasmt_yices2.xml`, except that
453-
`conf` has been changed to `runtime-yices2->solver-yices2`:
452+
Remove the dependency and replace it with a dependency on the solvers:
454453

455454
```xml
456-
<dependency org="org.sosy_lab" name="javasmt-solver-yices2" rev="2.8.0-prerelease" conf="runtime-yices2->solver-yices2"/>
455+
<dependency org="org.sosy_lab" name="javasmt-solver-yices2" rev="2.8.0-prerelease" conf="runtime-yices2->solver-yices2; contrib->sources,javadoc"/>
456+
<dependency org="org.sosy_lab" name="javasmt-solver-yices2" rev="2.8.0-prerelease" conf="runtime->solver-yices2; contrib->sources,javadoc"/>
457457
```
458458

459-
Then run `ant` to build the project
460-
461-
Now go to the dependency in `ivy.xml` again and change `conf` back to `runtime->solver-yices2`:
462-
463-
```xml
464-
<dependency org="org.sosy_lab" name="javasmt-solver-yices2" rev="2.8.0-prerelease" conf="runtime->solver-yices2"/>
465-
```
466-
467-
Then publish the GPL components of JavaSMT:
459+
Then publish the Yices components of JavaSMT:
468460
```shell
469-
ant publish-artifacts-yices2 -Dversion=yices2.8-prerelease
461+
ant publish-artifacts-yices2
470462
```
471463

472464
Finally, return the dependency in `ivy.xml` to its original form, but with the version updated:
473465

474466
```xml
475-
<dependency org="org.sosy_lab" name="javasmt-yices2" rev="yices2.8-prerelease" conf="runtime-yices2->runtime; contrib->sources"/>
467+
<dependency org="org.sosy_lab" name="javasmt-yices2" rev="yices2.8-prerelease" conf="runtime-yices2->runtime; contrib->sources,javadoc"/>
476468
```
477469

478470
Optionally, you may now publish a new version of JavaSMT:

0 commit comments

Comments
 (0)