-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
136 lines (114 loc) · 4.31 KB
/
build.gradle
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id 'org.jetbrains.kotlin.jvm' version "$version_kotlin"
id 'org.jetbrains.kotlin.plugin.serialization' version "$version_kotlin"
id 'org.openapi.generator' version '7.8.0'
id 'de.undercouch.download' version "5.6.0"
id 'java-library'
id 'idea'
}
allprojects {
/* Group name of our artifacts */
group = 'org.vitrivr'
/* Current version of our artifacts. */
version = '0.0.1'
/* Repositories for build script. */
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-serialization:$version_kotlin"
}
}
/* Project repositories for build script. */
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
}
subprojects {
buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-serialization:$version_kotlin"
}
}
/* Common plugins. */
apply plugin: 'idea'
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'java-test-fixtures'
/* Java Version */
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "21"
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
kotlin {
jvmToolchain(21)
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withJavadocJar()
withSourcesJar()
}
compileJava {
options.encoding = 'UTF-8'
}
/* Common dependencies. */
dependencies {
/* Caffeine */
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: version_caffeine
/* Logging */
implementation group: 'org.slf4j', name: 'slf4j-api', version: version_slf4j
implementation group: 'io.github.oshai', name: 'kotlin-logging-jvm', version: version_kotlinlogging
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: version_log4j2
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: version_log4j2
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: version_log4j2
/* Kotlin & Kotlinx */
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: version_kotlin
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: version_kotlin
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: version_kotlinx_coroutines
implementation group: 'org.jetbrains.kotlinx', name:'kotlinx-serialization-json', version: version_kotlinx_serialization
/* JUnit 5 */
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: version_junit
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: version_junit
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: version_junit
testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: version_junit_platform
testImplementation(group: "org.jetbrains.kotlinx", "name": "kotlinx-coroutines-test", version: version_kotlinx_coroutines)
}
}
/* Define required variables. */
def fullOAS = 'http://localhost:7070/openapi.json'
def oasFile = "${project.projectDir}/vitrivr-engine-server/doc/oas.json"
openApiGenerate {
generateApiTests = false
generateModelTests = false
validateSpec = false
skipValidateSpec = true
generatorName = 'kotlin'
inputSpec = oasFile
outputDir = file("${project.projectDir}/openapi/doc/kotlin").toString()
configOptions = [
npmName: '@vitrivr-engine/api',
enumPropertyNaming: 'original'
]
}
/**
* Task to generate OAS. Requires backend to run on default port.
*/
tasks.register('generateOAS', Download) {
/* This requires a locally running backend */
src fullOAS
dest oasFile
}