This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
168 lines (136 loc) · 4.52 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import java.nio.file.Paths
import java.time.LocalDateTime
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
buildscript {
repositories {
mavenLocal()
}
}
plugins {
id "java"
id "application"
id "org.mikeneck.graalvm-native-image" version "0.3.0"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://dl.bintray.com/micronaut/core-releases-local" }
maven { url = 'https://oss.sonatype.org/service/local/repositories/releases/content' }
}
sourceCompatibility = JavaVersion.VERSION_11
mainClassName = "com.mageddo.Application"
nativeImage {
graalVmHome = System.getProperty("java.home")
mainClass = mainClassName
executableName = project.name
arguments(
"--no-server",
"-J-Xmx4G"
)
}
configurations {
compile.exclude module: 'spring-jcl'
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
annotationProcessor("io.micronaut:micronaut-validation:${micronautVersion}")
compileOnly "io.micronaut:micronaut-inject-java:${micronautVersion}"
annotationProcessor("io.micronaut:micronaut-inject-java:${micronautVersion}")
compileOnly('com.mageddo:rsl:1.0.0')
annotationProcessor("com.mageddo:rsl-compiler:1.0.1")
compileOnly("com.mageddo.nativeimage:reflection-config-generator:2.3.4")
annotationProcessor("com.mageddo.nativeimage:reflection-config-generator:2.3.4")
compile("org.flywaydb:flyway-core:6.4.1")
compile("com.zaxxer:HikariCP:3.3.1")
// compile("org.xerial:sqlite-jdbc:3.27.2")
compile("org.postgresql:postgresql:42.2.5")
compile("org.springframework:spring-jdbc:5.1.5.RELEASE")
compile("io.micronaut:micronaut-spring:${micronautVersion}")
compile "io.micronaut:micronaut-validation:${micronautVersion}"
compile "io.micronaut:micronaut-http-server-netty:${micronautVersion}"
compile "io.micronaut:micronaut-runtime:${micronautVersion}"
compile "io.micronaut:micronaut-inject:${micronautVersion}"
compile("com.mageddo:commons:1.5.0")
compile("org.apache.commons:commons-lang3:3.8.1")
compile("io.micronaut:micronaut-views-thymeleaf:1.2.0")
runtimeOnly("ch.qos.logback:logback-classic:1.2.3")
compile("com.atlassian.commonmark:commonmark:0.13.1")
compile("com.atlassian.commonmark:commonmark-ext-gfm-tables:0.13.1")
// tag:graal[]
compileOnly("com.oracle.substratevm:svm:19.2.1")
annotationProcessor "io.micronaut:micronaut-graal:${micronautVersion}"
compile("org.graalvm.sdk:graal-sdk:${graalVMVersion}")
compile("commons-logging:commons-logging:1.2")
// end:graal[]
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor "io.micronaut:micronaut-inject-java:${micronautVersion}"
testCompileOnly('com.mageddo:rsl:1.0.0')
testAnnotationProcessor('com.mageddo:rsl-compiler:1.0.1')
testCompile "io.micronaut:micronaut-inject-java:${micronautVersion}"
testCompile("io.micronaut.test:micronaut-test-junit5:1.0.2")
testCompile('org.junit.jupiter:junit-jupiter:5.4.0')
testCompile("io.rest-assured:rest-assured:3.3.0")
testCompile("org.hamcrest:hamcrest:2.1")
testCompile("org.skyscreamer:jsonassert:1.5.0")
}
task debug(type: JavaExec) {
debug = true
classpath = sourceSets.main.runtimeClasspath
main = mainClassName
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
exclude '**/*IntTest*'
}
task intTest(type: Test) {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
outputs.upToDateWhen {
false
}
include '**/*IntTest*'
failFast = true
}
task copyStatics() {
doLast {
def binFilePath = "${project.buildDir}/native-image/"
def distPath = Paths.get("${binFilePath}/dist")
ant.delete(dir: "${distPath}")
/**
* Copying static files
*/
ant.copy(
todir: "${binFilePath}/conf"
) {
fileset(dir: "${project.sourceSets.main.output.resourcesDir}") {
include(name: "db/**")
}
}
/**
* Create a distribution file
*/
ant.zip(destfile: "${distPath}/${project.name}.zip") {
zipfileset(dir: binFilePath, filemode: "755", includes: project.name)
zipfileset(dir: binFilePath, excludes: project.name)
}
}
}
task heartbeat() {
doLast() {
Executors.newSingleThreadExecutor().submit({
while (!Thread.currentThread().isInterrupted()) {
println "${LocalDateTime.now()} ping"
TimeUnit.MINUTES.sleep(1);
}
})
}
}