forked from liferay/liferay-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-plugin.gradle
91 lines (73 loc) · 2.18 KB
/
build-plugin.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
apply plugin: "com.liferay.plugin"
File appServerClassesPortalDir = new File(liferay.appServerPortalDir, "WEB-INF/classes")
File appServerLibPortalDir = new File(liferay.appServerPortalDir, "WEB-INF/lib")
afterEvaluate {
project.ext.set("app.server.lib.portal.dir", project.relativePath(appServerLibPortalDir))
project.ext.set("app.server.portal.dir", project.relativePath(liferay.appServerPortalDir))
project.ext.set("plugin.full.version", project.version.toString())
}
if (hasProperty("bundle")) {
bundle {
instruction "-jsp", "*.jsp"
instruction "-jsp", "*.jspf"
instruction "-metatype", "*"
instruction "-plugin", "com.liferay.ant.bnd.plugin.JspAnalyzerPlugin"
instruction "-plugin", "com.liferay.ant.bnd.plugin.SassAnalyzerPlugin"
instruction "-sass", "*"
}
}
configurations {
portal
portalTest {
extendsFrom portal
}
testCompile {
extendsFrom portalTest
}
testIntegrationCompile {
extendsFrom portalTest
}
}
dependencies {
portal files(appServerClassesPortalDir)
portal fileTree(dir: appServerLibPortalDir, include: "*.jar")
portal fileTree(dir: liferay.appServerLibGlobalDir, include: "*.jar")
portal group: "com.liferay", name: "net.sf.jargs", version: "1.0"
portal group: "com.thoughtworks.qdox", name: "qdox", version: "1.12.1"
portal group: "javax.activation", name: "activation", version: "1.1"
portal group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
portal group: "javax.servlet.jsp", name: "jsp-api", version: "2.1"
portalTest fileTree(dir: new File(liferay.liferayHome, "osgi/test"), include: "portal-test*.jar")
if (isPortalCompatSharedRequired(project)) {
runtime project(":shared:portal-compat-shared")
}
}
jar {
destinationDir = new File(rootDir, "dist2")
}
repositories {
mavenLocal()
}
plugins.withType(WarPlugin) {
war {
destinationDir = jar.destinationDir
}
}
boolean isPortalCompatSharedRequired(Project project) {
if (project.name == "portal-compat-shared") {
return false
}
if (project.name.endsWith("-layouttpl")) {
return false
}
if (project.name.endsWith("-theme")) {
File srcDir = project.file("docroot/WEB-INF/src")
if (srcDir.exists()) {
return true
}
else {
return false
}
}
return true
}