-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
159 lines (136 loc) · 4.36 KB
/
Copy pathbuild.gradle
File metadata and controls
159 lines (136 loc) · 4.36 KB
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
plugins {
id "java"
id "groovy"
id "com.github.johnrengelman.shadow"
id "io.micronaut.application"
id "io.micronaut.aot"
id "org.owasp.dependencycheck"
id "com.andrzejpiontek.version-bump"
id "org.ajoberstar.grgit" version "5.0.0-rc.3"
}
version = "0.52.2"
group = "com.poliglotek"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// micronaut
implementation platform("io.micronaut:micronaut-bom:3.10.4")
implementation "io.micronaut.serde:micronaut-serde-jackson"
implementation "io.micronaut.validation:micronaut-validation"
implementation "io.micronaut:micronaut-http-client"
implementation "io.micronaut.security:micronaut-security-oauth2"
implementation "io.micronaut.security:micronaut-security-jwt"
implementation "io.micronaut.gcp:micronaut-gcp-common"
implementation "io.micronaut.gcp:micronaut-gcp-logging" // google cloud logging support
implementation "io.micronaut.cache:micronaut-cache-core"
implementation "io.micronaut.cache:micronaut-cache-caffeine"
annotationProcessor "io.micronaut.validation:micronaut-validation-processor"
annotationProcessor "io.micronaut.serde:micronaut-serde-processor"
annotationProcessor "io.micronaut:micronaut-http-validation"
testImplementation "io.micronaut:micronaut-http-client"
// google
implementation "com.google.api-client:google-api-client:_"
implementation "com.google.cloud:google-cloud-firestore:_"
implementation "com.google.cloud:google-cloud-translate:_"
// logging
implementation "ch.qos.logback:logback-classic:_"
implementation "org.fusesource.jansi:jansi:_" // coloured console output
// web scraping
implementation "org.jsoup:jsoup:_" // static pages
implementation "org.seleniumhq.selenium:selenium-java:_" // dynamic pages
// testing
testImplementation "net.bytebuddy:byte-buddy:_" // to mock classes and generate mock implementations
testImplementation "org.objenesis:objenesis:_" // to mock classes without default constructors
implementation "org.yaml:snakeyaml:_"
// implementation "com.mailgun:mailgun-java:_"
}
application {
mainClass = "com.poliglotek.Application"
}
java {
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
}
micronaut {
runtime "netty"
testRuntime "spock2"
processing {
incremental true
annotations "com.poliglotek.*"
}
aot {
// https://micronaut-projects.github.io/micronaut-aot/latest/guide/
optimizeServiceLoading = false
convertYamlToJava = false
precomputeOperations = true
cacheEnvironment = true
optimizeClassLoading = true
deduceEnvironment = true
optimizeNetty = true
replaceLogbackXml = true
}
}
dependencyCheck {
nvd {
apiKey = System.getenv("nvdApiKey")
}
}
tasks.register("installGitHook", Copy) {
from new File(rootProject.rootDir, "scripts/pre-commit")
into { new File(rootProject.rootDir, ".git/hooks") }
filePermissions {
user {
read = true
write = true
execute = true
}
group {
read = true
write = false
execute = true
}
other {
read = true
write = false
execute = true
}
}
}
tasks.named("compileJava") {
dependsOn installGitHook
}
versionBump{ }
tasks.register("buildFrontend", Exec) {
def environment = System.getenv("MICRONAUT_ENVIRONMENTS")
workingDir "src/frontend"
if (environment == "dev") {
println("Building front-end for dev environment")
commandLine "npm", "run", "build-dev"
} else {
println("Building front-end for prod environment")
commandLine "npm", "run", "build-prod"
}
}
tasks.register("copyFrontend", Copy) {
dependsOn buildFrontend
from "src/frontend/dist/frontend"
into "src/main/resources/public"
}
tasks.named("copyFrontend") {
outputs.dir("src/main/resources/public")
}
tasks.named("processResources") {
dependsOn copyFrontend
}
tasks.named("classes") {
dependsOn copyFrontend
}
tasks.named("inspectRuntimeClasspath") {
dependsOn copyFrontend
}
tasks.withType(Test).configureEach {
enabled = false // if set to `false` will exclude tests when running build
}
build.dependsOn copyFrontend