-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
143 lines (112 loc) · 4.08 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
import com.github.gradle.node.npm.task.NpmTask
plugins {
id 'application'
id 'groovy'
id 'war'
id 'com.github.node-gradle.node'
id 'com.gorylenko.gradle-git-properties'
}
// Override versions in BOMs of transitive dependencies
ext.set('netty.version', libs.versions.netty.get())
ext.set('spring.version', libs.versions.spring.asProvider().get())
ext.set('tomcat.version', libs.versions.tomcat.get())
group = 'io.github.matrei'
ext.set('grailsVersion', libs.versions.grails.asProvider().get())
// These plugins need to be applied after the grailsVersion property is set
apply plugin: 'org.grails.grails-web'
apply plugin: 'org.grails.grails-gsp'
repositories {
mavenCentral()
maven { url = 'https://repo.grails.org/grails/core' }
}
// This is used for testing with local copy of the Grails Inertia Plugin
// (comment out the dependency in the dependencies block)
// Also see section in settings.gradle
/*
grails {
plugins {
implementation project(':grails-inertia-plugin')
}
}
*/
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.codehaus.groovy') {
String groovyVersion = findProperty('groovyVersion') ?: libs.versions.groovy.get()
details.useVersion(groovyVersion)
}
}
}
dependencies {
implementation libs.grails.core
implementation libs.grails.interceptors
implementation libs.grails.webCommon
implementation libs.grails.webDatabinding
implementation libs.grailsEvents
implementation libs.grailsGsp
implementation libs.grailsGormLogicalDelete
implementation libs.grailsInertia
implementation libs.grailsSpringSecurity.core
//implementation project(':grails-inertia-plugin')
implementation libs.bundles.springSecurity
implementation libs.datafaker
implementation libs.imgscalr
implementation libs.metadataExtractor
implementation libs.squiggly
runtimeOnly libs.grails.i18n
runtimeOnly libs.grails.services
runtimeOnly libs.grails.urlmappings
runtimeOnly libs.gorm.hibernate5
runtimeOnly libs.grailsCsrf
runtimeOnly libs.springBoot.autoconfigure
runtimeOnly libs.springBoot.starterLogging
runtimeOnly libs.springBoot.starterTomcat
runtimeOnly libs.h2database
runtimeOnly libs.hikari
compileOnly libs.micronaut.injectGroovy
compileOnly libs.grailsViews.json // Used for compiling json views
compileOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during GSP compile tasks
testImplementation libs.micronaut.httpClient
testImplementation libs.micronaut.injectGroovy
testImplementation libs.bundles.grailsTestingSupport
testImplementation libs.spock.core
testImplementation libs.groovy.test
integrationTestImplementation testFixtures(libs.grailsGeb)
}
application {
mainClass = 'pingcrm.Application'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
reports.html.required = false
reports.junitXml.required = false
}
node {
download = true
}
tasks.register('viteBuild', NpmTask) {
group = 'build'
description = 'Build the client bundle'
inputs.dir(layout.projectDirectory.dir('node_modules'))
inputs.dir(layout.projectDirectory.dir('src/main/javascript'))
inputs.files(layout.projectDirectory.files('package.json', 'vite.config.js', 'tailwind.config.js', 'postcss.config.js', 'babel.config.js', 'jsconfig.json'))
outputs.dir(layout.projectDirectory.dir('src/main/resources/public/dist'))
it.args = ['run', 'build']
dependsOn 'npmInstall'
}
tasks.register('copyNodeModulesForSsr', Copy) {
group = 'build'
description = 'Copy node_modules for SSR'
from layout.projectDirectory.dir('node_modules')
into layout.buildDirectory.dir('resources/main/node_modules')
dependsOn 'npmInstall'
}
tasks.named('processResources') {
dependsOn 'viteBuild', 'copyNodeModulesForSsr'
}