Skip to content

Commit 8e9f734

Browse files
authored
Maven release (#108)
* Maven publish config * Maven publish config * Test: maven release action * Disable sign * Try remove string quotes * Try fix gpg sign * deploy all packages * Rename package from `ork.ksmt` to `io.ksmt` * Enable maven deploy * Add javadoc * try give more memory for dokka * Update release workflow * Update docs and examples * Upgrade version to 0.5.2
1 parent f0f0fc6 commit 8e9f734

File tree

256 files changed

+4345
-4260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+4345
-4260
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ jobs:
2222
- name: Build artifacts
2323
uses: gradle/gradle-build-action@v2
2424
with:
25-
arguments: publishAllPublicationsToReleaseDirRepository
25+
arguments: |
26+
publishAllPublicationsToCentralRepository
27+
publishAllPublicationsToReleaseDirRepository
28+
--no-daemon
29+
-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=2G
30+
-PmavenDeployUrl=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
31+
-PmavenDeployUser=${{ secrets.MAVEN_CENTRAL_USER }}
32+
-PmavenDeployPassword=${{ secrets.MAVEN_CENTRAL_PASSWORD }}
33+
-PmavenSignGpgKey="${{ secrets.MAVEN_SIGN_GPG_KEY }}"
34+
-PmavenSignGpgPassword=${{ secrets.MAVEN_SIGN_GPG_PASSWORD }}
2635
2736
- name: Upload release artifacts
2837
uses: softprops/action-gh-release@v1

.github/workflows/run-long-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
uses: gradle/gradle-build-action@v2
158158
with:
159159
arguments: |
160-
:ksmt-test:test --tests ${{ format('"org.ksmt.test.benchmarks.{0}"', matrix.test) }}
160+
:ksmt-test:test --tests ${{ format('"io.ksmt.test.benchmarks.{0}"', matrix.test) }}
161161
--no-daemon
162162
--continue
163163
-PrunBenchmarksBasedTests=true

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@
22
Kotlin API for various SMT solvers.
33

44
[![KSMT: build](https://github.com/UnitTestBot/ksmt/actions/workflows/build-and-run-tests.yml/badge.svg)](https://github.com/UnitTestBot/ksmt/workflows/build-and-run-tests.yml)
5-
[![JitPack](https://jitpack.io/v/UnitTestBot/ksmt.svg)](https://jitpack.io/#UnitTestBot/ksmt)
5+
![Maven Central](https://img.shields.io/maven-central/v/io.ksmt/ksmt-core)
66

77
# Getting started
8-
Install via [JitPack](https://jitpack.io/) and [Gradle](https://gradle.org/).
8+
Install via [Gradle](https://gradle.org/).
99

1010
```kotlin
11-
// JitPack repository
12-
repositories {
13-
maven { url = uri("https://jitpack.io") }
14-
}
15-
1611
// core
17-
implementation("com.github.UnitTestBot.ksmt:ksmt-core:0.5.1")
12+
implementation("io.ksmt:ksmt-core:0.5.2")
1813
// z3 solver
19-
implementation("com.github.UnitTestBot.ksmt:ksmt-z3:0.5.1")
14+
implementation("io.ksmt:ksmt-z3:0.5.2")
2015
```
2116

2217
## Usage

Requirements.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| [External process runner](#external-process-runner) | Done |
1515
| [Portfolio solver](#portfolio-solver) | Done |
1616
| [Solver configuration API](#solver-configuration-api) | Done |
17-
| [Deployment](#deployment) | Done partially |
17+
| [Deployment](#deployment) | Done |
1818
| [Expression simplification / evaluation](#expression-simplification--evaluation) | Done |
1919
| [Performance tests](#performance-tests) | TODO |
2020
| [Better Z3 API](#better-z3-api) | Done partially |
@@ -34,7 +34,7 @@
3434
Provide a solver-independent formula representation
3535
with back and forth transformations to the solver's native representation.
3636
Such representation allows introspection of formulas and transformation of formulas
37-
independent of the solver. Check out [KASt](ksmt-core/src/main/kotlin/org/ksmt/KAst.kt) and its inheritors
37+
independent of the solver. Check out [KASt](ksmt-core/src/main/kotlin/io/ksmt/KAst.kt) and its inheritors
3838
for implementation details.
3939

4040
### Expression interning
@@ -44,19 +44,19 @@ Interning (aka [hash consing](https://en.wikipedia.org/wiki/Hash_consing)) is ne
4444
1. **Constant time ast comparison.** Otherwise, we need to compare trees.
4545
2. **Ast deduplication.** We can have many duplicate nodes (e.g. constants).
4646

47-
Currently, interning is implemented via [KContext](ksmt-core/src/main/kotlin/org/ksmt/KContext.kt) which
47+
Currently, interning is implemented via [KContext](ksmt-core/src/main/kotlin/io/ksmt/KContext.kt) which
4848
manages all created asts.
4949

5050
### Basic theories support
5151

5252
Support theories in KSMT expressions system. Each theory consists of:
5353

5454
1. **Expressions.** Theory specific operations over terms.
55-
All implementations are in [expr](ksmt-core/src/main/kotlin/org/ksmt/expr) package.
55+
All implementations are in [expr](ksmt-core/src/main/kotlin/io/ksmt/expr) package.
5656
2. **Sorts.** Theory specific types.
57-
All implementations are in [sort](ksmt-core/src/main/kotlin/org/ksmt/sort) package.
57+
All implementations are in [sort](ksmt-core/src/main/kotlin/io/ksmt/sort) package.
5858
3. **Declarations.** Declarations (name, argument sorts, result sort) of theory specific functions.
59-
All implementations are in [decl](ksmt-core/src/main/kotlin/org/ksmt/decl) package.
59+
All implementations are in [decl](ksmt-core/src/main/kotlin/io/ksmt/decl) package.
6060

6161
KSMT expression system supports following theories and their combinations:
6262

@@ -78,7 +78,7 @@ Main goals are:
7878
1. Allow the user to instantiate KSMT expressions from SMT-LIB.
7979
2. Provide us the opportunity to use a rich database of [benchmarks](https://smtlib.cs.uiowa.edu/benchmarks.shtml).
8080

81-
Currently, [implemented](ksmt-z3/src/main/kotlin/org/ksmt/solver/z3/KZ3SMTLibParser.kt) on top of Z3 SMT solver.
81+
Currently, [implemented](ksmt-z3/src/main/kotlin/io/ksmt/solver/z3/KZ3SMTLibParser.kt) on top of Z3 SMT solver.
8282
A solver-agnostic implementation may be done in the future.
8383

8484
### SMT-LIB2 serializer
@@ -96,7 +96,7 @@ Can be implemented on top of the Z3 SMT solver (easy version) or in a solver-ind
9696

9797
If some solver doesn't support some theory (e.g. BV) or some feature (e.g. unsat-core generation) we need to throw
9898
specialized exception.
99-
Currently, [KSolverUnsupportedFeatureException](ksmt-core/src/main/kotlin/org/ksmt/solver/KSolverUnsupportedFeatureException.kt)
99+
Currently, [KSolverUnsupportedFeatureException](ksmt-core/src/main/kotlin/io/ksmt/solver/KSolverUnsupportedFeatureException.kt)
100100
is thrown.
101101

102102
To simplify the user experience, the exception may contain a recommendation to switch to another solver.
@@ -114,7 +114,7 @@ Features:
114114
5. Incremental solving via push/pop.
115115
6. Incremental solving via assumptions.
116116

117-
For implementation details, check out [KSolver](ksmt-core/src/main/kotlin/org/ksmt/solver/KSolver.kt).
117+
For implementation details, check out [KSolver](ksmt-core/src/main/kotlin/io/ksmt/solver/KSolver.kt).
118118

119119
### Z3 solver support
120120

@@ -124,7 +124,7 @@ Z3 has native support for all theories,
124124
listed in [KSMT supported theories](#basic-theories-support)
125125
and provides all the functionality, listed in [SMT solver features](#smt-solver-support).
126126

127-
For implementation details, check out [KZ3Solver](ksmt-z3/src/main/kotlin/org/ksmt/solver/z3/KZ3Solver.kt).
127+
For implementation details, check out [KZ3Solver](ksmt-z3/src/main/kotlin/io/ksmt/solver/z3/KZ3Solver.kt).
128128

129129
### Bitwuzla solver support
130130

@@ -147,7 +147,7 @@ For the solver features, listed in [SMT solver features](#smt-solver-support),
147147
Bitwuzla provides full native support.
148148

149149
For implementation details, check
150-
out [KBitwuzlaSolver](ksmt-bitwuzla/src/main/kotlin/org/ksmt/solver/bitwuzla/KBitwuzlaSolver.kt).
150+
out [KBitwuzlaSolver](ksmt-bitwuzla/src/main/kotlin/io/ksmt/solver/bitwuzla/KBitwuzlaSolver.kt).
151151

152152
### Yices2 solver support
153153

@@ -204,11 +204,9 @@ For implementation details, check out [corresponding PR](https://github.com/Unit
204204

205205
### Deployment
206206

207-
Deliver KSMT to end users.
207+
Deliver KSMT to end users.
208208

209-
Currently, we use [JitPack](https://jitpack.io) for deployment.
210-
211-
Use Maven Central in the future.
209+
Released on [Maven Central](https://central.sonatype.com/namespace/io.ksmt).
212210

213211
### Expression simplification / evaluation
214212

@@ -218,7 +216,7 @@ Implement simplification rules for KSMT expressions, and apply it to:
218216
3. Expression evaluation wrt model (special case of simplification)
219217

220218
List of currently implemented simplification
221-
rules: [simplification rules](ksmt-core/src/main/kotlin/org/ksmt/expr/rewrite/simplify/Rules.md)
219+
rules: [simplification rules](ksmt-core/src/main/kotlin/io/ksmt/expr/rewrite/simplify/Rules.md)
222220

223221
### Performance tests
224222

buildSrc/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ val versions = loadProperties(rootDir.parentFile.resolve("version.properties").a
1414

1515
dependencies {
1616
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${versions["kotlin"]}")
17+
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${versions["kotlin"]}")
1718
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${versions["detekt"]}")
1819
implementation("de.undercouch.download:de.undercouch.download.gradle.plugin:5.1.0")
1920
}
Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,61 @@
1+
import gradle.kotlin.dsl.accessors._87b80c14bf1c4d505c7a71d7741e0994.signing
12
import org.gradle.api.Project
2-
import org.gradle.api.component.AdhocComponentWithVariants
3-
import org.gradle.api.component.SoftwareComponent
3+
import org.gradle.api.publish.maven.MavenPublication
44
import org.gradle.kotlin.dsl.get
55

6-
fun Project.removeTestFixtures(softwareComponent: SoftwareComponent) {
7-
with(softwareComponent as AdhocComponentWithVariants) {
8-
withVariantsFromConfiguration(configurations["testFixturesApiElements"]) {
9-
skip()
6+
fun MavenPublication.addKsmtPom() {
7+
pom {
8+
packaging = "jar"
9+
name.set("io.ksmt")
10+
description.set("Kotlin API for various SMT solvers")
11+
url.set("https://www.ksmt.io/")
12+
13+
licenses {
14+
license {
15+
name.set("The Apache License, Version 2.0")
16+
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
17+
}
18+
}
19+
20+
issueManagement {
21+
url.set("https://github.com/UnitTestBot/ksmt/issues")
22+
}
23+
24+
scm {
25+
connection.set("scm:git:https://github.com/UnitTestBot/ksmt.git")
26+
developerConnection.set("scm:git:https://github.com/UnitTestBot/ksmt.git")
27+
url.set("https://github.com/UnitTestBot/ksmt")
28+
}
29+
30+
developers {
31+
developer {
32+
id.set("saloed")
33+
name.set("Valentyn Sobol")
34+
email.set("[email protected]")
35+
}
36+
37+
developer {
38+
id.set("CaelmBleidd")
39+
name.set("Alexey Menshutin")
40+
email.set("[email protected]")
41+
}
1042
}
11-
withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) {
12-
skip()
43+
}
44+
}
45+
46+
fun MavenPublication.signKsmtPublication(project: Project) = with(project) {
47+
signing {
48+
val gpgKey = project.stringProperty("mavenSignGpgKey")?.removeSurrounding("\"")
49+
val gpgPassword = project.stringProperty("mavenSignGpgPassword")
50+
51+
if (gpgKey != null && gpgPassword != null) {
52+
useInMemoryPgpKeys(gpgKey, gpgPassword)
53+
sign(this@signKsmtPublication)
1354
}
1455
}
1556
}
57+
58+
fun MavenPublication.addSourcesAndJavadoc(project: Project) {
59+
artifact(project.tasks["kotlinSourcesJar"])
60+
artifact(project.tasks["dokkaJavadocJar"])
61+
}

buildSrc/src/main/kotlin/org.ksmt.ksmt-base.gradle.kts renamed to buildSrc/src/main/kotlin/io.ksmt.ksmt-base.gradle.kts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ plugins {
44
kotlin("jvm")
55
id("io.gitlab.arturbosch.detekt")
66
id("de.undercouch.download")
7+
id("org.jetbrains.dokka")
78
`java-library`
89
`maven-publish`
10+
signing
911
}
1012

11-
group = "org.ksmt"
12-
version = "0.5.1"
13+
group = "io.ksmt"
14+
version = "0.5.2"
1315

1416
repositories {
1517
mavenCentral()
@@ -42,11 +44,30 @@ tasks.withType<Test> {
4244
systemProperty("junit.jupiter.execution.parallel.enabled", true)
4345
}
4446

47+
tasks.register<Jar>("dokkaJavadocJar") {
48+
dependsOn(tasks.dokkaJavadoc)
49+
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
50+
archiveClassifier.set("javadoc")
51+
}
52+
4553
publishing {
4654
repositories {
4755
maven {
4856
name = "releaseDir"
4957
url = uri(layout.buildDirectory.dir("release"))
5058
}
59+
60+
val mavenDeployUrl = project.stringProperty("mavenDeployUrl")
61+
if (mavenDeployUrl != null) {
62+
maven {
63+
name = "central"
64+
url = uri(mavenDeployUrl)
65+
66+
credentials {
67+
username = project.stringProperty("mavenDeployUser") ?: ""
68+
password = project.stringProperty("mavenDeployPassword") ?: ""
69+
}
70+
}
71+
}
5172
}
5273
}

docs/getting-started.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,30 @@ For code examples, please check out our [project](/examples).
44

55
## Installation
66

7-
Installation via [JitPack](https://jitpack.io/) and [Gradle](https://gradle.org/).
7+
Install via [Gradle](https://gradle.org/).
88

9-
#### 1. Enable JitPack repository in your build configuration:
9+
#### 1. Enable Maven Central repository in your build configuration:
1010
```kotlin
11-
// JitPack repository
1211
repositories {
13-
maven { url = uri("https://jitpack.io") }
12+
mavenCentral()
1413
}
1514
```
1615

1716
#### 2. Add KSMT core dependency:
1817
```kotlin
1918
dependencies {
2019
// core
21-
implementation("com.github.UnitTestBot.ksmt:ksmt-core:0.5.1")
20+
implementation("io.ksmt:ksmt-core:0.5.2")
2221
}
2322
```
2423

2524
#### 3. Add one or more SMT solver dependencies:
2625
```kotlin
2726
dependencies {
2827
// z3
29-
implementation("com.github.UnitTestBot.ksmt:ksmt-z3:0.5.1")
28+
implementation("io.ksmt:ksmt-z3:0.5.2")
3029
// bitwuzla
31-
implementation("com.github.UnitTestBot.ksmt:ksmt-bitwuzla:0.5.1")
30+
implementation("io.ksmt:ksmt-bitwuzla:0.5.2")
3231
}
3332
```
3433
SMT solver specific packages are provided with solver native binaries.
@@ -51,7 +50,7 @@ In this example, we want to create an expression
5150
over Boolean variable `a` and integer variables `b` and `c`.
5251

5352
```kotlin
54-
import org.ksmt.utils.getValue
53+
import io.ksmt.utils.getValue
5554

5655
with(ctx) {
5756
// create symbolic variables

examples/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ plugins {
55

66
repositories {
77
mavenCentral()
8-
maven { url = uri("https://jitpack.io") }
98
}
109

1110
dependencies {
1211
// core
13-
implementation("com.github.UnitTestBot.ksmt:ksmt-core:0.5.1")
12+
implementation("io.ksmt:ksmt-core:0.5.2")
1413
// z3 solver
15-
implementation("com.github.UnitTestBot.ksmt:ksmt-z3:0.5.1")
14+
implementation("io.ksmt:ksmt-z3:0.5.2")
1615
}
1716

1817
java {

examples/src/main/java/Sudoku.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import org.ksmt.KContext;
2-
import org.ksmt.expr.KExpr;
3-
import org.ksmt.expr.KInt32NumExpr;
4-
import org.ksmt.solver.KModel;
5-
import org.ksmt.solver.KSolver;
6-
import org.ksmt.solver.KSolverStatus;
7-
import org.ksmt.solver.z3.KZ3Solver;
8-
import org.ksmt.sort.KBoolSort;
9-
import org.ksmt.sort.KIntSort;
1+
import io.ksmt.KContext;
2+
import io.ksmt.expr.KExpr;
3+
import io.ksmt.expr.KInt32NumExpr;
4+
import io.ksmt.solver.KModel;
5+
import io.ksmt.solver.KSolver;
6+
import io.ksmt.solver.KSolverStatus;
7+
import io.ksmt.solver.z3.KZ3Solver;
8+
import io.ksmt.sort.KBoolSort;
9+
import io.ksmt.sort.KIntSort;
1010

1111
import java.util.ArrayList;
1212
import java.util.Collection;

0 commit comments

Comments
 (0)