-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
164 lines (125 loc) · 4.7 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// spring boot versions
id("org.springframework.boot") version "3.1.0"
id("io.spring.dependency-management") version "1.1.0"
// https://plugins.gradle.org/plugin/org.siouan.frontend-jdk11
id("org.siouan.frontend-jdk11") version "6.0.0"
// kotlin version
kotlin("jvm") version "1.8.21"
kotlin("plugin.spring") version "1.8.21"
kotlin("plugin.jpa") version "1.8.21"
// Annotation processors (see JSR 269) are supported
// in Kotlin with the kapt compiler plugin.
kotlin("kapt") version "1.8.21"
}
group = "br.ufrn.caze"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
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-oauth2-client")
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.3.Final")
kapt("org.mapstruct:mapstruct-processor:1.5.3.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")
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 = "17"
}
}
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
frontend {
packageJsonDirectory.set(file("${projectDir}/src/frontend"))
nodeInstallDirectory.set(file("${projectDir}/src/frontend/.node"))
nodeDistributionUrlRoot.set("https://nodejs.org/dist/")
nodeVersion.set("16.15.0")
assembleScript.set("run build")
}
val frontendFolder = File( "${buildDir}/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: ${buildDir}/resources/main/static")
if( ! frontendFolder.exists() ) {
mkdir("${buildDir}/resources/main/static")
}
from ("${projectDir}/src/frontend/dist")
into ("${buildDir}/resources/main/static")
println("-------------------------------------------------------")
// }
// }
}
tasks.withType<JavaCompile> {
dependsOn("copyVueFiles")
}