-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle.kts
111 lines (86 loc) · 3.31 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import com.jetbrains.rd.generator.gradle.RdGenExtension
import com.jetbrains.rd.generator.gradle.RdGenTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("io.ksmt.ksmt-base")
id("com.jetbrains.rdgen") version "2022.3.2"
}
repositories {
mavenCentral()
}
val rdgenModelsCompileClasspath by configurations.creating {
extendsFrom(configurations.compileClasspath.get())
}
kotlin {
sourceSets.create("rdgenModels").apply {
kotlin.srcDir("src/main/rdgen")
}
}
dependencies {
implementation(project(":ksmt-core"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
api("com.jetbrains.rd:rd-core:2022.3.2")
api("com.jetbrains.rd:rd-framework:2022.3.2")
rdgenModelsCompileClasspath("com.jetbrains.rd:rd-gen:2022.3.2")
testImplementation(kotlin("test"))
testImplementation(project(":ksmt-z3"))
testImplementation(project(":ksmt-bitwuzla"))
testImplementation(project(":ksmt-yices"))
testImplementation(project(":ksmt-cvc5"))
}
val sourcesBaseDir = projectDir.resolve("src/main/kotlin")
val generatedPackage = "io.ksmt.runner.generated"
val generatedSourceDir = sourcesBaseDir.resolve(generatedPackage.replace('.', '/'))
val generatedModelsPackage = "$generatedPackage.models"
val generatedModelsSourceDir = sourcesBaseDir.resolve(generatedModelsPackage.replace('.', '/'))
val generateModels = tasks.register<RdGenTask>("generateProtocolModels") {
val rdParams = extensions.getByName("params") as RdGenExtension
val sourcesDir = projectDir.resolve("src/main/rdgen").resolve("io/ksmt/runner/models")
group = "rdgen"
rdParams.verbose = true
rdParams.sources(sourcesDir)
rdParams.hashFolder = buildDir.resolve("rdgen/hashes").absolutePath
// where to search roots
rdParams.packages = "io.ksmt.runner.models"
rdParams.generator {
language = "kotlin"
transform = "symmetric"
root = "io.ksmt.runner.models.SolverProtocolRoot"
directory = generatedModelsSourceDir.absolutePath
namespace = generatedModelsPackage
}
rdParams.generator {
language = "kotlin"
transform = "symmetric"
root = "io.ksmt.runner.models.TestProtocolRoot"
directory = generatedModelsSourceDir.absolutePath
namespace = generatedModelsPackage
}
rdParams.generator {
language = "kotlin"
transform = "symmetric"
root = "io.ksmt.runner.models.SyncProtocolRoot"
directory = generatedModelsSourceDir.absolutePath
namespace = generatedModelsPackage
}
}
val generateSolverUtils = tasks.register("generateSolverUtils") {
val generatorProject = project(":ksmt-runner:solver-generator")
generatorProject.ext["generatedSolverUtilsPackage"] = generatedPackage
generatorProject.ext["generatedSolverUtilsPath"] = generatedSourceDir.absolutePath
dependsOn(":ksmt-runner:solver-generator:generateSolverUtils")
}
tasks.getByName<KotlinCompile>("compileKotlin") {
// don't treat warnings as errors because of warnings in generated rd models
kotlinOptions.allWarningsAsErrors = false
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
addKsmtPom()
addSourcesAndJavadoc(project)
signKsmtPublication(project)
}
}
}