-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
126 lines (107 loc) · 4.47 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
plugins {
id("groovy")
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.micronaut.application") version "4.1.0"
id("io.micronaut.test-resources") version "4.1.0"
id("jacoco")
id("com.dorongold.task-tree") version "3.0.0"
}
version = "0.5.18"
group = "org.jacksonlaboratory"
repositories {
mavenCentral()
}
dependencies {
annotationProcessor("io.micronaut:micronaut-inject-java")
annotationProcessor("io.micronaut.data:micronaut-data-processor")
annotationProcessor("io.micronaut.serde:micronaut-serde-processor")
annotationProcessor("io.micronaut.validation:micronaut-validation-processor")
annotationProcessor("io.micronaut.openapi:micronaut-openapi")
annotationProcessor("io.micronaut.data:micronaut-data-hibernate-jpa")
implementation("io.micronaut.data:micronaut-data-hibernate-jpa")
implementation("io.micronaut.sql:micronaut-hibernate-jpa")
implementation("io.micronaut.sql:micronaut-jdbc-hikari")
implementation("jakarta.annotation:jakarta.annotation-api")
implementation("jakarta.persistence:jakarta.persistence-api")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("org.flywaydb:flyway-mysql")
runtimeOnly("com.h2database:h2:2.1.214")
implementation('org.apache.lucene:lucene-core:8.5.2')
implementation('org.apache.lucene:lucene-queryparser:8.5.2')
implementation('org.hibernate.search:hibernate-search-mapper-orm:6.1.8.Final')
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut.serde:micronaut-serde-jackson")
implementation("io.micronaut:micronaut-jackson-databind")
compileOnly("io.swagger.core.v3:swagger-annotations")
implementation("io.micronaut.flyway:micronaut-flyway")
implementation("io.micronaut.validation:micronaut-validation:4.0.3")
implementation("org.monarchinitiative.phenol:phenol-core:2.1.1"){
exclude group: 'org.slf4j', module: 'slf4j-api'
}
implementation("org.monarchinitiative.phenol:phenol-io:2.1.1"){
exclude group: 'org.slf4j', module: 'slf4j-api'
}
implementation("org.monarchinitiative.phenol:phenol-annotations:2.1.1"){
exclude group: 'org.slf4j', module: 'slf4j-api'
}
testImplementation("io.micronaut:micronaut-inject-groovy")
testImplementation('org.objenesis:objenesis:3.3')
}
application {
mainClass.set("org.jacksonlaboratory.Application")
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}
tasks.register('prepareData') {
copy {
from "${projectDir}/data/"
into "build/docker/main/data/"
}
}
tasks {
dockerfile {
baseImage("openjdk:17-ea-slim-buster")
copyFile("data/", "data/")
environmentVariable(['ONTOLOGY_SERVICE_ONTOLOGY':"${System.env.ONTOLOGY_SERVICE_ONTOLOGY}".toString(),
'ONTOLOGY_SERVICE_LOAD':"${System.env.ONTOLOGY_SERVICE_LOAD}".toString(),
'ONTOLOGY_SERVICE_INTERNATIONAL':"${System.env.ONTOLOGY_SERVICE_INTERNATIONAL}".toString()] )
entryPoint("java", "-Xmx6g", "-Xms1024m", "-jar", "/home/app/application.jar")
}
dockerBuild {
images = ["${System.env.DOCKER_IMAGE ?: "${project.name}:${project.version}"}"]
}
dockerBuildNative {
images = ["${System.env.DOCKER_IMAGE ?: "${project.name}:${project.version}"}"]
}
}
dockerfile.dependsOn('prepareData')
graalvmNative.toolchainDetection = false
micronaut {
runtime("netty")
testRuntime("spock")
processing {
incremental(true)
annotations("org.jacksonlaboratory.*")
}
}
tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.jvmArgs << "-Dmicronaut.openapi.views.spec=swagger-ui.enabled=true,swagger-ui.theme=flattop,swagger-ui.js.url=/api/${System.env.ONTOLOGY_SERVICE_ONTOLOGY}/docs/res/,swagger-ui.theme.url=/api/${System.env.ONTOLOGY_SERVICE_ONTOLOGY}/docs/,swagger-ui.spec.url=/api/${System.env.ONTOLOGY_SERVICE_ONTOLOGY}/${project.name}-${System.env.ONTOLOGY_SERVICE_ONTOLOGY}-${project.version}.yml".toString()
}
test {
systemProperty("micronaut.environments", "test")
finalizedBy("jacocoTestReport")
}
jacocoTestReport {
dependsOn("test")
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"org/jacksonlaboratory/view/*",
"org/jacksonlaboratory/Application.class"
])
}))
}
}