-
Notifications
You must be signed in to change notification settings - Fork 9
/
settings.gradle
199 lines (178 loc) · 7.95 KB
/
settings.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal {
content {
excludeGroupByRegex "org\\.labkey.*"
}
}
maven {
url = "${artifactory_contextUrl}/plugins-release-no-proxy"
mavenContent {
releasesOnly()
}
content {
includeGroup "org.labkey.build"
includeGroup "org.labkey.versioning"
}
}
if (gradlePluginsVersion.contains("SNAPSHOT") || versioningPluginVersion.contains("SNAPSHOT"))
{
mavenLocal()
maven {
url = "${artifactory_contextUrl}/plugins-snapshot-local"
mavenContent {
snapshotsOnly()
}
content {
includeGroup "org.labkey.build"
includeGroup "org.labkey.versioning"
}
}
}
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == 'org.labkey.versioning')
{
// Versioning isn't published with plugin markers
useModule("org.labkey.build:versioning:${versioningPluginVersion}")
}
else if (requested.id.namespace == 'org.labkey.build')
{
// This doesn't really do anything. The jar on the classpath will take precedence
useVersion("${gradlePluginsVersion}")
}
}
}
}
buildscript {
repositories {
mavenCentral()
gradlePluginPortal {
content {
excludeGroupByRegex "org\\.labkey.*"
}
}
maven {
url = "${artifactory_contextUrl}/plugins-release"
mavenContent {
releasesOnly()
}
}
if (gradlePluginsVersion.contains("SNAPSHOT")) {
// For testing changes to the gradle plugins. Publish 'gradlePlugins' locally using 'publishToMavenLocal'.
// Update 'gradlePluginsVersion' to match the plugin SNAPSHOT version.
// You will need to rerun the publish task to pick up new changes.
mavenLocal()
maven {
url = "${artifactory_contextUrl}/plugins-snapshot-local"
mavenContent {
snapshotsOnly()
}
}
}
}
dependencies {
classpath "org.labkey.build:gradlePlugins:${gradlePluginsVersion}"
}
configurations.configureEach {
// Check for updates every build for SNAPSHOT dependencies
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
rootProject.name="labkey-server"
apply from: 'gradle/settings/parameters.gradle'
import org.labkey.gradle.util.BuildUtils
/*
This file is used to determine which projects will be configured during the Gradle build of LabKey Server.
You need to provide only the leaves of the project tree here; a Gradle project will be created for each
node in the tree with these leaves (e.g., 'server:modules:core' will create projects for ":server"
":server:modules" and ":server:modules:core").
*/
include BuildUtils.getEmbeddedProjectPath(gradle)
include BuildUtils.getMinificationProjectPath(gradle)
// A list of directory names or fully qualified module paths that correspond to modules to be excluded from configuration.
// Items may be individual module names (e.g. 'luminex'), module container names (e.g. 'customModules'), or paths (e.g., ':server:modules:commonAssays:flow')
// You must make sure to pass this list to the appropriate calls to `BuildUtils.includeModules`
List<String> excludedModules = []
if (hasProperty('excludedModules'))
{
excludedModules.addAll("${getProperty('excludedModules')}".split(","))
}
if (new File(getRootDir(), BuildUtils.convertPathToRelativeDir(BuildUtils.getPlatformProjectPath(gradle))).exists()
&& !hasProperty('excludeBaseModules'))
{
// The line below includes the set of modules for a minimally functional LabKey server
BuildUtils.includeBaseModules(this.settings, excludedModules)
// Some test modules require base modules to build JSPs.
// TODO: Un-nest this 'if' once test modules can build without platform present.
if (new File(getRootDir(), BuildUtils.convertPathToRelativeDir(BuildUtils.getTestProjectPath(gradle))).exists()
&& !hasProperty('excludeTestModules'))
{
// The line below will include the server/testAutomation project as well as the server/testAutomation/modules projects
BuildUtils.includeTestModules(this.settings, rootDir, excludedModules)
}
}
else if (new File(getRootDir(), BuildUtils.convertPathToRelativeDir(BuildUtils.getTestProjectPath(gradle))).exists())
{
// Include test project even if test modules are excluded.
include BuildUtils.getTestProjectPath(gradle)
}
if (hasProperty("ideaIncludeAllModules") && BuildUtils.isIntellijGradleRefresh(this))
{
apply from: "gradle/settings/all.gradle" // Get all modules when refreshing gradle projects from IntelliJ
}
// Using the property 'moduleSet', you can apply a settings script from the gradle/settings directory with the name of the moduleSet
else if (hasProperty('moduleSet'))
{
if (!new File("gradle/settings/${moduleSet}.gradle").exists())
{
def files = new File("gradle/settings").listFiles()
if (files.length == 0)
{
throw new FileNotFoundException("No module set definitions found in '<labkey>/gradle/settings/'")
}
List<String> moduleSets = new ArrayList<>()
for (File file : files)
{
moduleSets.add(file.getName().replace(".gradle", ""))
}
throw new FileNotFoundException(String.format("Module set '${moduleSet}' does not exist. Choose one of: %s (e.g. '-PmoduleSet=%s')", moduleSets.join(", "), moduleSets.get(0)))
}
apply from: "gradle/settings/${moduleSet}.gradle"
}
else
{
// The line below recursively includes all modules in server/modules
BuildUtils.includeModules(this.settings, rootDir, [BuildUtils.SERVER_MODULES_DIR], excludedModules, true)
// The line below includes all modules in server/modules, server/modules/platform, and server/modules/commonAssays, but not other module containers (e.g. server/modules/customModules)
//BuildUtils.includeModules(this.settings, rootDir, [BuildUtils.SERVER_MODULES_DIR, BuildUtils.PLATFORM_MODULES_DIR, BuildUtils.COMMON_ASSAYS_MODULES_DIR], excludedModules)
// The line below includes all modules in server/modules as well as modules within any module containers there (e.g. server/modules/platform)
//BuildUtils.includeModules(this.settings, rootDir, [BuildUtils.SERVER_MODULES_DIR], excludedModules, true)
// The line below includes all modules in the server/modules/customModules directory
//BuildUtils.includeModules(this.settings, rootDir, [BuildUtils.CUSTOM_MODULES_DIR], excludedModules)
// The line below includes all modules in the server/modules, server/modules/platform, server/modules/commonAssays, and server/modules/customModules directories
//BuildUtils.includeModules(this.settings, rootDir, BuildUtils.SERVER_MODULE_DIRS, excludedModules)
// The line below includes a set of individual modules (in this case, some EHR related modules)
//BuildUtils.includeModules(this.settings, [":server:modules:tnprc_ehr",
// ":server:modules:tnprc_billing",
// ":server:modules:snd"])
// The line below is an example of how to include a single module
//include ":server:modules:workflow"
}
if (hasProperty('extraIncludes'))
{
for (String extraInclude : "${extraIncludes}".split(","))
{
include extraInclude
}
}
if (hasProperty('extraModuleDirs'))
{
BuildUtils.includeModules(this.settings, rootDir, Arrays.asList("${extraModuleDirs}".split(",")), excludedModules)
}
if (hasProperty('inheritedDistPath'))
{
include "${inheritedDistPath}"
}