-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
173 lines (132 loc) · 5.14 KB
/
build.gradle.kts
File metadata and controls
173 lines (132 loc) · 5.14 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
160
161
162
163
164
165
166
167
168
169
170
171
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// spring boot versions
id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6"
// https://plugins.gradle.org/plugin/org.siouan.frontend-jdk21
id("org.siouan.frontend-jdk21") version "10.0.0"
// kotlin version
kotlin("jvm") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
kotlin("plugin.jpa") version "1.9.25"
// Annotation processors (see JSR 269) are supported
// in Kotlin with the kapt compiler plugin.
kotlin("kapt") version "1.9.25"
}
group = "br.ufrn.caze"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_21
tasks.jar {
archiveBaseName.value("holter.jar")
}
repositories {
maven("https://repo.kotlin.link")
mavenCentral()
// local libs inside the project
flatDir {
dirs("../libs")
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// MapStruct is a code generator that greatly simplifies the implementation
// of mappings between Java bean types based on a convention over configuration approach.
// https://mapstruct.org
implementation("org.mapstruct:mapstruct:1.5.5.Final")
kapt("org.mapstruct:mapstruct-processor:1.5.5.Final")
// hibernate validation
implementation("org.springframework.boot:spring-boot-starter-validation")
// jwt token
implementation("io.jsonwebtoken:jjwt-api:0.12.3")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.3")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.3")
/**
* Declaration of local libs developed by my self
*
* my library to manipulate CSV files file("lib/junit.jar")
* my library to miner information of main repositories (github, travisCI, SonarCloud, etc..)
*/
implementation (files("libs/snooper-2.13.jar"))
implementation (files("libs/gauge-ci-1.4b-plain.jar"))
implementation (files("libs/csvdataset-2.2.jar"))
/**
* The Apache Commons Math project is a library of lightweight, self-contained mathematics and statistics
* components addressing the most common practical problems not immediately available in the
* Java programming language or commons-lang.
*/
implementation("org.apache.commons:commons-math3:3.6.1")
// https://mvnrepository.com/artifact/com.github.librepdf/openpdf
implementation("com.github.librepdf:openpdf:2.0.3")
// git libraty for java
implementation("org.eclipse.jgit:org.eclipse.jgit:3.3.2.201404171909-r")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("com.h2database:h2")
testImplementation("org.springframework.boot:spring-boot-starter-test")
// Mockito mock objects library core API and implementation
// License MIT
// Categories Mocking
// HomePage https://github.com/mockito/mockito
// Date (Feb 22, 2021)
testImplementation("org.mockito:mockito-core:5.2.0")
testImplementation("org.mockito:mockito-junit-jupiter:5.2.0")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "21"
}
}
tasks.withType<JavaCompile> {
val compilerArgs = options.compilerArgs
compilerArgs.add("-Amapstruct.defaultComponentModel=spring")
}
// do not generate plain.jar (jar to be included in other application)
tasks.getByName<Jar>("jar") {
enabled = false
}
tasks.withType<Test> {
useJUnitPlatform()
}
// https://github.com/siouan/frontend-gradle-plugin
// https://siouan.github.io/frontend-gradle-plugin/configuration#dsl-reference
// build:test or build:prod
val frontendBuildType = project.findProperty("frontend_build") ?: "build"
frontend {
packageJsonDirectory.set(file("${projectDir}/src/frontend"))
nodeInstallDirectory.set(file("${projectDir}/src/frontend/.node"))
nodeDistributionUrlRoot.set("https://nodejs.org/dist/")
// corepack error on previous Node versions
// https://github.com/pnpm/pnpm/issues/9029#issuecomment-2634650201
nodeVersion.set("23.7.0")
assembleScript.set("run $frontendBuildType")
}
val frontendFolder = File( "${layout.buildDirectory.get()}/resources/main/static" )
/**
* Copy vue file to inside the jar
*/
tasks.register<Copy>("copyVueFiles") {
//doFirst {
// copy {
println("-------------------------------------------------------")
println("copying frontend from: ${projectDir}/src/frontend/dist")
println("copying frontend to: ${layout.buildDirectory.get()}/resources/main/static")
if( ! frontendFolder.exists() ) {
mkdir("${layout.buildDirectory.get()}/resources/main/static")
}
from ("${projectDir}/src/frontend/dist")
into ("${layout.buildDirectory.get()}/resources/main/static")
println("-------------------------------------------------------")
// }
// }
}
tasks.withType<JavaCompile> {
dependsOn("copyVueFiles")
}