forked from LabKey/server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle
165 lines (146 loc) · 7.6 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
pluginManagement {
repositories {
maven {
url "${artifactory_contextUrl}/plugins-release"
}
if (gradlePluginsVersion.contains("SNAPSHOT") || versioningPluginVersion.contains("SNAPSHOT")) {
maven {
url "${artifactory_contextUrl}/plugins-snapshot-local"
}
}
}
// For testing changes to the gradle plugins, uncomment the includeBuild line below and reference the location of
// your gradlePlugin enlistment. The plugins will get built automatically when executing tasks here.
// includeBuild '../gradlePlugin'
plugins {
id 'org.labkey.build.antlr' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.api' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.applyLicenses' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.base' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.distribution' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.fileModule' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.javaModule' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.jsdoc' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.module' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.multiGit' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.npmRun' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.serverDeploy' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.teamCity' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.testRunner' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.tomcat' version "${gradlePluginsVersion}" apply false
id 'org.labkey.build.xsddoc' version "${gradlePluginsVersion}" apply false
id 'org.labkey.versioning' version "${versioningPluginVersion}" apply false
}
}
buildscript {
repositories {
maven {
url "${artifactory_contextUrl}/plugins-release"
}
if (gradlePluginsVersion.contains("SNAPSHOT")) {
maven {
url "${artifactory_contextUrl}/plugins-snapshot-local"
}
}
}
dependencies {
classpath "org.labkey.build:gradlePlugins:${gradlePluginsVersion}"
}
configurations.all {
// 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").
*/
if (hasProperty("useEmbeddedTomcat"))
{
include ":server:embedded"
}
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)
// 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)
}
}
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
{
// A list of directory names that correspond to modules to be excluded from configuration.
// Items may be individual module names (e.g. 'luminex') or module container names (e.g. 'customModules')
// You must make sure to pass this list to the appropriate calls to `BuildUtils.includeModules`
List<String> excludedModules = []
// 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(",")), [])
}
if (hasProperty('inheritedDistPath'))
{
include "${inheritedDistPath}"
}