diff --git a/doc/Example-Ivy-Project/README.md b/doc/Example-Ivy-Project/README.md new file mode 100644 index 0000000000..6d94b06f17 --- /dev/null +++ b/doc/Example-Ivy-Project/README.md @@ -0,0 +1,23 @@ + + +This is an example application for using JavaSMT with Ant/Ivy. +The example application prints a table of the available SMT solvers, along with their version +number. + +The project supports the following build steps: + +- `resolve` retrieve dependencies with Ivy +- `compile` compile the project +- `package` build a .jar +- `run` run the program +- `clean` clean the project + +Calling `ant` with no target will build and then execute the project. \ No newline at end of file diff --git a/doc/Example-Ivy-Project/build.xml b/doc/Example-Ivy-Project/build.xml new file mode 100644 index 0000000000..bedc9b252f --- /dev/null +++ b/doc/Example-Ivy-Project/build.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/Example-Ivy-Project/ivy.xml b/doc/Example-Ivy-Project/ivy.xml new file mode 100644 index 0000000000..b5a9d0238c --- /dev/null +++ b/doc/Example-Ivy-Project/ivy.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/doc/Example-Ivy-Project/lib/ivy-settings.xml b/doc/Example-Ivy-Project/lib/ivy-settings.xml new file mode 100644 index 0000000000..1da8869609 --- /dev/null +++ b/doc/Example-Ivy-Project/lib/ivy-settings.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/doc/Example-Ivy-Project/src/example/Main.java b/doc/Example-Ivy-Project/src/example/Main.java new file mode 100644 index 0000000000..4a6298c944 --- /dev/null +++ b/doc/Example-Ivy-Project/src/example/Main.java @@ -0,0 +1,34 @@ +// This file is part of JavaSMT, +// an API wrapper for a collection of SMT solvers: +// https://github.com/sosy-lab/java-smt +// +// SPDX-FileCopyrightText: 2025 Dirk Beyer +// +// SPDX-License-Identifier: Apache-2.0 + +package example; + +import org.sosy_lab.common.ShutdownNotifier; +import org.sosy_lab.common.configuration.Configuration; +import org.sosy_lab.common.configuration.InvalidConfigurationException; +import org.sosy_lab.common.log.LogManager; +import org.sosy_lab.java_smt.SolverContextFactory; +import org.sosy_lab.java_smt.SolverContextFactory.Solvers; +import org.sosy_lab.java_smt.api.SolverContext; + +public class Main { + public static void main(String[] args) { + Configuration config = Configuration.defaultConfiguration(); + LogManager logger = LogManager.createNullLogManager(); + ShutdownNotifier notifier = ShutdownNotifier.createDummy(); + + for (Solvers solver : Solvers.values()) { + try (SolverContext context = + SolverContextFactory.createSolverContext(config, logger, notifier, solver)) { + System.out.println(solver + ", " + context.getVersion()); + } catch (InvalidConfigurationException e) { + System.out.println(solver + " not available"); + } + } + } +}