-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
116 lines (90 loc) · 3.39 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
plugins {
id 'java'
id 'maven-publish'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.code.findbugs:jsr305:3.0.2'
// Spring Boot
compile "org.springframework.boot:spring-boot-actuator:2.2.4.RELEASE"
compile "org.springframework.boot:spring-boot-starter-amqp:2.3.0.RELEASE"
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor:2.2.4.RELEASE"
// Jackson libraries
compile "com.fasterxml.jackson.core:jackson-databind:2.10.2"
// Spring Boot Admin
compile 'de.codecentric:spring-boot-admin-starter-server:2.2.0'
compile 'de.codecentric:spring-boot-admin-starter-client:2.2.0'
compile 'io.projectreactor.netty:reactor-netty:0.9.0.RELEASE'
compileOnly 'org.immutables:value:2.8.3'
annotationProcessor 'org.immutables:value:2.8.3'
// Test Only
testCompile 'org.mockito:mockito-core:2.24.0'
testCompile 'org.mockito:mockito-junit-jupiter:2.24.0'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
testCompile 'org.assertj:assertj-core:3.15.0'
testCompile 'org.springframework:spring-test:5.2.4.RELEASE'
testCompile 'org.springframework:spring-context:5.2.4.RELEASE'
testCompile 'org.springframework.boot:spring-boot-starter-test:2.2.4.RELEASE'
}
test {
useJUnitPlatform()
}
ext['indeed.publish.name'] = 'virgil-spring-boot-starter'
compileJava {
// adds metadata at compile to allow for better reflection for spring boot admin
// specifically allows actuator @Selector attributes to pick up the name of the parameter
options.compilerArgs << '-parameters'
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.indeed'
artifactId = 'virgil-spring-boot-starter' // use the name from ext['indeed.publish.name']
version = '1.1.4-SNAPSHOT' // use whatever version makes sense for your project
from components.java
}
}
}
def ordered(String... dependencyPaths) {
def dependencies = dependencyPaths.collect { tasks.getByPath(it) }
for (int i = 0; i < dependencies.size() - 1; i++) {
dependencies[i + 1].mustRunAfter(dependencies[i])
}
return dependencies
}
task virgilTest(type: Exec) {
workingDir './src/npm/custom/'
commandLine 'npm', 'test'
}
task virgilNpmInstall(type: Exec) {
workingDir './src/npm/custom/'
commandLine 'npm', 'install'
}
task virgilNpmBuild(type: Exec) {
workingDir './src/npm/custom/'
commandLine 'npm', 'run', 'build'
}
task virgilNpmBuildDev(type: Exec) {
workingDir './src/npm/custom/'
commandLine 'npm', 'run', "build:dev"
}
task virgilCleanTarget(type: Delete) {
delete fileTree('./src/main/resources/META-INF/extensions/custom')
}
task virgilCopyToResources(type: Copy) {
from './src/npm/custom/target/dist'
into './src/main/resources/META-INF/extensions/custom'
}
task buildFrontEndProd(type: GradleBuild) {
group = 'build'
description = 'Build frontend for Prod'
dependsOn ordered(":virgilNpmInstall", ":virgilTest", ":virgilNpmBuild", ":virgilCleanTarget", ":virgilCopyToResources")
}
task buildFrontEndDev(type: GradleBuild) {
group = 'build'
description = 'Build frontend for Dev'
dependsOn ordered(":virgilNpmInstall", ":virgilTest", ":virgilNpmBuildDev", ":virgilCleanTarget", ":virgilCopyToResources")
}