-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
159 lines (139 loc) · 4.93 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
plugins {
id "groovy"
id "org.grails.grails-gsp"
id "org.grails.grails-web"
id "com.github.erdi.webdriver-binaries"
id "org.springframework.boot" // Ajout du plugin Spring Boot
id "war"
id "idea"
id "com.bertramlabs.asset-pipeline"
id "application"
id "eclipse"
}
group = "ora"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
mavenCentral()
}
configurations {
all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.seleniumhq.selenium') {
details.useVersion('4.19.1')
}
}
}
}
dependencies {
implementation("org.grails:grails-core")
implementation("org.grails:grails-logging")
implementation("org.grails:grails-plugin-databinding")
implementation("org.grails:grails-plugin-i18n")
implementation("org.grails:grails-plugin-interceptors")
implementation("org.grails:grails-plugin-rest")
implementation("org.grails:grails-plugin-services")
implementation("org.grails:grails-plugin-url-mappings")
implementation("org.grails:grails-web-boot")
implementation("org.grails.plugins:gsp")
implementation("org.grails.plugins:hibernate5")
implementation("org.grails.plugins:scaffolding")
implementation("org.springframework.boot:spring-boot-autoconfigure")
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-tomcat")
implementation("org.springframework.boot:spring-boot-starter-logging")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation "io.micronaut:micronaut-http-client"
implementation "net.logstash.logback:logstash-logback-encoder:5.2"
compileOnly("io.micronaut:micronaut-inject-groovy")
console("org.grails:grails-console")
runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:4.3.0")
runtimeOnly("org.apache.tomcat:tomcat-jdbc")
runtimeOnly("com.h2database:h2")
runtimeOnly 'org.postgresql:postgresql:42.7.2'
runtimeOnly 'org.fusesource.jansi:jansi:2.4.0'
testImplementation("io.micronaut:micronaut-inject-groovy")
testImplementation("org.grails:grails-gorm-testing-support")
testImplementation("org.grails:grails-web-testing-support")
testImplementation("org.spockframework:spock-core")
testImplementation("io.micronaut:micronaut-http-client")
// WebSocket dependencies
implementation 'org.springframework:spring-websocket'
implementation 'org.springframework:spring-messaging'
// Test dependencies
testImplementation 'javax.websocket:javax.websocket-api:1.1'
testImplementation group: 'org.glassfish.tyrus', name: 'tyrus-container-grizzly-server', version: '1.17'
testImplementation group: 'org.glassfish.tyrus', name: 'tyrus-container-grizzly-client', version: '1.17'
}
java {
sourceCompatibility = JavaVersion.toVersion("11")
}
tasks.assemble.dependsOn tasks.bootJar
bootJar {
enabled = true
manifest {
attributes(
'Main-Class': 'org.springframework.boot.loader.JarLauncher',
'Start-Class': 'ora.Application'
)
}
}
jar {
enabled = false
manifest {
attributes(
'Main-Class': 'org.springframework.boot.loader.JarLauncher',
'Start-Class': 'ora.Application'
)
}
}
application {
mainClass.set("ora.Application")
}
// pas de war
bootWar {
enabled = false
archiveClassifier = null
}
war {
enabled = false
}
tasks.withType(GroovyCompile).configureEach {
options.fork = true
options.incremental = true
options.forkOptions.jvmArgs += ['-Dgroovy.antlr4.cache.threshold=0', '-Xmx2g', '-Dgroovy.parallel.parse=true']
}
// Add new Gradle task for Docker PostgreSQL
task startDevDb(type: Exec) {
commandLine 'docker', 'run', '--name', 'ora-postgres-dev',
'-e', 'POSTGRES_DB=ora_dev',
'-e', 'POSTGRES_USER=ora_user',
'-e', 'POSTGRES_PASSWORD=ora_pass',
'-p', '5432:5432',
'', 'postgres:15-alpine'
}
task stopDevDb(type: Exec) {
commandLine 'docker', 'stop', 'ora-postgres-dev'
ignoreExitValue true
}
task removeDevDb(type: Exec) {
commandLine 'docker', 'rm', 'ora-postgres-dev'
ignoreExitValue true
}
task resetDevDb {
dependsOn stopDevDb, removeDevDb, startDevDb
}
tasks.withType(Test) {
useJUnitPlatform()
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
assets {
minifyJs = true
minifyCss = true
includes = ["fonts/*", "webfonts/*"]
maxThreads = 4
}