@@ -5,7 +5,7 @@ This file is part of JavaSMT,
55an API wrapper for a collection of SMT solvers:
66https://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
1010SPDX-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
0 commit comments