forked from liferay/liferay-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
89 lines (67 loc) · 1.71 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
apply from: "${gradle.lfrSdkDir}/app-servers.gradle"
apply from: "${gradle.lfrSdkDir}/versions.gradle"
Closure commonProjectCondition
Closure commonProjects
Closure configureProjects
Closure pluginProjectCondition
Closure pluginProjects
commonProjectCondition = {
true
}
commonProjects = {
apply from: "${gradle.lfrSdkDir}/util.gradle"
configurations {
all {
resolutionStrategy.cacheChangingModulesFor 15, 'minutes'
}
}
repositories {
maven {
url "http://cdn.repository.liferay.com/nexus/content/groups/public"
}
}
}
configureProjects = {
currentProject, projectCondition, projectConfig ->
if (!projectCondition(currentProject)) {
return
}
configure(currentProject, projectConfig)
}
pluginProjectCondition = {
it.exists("build.gradle") && it.parent
}
pluginProjects = {
Closure loadProperties
loadProperties = {
File file = project.file(it)
Properties properties = new Properties()
if (file.exists()) {
InputStream inputStream = new FileInputStream(file)
inputStream.withStream {
properties.load(it)
}
}
return properties
}
project.ext {
bndProperties = loadProperties("bnd.bnd")
osgiPlugin = project.exists("bnd.bnd")
pluginPackageProperties = loadProperties("docroot/WEB-INF/liferay-plugin-package.properties")
pluginSrcDir = {
File file = project.file("docroot/WEB-INF/src")
if (!file.exists()) {
return project.file("src")
}
return file
}()
}
apply from: "${gradle.lfrSdkDir}/build-plugins.gradle"
if (name.endsWith("-theme")) {
apply from: "${gradle.lfrSdkDir}/build-themes.gradle"
}
}
gradle.beforeProject {
configureProjects(it, commonProjectCondition, commonProjects)
configureProjects(it, pluginProjectCondition, pluginProjects)
}