-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
175 lines (143 loc) · 5.55 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
// unused
//classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.10"
}
}
apply from:'application.gradle'
group "edu.ucar"
apply plugin:"org.grails.grails-plugin"
apply plugin:"org.grails.grails-plugin-publish"
apply plugin:"org.grails.grails-gsp"
// unused
//apply plugin:"asset-pipeline"
//apply plugin:"eclipse"
//apply plugin:"idea"
// Grails uses gradle.properties so it's tracked by git;
// we git-ignore this file so you can add local customizations.
// See local.gradle.example
// You can also use $GRADLE_USER_HOME/gradle.properties (aka $HOME/.gradle/gradle.properties)
File localFile = new File('./local.gradle')
if (localFile.exists()) apply from:localFile
if (!project.hasProperty('urlTimeout')) ext['urlTimeout']=5000 // ms
repositories {
mavenLocal() // ~/.m2/
// if we have a local maven defined, and it is reachable, then use it for dependencies
if ( project.hasProperty('internalMavenWebUrl') ) try {
if (project.internalMavenWebUrl?.toURL()?.getText(connectTimeout: urlTimeout, readTimeout: urlTimeout))
maven { url internalMavenWebUrl }
} catch (e) {
logger.warn "Error accessing internalMavenWebUrl ( $internalMavenWebUrl ), attempting to continue..."
logger.warn "$e"
}
maven { url "https://repo.grails.org/grails/core" }
}
// make sure ALL tests & checks are run
install.dependsOn ':build'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
// use slf4j-test instead
testCompile.exclude group: 'ch.qos.logback', module: 'logback-classic'
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:gsp"
compileOnly "io.micronaut:micronaut-inject-groovy"
console "org.grails:grails-console"
profile "org.grails.profiles:web-plugin"
// unused, enable this & other asset lines if css/js/etc assets are added
//runtime "com.bertramlabs.plugins:asset-pipeline-grails:3.0.10"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.mockito:mockito-core"
testCompile "org.grails:grails-web-testing-support"
testCompile 'org.jsoup:jsoup:1.13.1'
// substitute in-memory queryable logging
testCompile 'uk.org.lidalia:slf4j-test:1.1.0'
// removed grails-plugin-testing: https://github.com/grails/grails-core/issues/11293
compile 'edu.ucar:groovy-ncar-extensions:3.1.0'
// we extend from MySQL57Dialect; the main app should override; but we try to keep in sync
compile "org.hibernate:hibernate-core:5.4.0.Final"
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx2g'
// -Xmx2g -Xms1024M -XX:MaxMetaspaceSize=1g
)
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs += ['-Xmx2g']
// -Xmx2g -Xms1024M -XX:MaxMetaspaceSize=1g
}
}
// enable if you wish to package this plugin as a standalone application
bootJar.enabled = false
publishing {
repositories {
// DO NOT add mavenLocal() -- it will break all grails commands
// to publish to mavenLocal (~/.m2/) use "grails install"
// if we have a local maven defined, and it is reachable, then use it
if ( project.hasProperty('internalMavenPublishUrl') ) try {
if (project.internalMavenPublishUrl.toURL().getText(connectTimeout: urlTimeout, readTimeout: urlTimeout))
maven { url internalMavenPublishUrl }
} catch (e) {
logger.warn "Error accessing internalMavenPublishUrl ( $internalMavenPublishUrl ), attempting to continue..."
logger.warn "$e"
}
}
}
grailsPublish {
// grails.org plugin auth
user = 'user'
key = 'key'
githubSlug = 'NCAR/grails-ncar-extensions'
license {
name = 'Apache-2.0'
}
title = "Grails NCAR extensions"
desc = "Grails 4 extensions and utilities used at NCAR"
developers = [jja:"John J. Allison"] // no way to add email to pom :(
}
//assets {
// packagePlugin = true
//}
// used by ./grailsShell
task printConsoleClasspath(dependsOn:'classes') {
group = 'help'
description = 'prints my console classpath (for use by an external script)'
def files = sourceSets.main.runtimeClasspath + configurations.console
doLast {
print 'CLASSPATH '
println files.asPath
}
}