forked from SCADA-LTS/Scada-LTS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
otherbuildgradle
154 lines (134 loc) · 5.22 KB
/
otherbuildgradle
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
/*
* Scada-LTS gradle build configuration
* Based on the ANT "build.xml" file. This file provide the information
* where the source set is located, where are located the java libraries
* and use subproject tasks to include an NewUI contents inside Scada-LTS app.
*/
plugins {
id 'war'
id 'java'
}
sourceCompatibility = 1.11
targetCompatibility = 1.11
def tomcatVersion = '9.0.53'
def tomcatDirectory = System.getenv("CATALINA_HOME")
// Environment variables to change
subprojects {
ext {
buildUi = has("skipUi")&&(skipUi!=null)
}
}
repositories {
mavenCentral()
}
dependencies {
providedCompile fileTree(include: ['*.jar'], dir:'WebContent/WEB-INF/lib')
providedCompile fileTree(include: ['*.jar'], dir: 'lib')
providedCompile 'org.apache.tomcat:tomcat-catalina:' + tomcatVersion
}
sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}
processTestResources {
from(sourceSets.test.java.srcDirs) {
include '**/*.properties'
}
}
war {
dependsOn(':scadalts-ui:copyNewUiImages')
from 'WebContent'
webInf {
from 'webapp-resources/'
into 'classes/'
}
}
task clearDockerDir(type: Delete) {
delete files("docker/volumes/webapps/ScadaBR.war")
}
task copyWarToDocker(type: Copy, dependsOn: clearDockerDir) {
from "build/libs/"
into "docker/volumes/webapps/"
include('Scada-LTS.war')
rename('Scada-LTS.war', "ScadaBR.war")
}
task installWebDependency(type: Exec) {
workingDir "./WebContent/resources"
commandLine "npm", "install"
}
task clearTomcat(type: Delete) {
delete System.getenv("CATALINA_HOME") + "/work/Catalina/localhost"
delete System.getenv("CATALINA_HOME") + "/webapps/ScadaBR"
delete file(System.getenv("CATALINA_HOME") + "/webapps/ScadaBR.war")
}
task deployTomcat(type: Copy) {
from "build/libs/"
into System.getenv("CATALINA_HOME")+ "/webapps"
include('Scada-LTS.war')
rename('Scada-LTS.war', "ScadaBR.war")
}
task deploy(type: GradleBuild) {
tasks = ['clearTomcat', 'war', 'deployTomcat']
}
task run(type: Exec) {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
workingDir tomcatDirectory + '\\bin'
commandLine 'cmd', '/c', 'catalina.bat', 'run'
} else {
workingDir tomcatDirectory + '/bin'
commandLine 'sh', './catalina.sh', 'run'
}
}
task runDebug(type: Exec) {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
workingDir tomcatDirectory + '\\bin'
commandLine 'cmd', '/c', 'catalina.bat', 'jpda', 'run'
} else {
workingDir tomcatDirectory + '/bin'
commandLine 'sh', './catalina.sh', 'jpda', 'run'
}
}
task buildRun(type: GradleBuild) {
tasks = ['clearTomcat', 'test', 'war', 'deployTomcat', 'run']
}
task buildRunDebug(type: GradleBuild) {
tasks = ['clearTomcat', 'test', 'war', 'deployTomcat', 'runDebug']
}
test {
filter {
includeTestsMatching "org.scada_lts.cached.DataPointsCacheComposeDataSourcesDataTest"
includeTestsMatching "org.scada_lts.cached.DataSourcePointsCacheMockitoTest"
includeTestsMatching "com.serotonin.mango.rt.dataImage.PointValueCacheTest"
includeTestsMatching "com.serotonin.mango.rt.dataImage.PointValueFacadeTest"
includeTestsMatching "com.serotonin.mango.web.dwr.DataPointDetailsDwrTest"
includeTestsMatching "com.serotonin.mango.rt.dataImage.PointValueTimeTest"
includeTestsMatching "org.scada_lts.dao.PointValueDAOTest"
includeTestsMatching "com.serotonin.mango.view.component.ViewComponentTestsSuite"
includeTestsMatching "com.serotonin.mango.rt.dataSource.meta.ScriptExecutorTest"
includeTestsMatching "com.serotonin.mango.rt.scripting.ContextualizedScriptRTTestsSuite"
includeTestsMatching "org.scada_lts.service.ScheduledExecuteInactiveEventServiceTest"
includeTestsMatching "com.serotonin.mango.vo.mailingList.MailingListInactive15MinuteIntervalTestsSuite"
includeTestsMatching "com.serotonin.mango.rt.event.handlers.EmailToSmsHandlerRtTest"
includeTestsMatching "org.scada_lts.service.CommunicationChannelTest"
includeTestsMatching "com.serotonin.mango.rt.event.ScheduledExecuteInactiveEventRtTestsSuite"
includeTestsMatching "org.scada_lts.service.InactiveEventsProviderTest"
includeTestsMatching "org.scada_lts.utils.UpdateValuePointPropertiesTest"
includeTestsMatching "org.scada_lts.permissions.service.util.PermissionsTestsSuite"
includeTestsMatching "com.serotonin.mango.util.ViewControllerUtilsTest"
includeTestsMatching "org.scada_lts.permissions.migration.MigrationPermissionsTestsSuite"
includeTestsMatching "org.scada_lts.dao.pointvalues.PointValueAmChartDAOTest"
includeTestsMatching "br.org.scadabr.rt.scripting.context.properties.DataPointLoggingTestsSuite"
includeTestsMatching "org.scada_lts.dao.NewInstanceUserTest"
includeTestsMatching "org.scada_lts.dao.NewInstanceUsersProfileTest"
includeTestsMatching "br.org.scadabr.vo.EqualsHashcodePermissionTest"
includeTestsMatching "com.serotonin.mango.web.dwr.DataPointEditDwrTest"
}
}