-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
124 lines (107 loc) · 5.27 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
// The buildscript {} block is evaluated before anything else in the script (regardless of location in file).
// See http://goo.gl/EO8S1k. So, might as well put it first.
//
// Due to a Gradle limitation, we cannot externalize this buildscript block into a script plugin. However, we can
// exploit the fact that dependencies specified in a parent's buildscript block are visible to all children.
// Thus, as long as we declare all plugins here, no child needs its own buildscript block. See http://goo.gl/2y3KhZ.
buildscript {
// Add the "libraries" ExtraProperty. It should be usable from the rest of this script as well.
// See http://goo.gl/9bixNV
apply from: "$rootDir/gradle/any/shared-mvn-coords.gradle"
// The buildscript {} block is odd: even though we applied dependencies.gradle above, the repositories therein
// do not get included here. Instead, we must explicitly define the repos again. Yay for duplication.
repositories {
// Prefer mavenCentral to the Gradle Plugin Portal as the latter redirects to the unreliable JCenter
// see https://github.com/gradle/gradle/issues/15406
mavenCentral()
gradlePluginPortal()
exclusiveContent {
forRepository {
maven {
url "https://artifacts.unidata.ucar.edu/repository/unidata-all/"
}
}
// only look for unidata plugin related artifacts from the unidata-all repo
filter {
includeModule 'com.burgstaller', 'okhttp-digest'
includeModule 'org.ysb33r.gradle', 'grolifant'
includeModule 'edu.ucar.unidata.site', 'jekyll-plugin'
includeModule 'edu.ucar.unidata.site', 'jekyll-gems'
includeModule 'edu.ucar.unidata', 'unidata-nexus-gradle'
}
}
}
dependencies {
classpath buildPlugins.gretty
classpath buildPlugins.sonarqube
classpath buildPlugins.shadow
classpath buildPlugins.spotless
classpath buildPlugins.protobuf
classpath buildPlugins.nexus
classpath buildPlugins.jekyll
classpath buildPlugins.depcheck
}
}
allprojects {
// Matches Maven's "project.groupId". Used in MANIFEST.MF for "Implementation-Vendor-Id".
group = 'edu.ucar'
// Matches Maven's "project.version". Used in MANIFEST.MF for "Implementation-Version".
// We try to follow semantic versioning, and thus we use <major>.<minor>.<patch>-<prerelease version>
// <prerelease version> may be SNAPSHOT, alphax, betax, etc.
version = '5.6-SNAPSHOT'
// Eventually, we'll stop appending "SNAPSHOT" to our versions and just use this.
status = 'development'
}
// Matches Maven's "project.description".
description = 'The Unidata THREDDS Data Server (TDS).'
import java.text.SimpleDateFormat
// These will be inherited by subprojects: http://goo.gl/5mvqf7
// After declaration, they should NOT be referred to using the "ext" namespace, instead preferring e.g.
// "project.title" or simply "title": http://stackoverflow.com/questions/14530901
// That way, the property will be robustly resolved, as described here: http://goo.gl/UBq0en
// Otherwise, only the one specific ExtraPropertiesExtension will be searched.
ext {
// Matches Maven's "project.name". Used in MANIFEST.MF for "Implementation-Title".
title = 'Parent TDS modules'
// Matches Maven's "project.organization.name". Used in MANIFEST.MF for "Implementation-Vendor".
vendor = 'UCAR/Unidata'
// It makes sense to publish major.minor versions of the docs, as
// any patch bumps should be backwards compatible bug fixes only
// To do this, we need to make a special "doc version" string.
// First, drop any dangling snapshot, alpha, beta tags
cleanVersion = "$version".split('-')[0]
// tokenize version on the '.' character, which gives us a list of [major, minor, patch]
docVersionParts = cleanVersion.tokenize('.')
// we should always have a major, minor, and patch value in our version
assert docVersionParts.size == 2
// keep major and minor parts of the version and use those to version the docs
docVersion = docVersionParts[0] + '.' + docVersionParts[1]
// Matches Maven's "project.url". Used in MANIFEST.MF for "Implementation-URL".
url = 'https://www.unidata.ucar.edu/software/tds/'
SimpleDateFormat iso_8601_format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
buildTimestamp = iso_8601_format.format(new Date())
// Will hold the list of projects that apply the java plugin
// Used by :docs (javadoc tasks) and sonarqube
javaProjects = []
}
tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '7.6.4'
}
gradle.projectsEvaluated {
javaProjects = subprojects.findAll {
subproject -> subproject.plugins.hasPlugin('java')
}
}
// Set up properties needed for all testing, adds "testAll" task to root
apply from: "$rootDir/gradle/root/testing.gradle"
// Generates coverage report for testAll
apply from: "$rootDir/gradle/root/coverage.gradle"
// Manages credentials for publishing
apply from: "$rootDir/gradle/root/publishing.gradle"
// Adds "sonarqube" task to the root project
apply from: "$rootDir/gradle/root/sonarqube.gradle"
// Adds the spotless tasks to the root project and add check for .gradle files
apply from: "$rootDir/gradle/root/spotless.gradle"
// Adds the owasp dependency-check tasks to the root project (dependencyCheckAggregate for project-wide check)
apply from: "$rootDir/gradle/root/dependency-check.gradle"