Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Run tests
strategy:
matrix:
os: [ ubuntu-22.04, windows-latest, macos-latest ]
os: [ ubuntu-24.04, windows-latest, macos-latest ]

runs-on: ${{ matrix.os }}

Expand Down
33 changes: 10 additions & 23 deletions ksmt-z3/ksmt-z3-native/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ plugins {
id("io.ksmt.ksmt-base")
}

val distDir = projectDir.parentFile.resolve("dist")

repositories {
mavenCentral()
flatDir { dirs(distDir) }
}

val compileConfig by configurations.creating
val z3NativeLinuxX64 by configurations.creating

val `windows-x64` by sourceSets.creating
val `linux-x64` by sourceSets.creating
Expand All @@ -21,30 +17,28 @@ val `mac-arm` by sourceSets.creating
val `windows-arm` by sourceSets.creating
val `linux-arm` by sourceSets.creating

val z3Version = "4.15.3"
val z3Version = "4.15.8"

val winDllPath = listOf("**/vcruntime140.dll", "**/vcruntime140_1.dll", "**/libz3.dll", "**/libz3java.dll")
val linuxSoPath = listOf("**/libz3.so", "**/libz3java.so")
val macDylibPath = listOf("**/libz3.dylib", "**/libz3java.dylib")

val z3Binaries = listOf(
Triple(`windows-x64`, mkZ3ReleaseDownloadTask(z3Version, "x64-win", winDllPath), null),
Triple(`linux-x64`, null, z3NativeLinuxX64),
Triple(`mac-x64`, mkZ3ReleaseDownloadTask(z3Version, "x64-osx-13.7.6", macDylibPath), null),
Triple(`mac-arm`, mkZ3ReleaseDownloadTask(z3Version, "arm64-osx-13.7.6", macDylibPath), null),
Triple(`linux-arm`, mkZ3ReleaseDownloadTask(z3Version, "arm64-glibc-2.34", linuxSoPath), null),
Pair(`windows-x64`, mkZ3ReleaseDownloadTask(z3Version, "x64-win", winDllPath)),
Pair(`linux-x64`, mkZ3ReleaseDownloadTask(z3Version, "x64-glibc-2.39", linuxSoPath)),
Pair(`mac-x64`, mkZ3ReleaseDownloadTask(z3Version, "x64-osx-15.7.3", macDylibPath)),
Pair(`mac-arm`, mkZ3ReleaseDownloadTask(z3Version, "arm64-osx-15.7.3", macDylibPath)),
Pair(`linux-arm`, mkZ3ReleaseDownloadTask(z3Version, "arm64-glibc-2.38", linuxSoPath)),
)

z3Binaries.forEach { it.first.compileClasspath = compileConfig }

dependencies {
compileConfig(project(":ksmt-core"))
compileConfig(project(":ksmt-z3:ksmt-z3-core"))

z3NativeLinuxX64("z3", "z3-native-linux-x86-64", z3Version, ext = "zip")
}

z3Binaries.forEach { (sourceSet, z3BinaryTask, nativeConfig) ->
z3Binaries.forEach { (sourceSet, z3BinaryTask) ->
val name = sourceSet.name
val artifactName = "ksmt-z3-native-$name"
val systemArch = name.replace('-', '/')
Expand All @@ -57,14 +51,10 @@ z3Binaries.forEach { (sourceSet, z3BinaryTask, nativeConfig) ->
archiveBaseName.set(artifactName)
from(sourceSet.output)

z3BinaryTask?.let {
z3BinaryTask.let {
dependsOn(it)
from(it.outputFiles) { into("lib/$systemArch/z3") }
}

nativeConfig?.let {
copyArtifactsIntoJar(it, this, "lib/$systemArch/z3")
}
}

publishing.publications {
Expand All @@ -81,17 +71,14 @@ z3Binaries.forEach { (sourceSet, z3BinaryTask, nativeConfig) ->
}

tasks.getByName<Jar>("jar") {
z3Binaries.forEach { (sourceSet, z3BinaryTask, nativeConfig) ->
z3Binaries.forEach { (sourceSet, z3BinaryTask) ->
from(sourceSet.output)

val systemArch = sourceSet.name.replace('-', '/')
z3BinaryTask?.let {
z3BinaryTask.let {
dependsOn(it)
from(it.outputFiles) { into("lib/$systemArch/z3") }
}
nativeConfig?.let {
copyArtifactsIntoJar(it, this, "lib/$systemArch/z3")
}
}
}

Expand Down
Loading