forked from Unidata/rosetta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
180 lines (130 loc) · 4.95 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
176
177
178
179
180
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'war'
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
apply plugin: 'com.github.jruby-gradle.base'
// Adds 'assemble', 'check', 'build', and 'clean' tasks.
// See: https://docs.gradle.org/current/userguide/standard_plugins.html#sec:base_plugins
apply plugin: 'base'
apply plugin: 'com.github.jruby-gradle.base'
compileJava {
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
}
group = 'edu.ucar.unidata'
version = '1.2.1-NERSC'
description = """rosetta"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
springVersion = "4.3.8.RELEASE"
springSecurityVersion = "4.2.2.RELEASE"
cdmVersion = "4.6.10"
source = file("src/main/jekyll/").absolutePath
destination = file("build/_site").absolutePath
commonFlags = [ '--source', source, '--destination', destination ]
}
dependencies {
// format -> configurationName "group:name:version:classifier@extension"
// Spring Framework
compile "org.springframework:spring-beans:$springVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-expression:$springVersion"
compile "org.springframework:spring-web:$springVersion"
compile "org.springframework:spring-webmvc:$springVersion"
// Spring Security
compile "org.springframework.security:spring-security-web:$springSecurityVersion"
compile "org.springframework.security:spring-security-config:$springSecurityVersion"
compile "org.springframework.security:spring-security-taglibs:$springSecurityVersion"
// netCDF-Java/CDM deps
compile "edu.ucar:netcdfAll:$cdmVersion"
//compile group: 'edu.ucar', name:'netcdfAll', version: '4.6.10'
// others
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.21'
compile "org.slf4j:slf4j-api:1.7.5"
compile "org.slf4j:jcl-over-slf4j:1.7.12"
compile "commons-codec:commons-codec:1.8"
compile "org.apache.commons:commons-lang3:3.4"
compile "commons-io:commons-io:2.4"
compile "commons-fileupload:commons-fileupload:1.3.1"
compile "org.apache.httpcomponents:httpclient:4.3.2"
compile "jstl:jstl:1.2"
compile "log4j:log4j:1.2.17"
compile "javax.servlet:javax.servlet-api:3.0.1"
compile "net.sourceforge.jexcelapi:jxl:2.6.12"
compile "com.googlecode.json-simple:json-simple:1.1.1"
compile "org.codehaus.jackson:jackson-mapper-asl:1.5.3"
testCompile "junit:junit:4.11"
jrubyExec 'rubygems:jekyll:3.4.0'
// Without this, we get: LoadError: no such file to load -- bundler
jrubyExec 'rubygems:bundler:1.14.4'
}
war {
extension = "war"
archiveName = 'rosetta.war'
manifest {
attributes 'Implementation-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Vendor': 'NERSC',
'Implementation-Vendor-Id': project.group,
'Built-On': new Date(),
'Build-Jdk': JavaVersion.current()
}
}
ext {
source = file("src/main/jekyll/").absolutePath
destination = file("build/_site").absolutePath
commonFlags = [ '--source', source, '--destination', destination ]
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
/////////////
repositories {
maven {
url "https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases/"
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.github.jruby-gradle:jruby-gradle-plugin:1.3.3"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1"
}
}
import com.github.jrubygradle.JRubyExec
task jekyllBuild(type: JRubyExec, group: 'Jekyll', description: 'Build your site.') {
// Enable task to be UP-TO-DATE.
inputs.file source
outputs.file destination
script "jekyll"
scriptArgs "build"
scriptArgs commonFlags
// Consider enabling this to help us determine when pages need to be pushed to Nexus.
// A copy of .jekyll-metadata could be stored in the repo and then compared to the local file.
// See https://jekyllrb.com/docs/configuration/#incremental-regeneration
// scriptArgs "--incremental"
}
tasks.assemble.dependsOn tasks.jekyllBuild
task jekyllServe(type: JRubyExec, group: 'Jekyll', description: 'Serve your site locally.') {
// This task starts a server; it is never considered UP-TO-DATE.
outputs.upToDateWhen { false }
script "jekyll"
scriptArgs "serve"
scriptArgs commonFlags
}
task wrapper(type: Wrapper) {
gradleVersion = '3.5.1'
}
// run coverage with jacoco before sonarqube analysis so that coverabe report
// will be ready for sonarqube submission
project.tasks["sonarqube"].dependsOn jacocoTestReport
// need to run test task before jacocoTestReport
jacocoTestReport.dependsOn test