This repository was archived by the owner on Mar 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
141 lines (107 loc) · 3.3 KB
/
build.gradle
File metadata and controls
141 lines (107 loc) · 3.3 KB
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
apply plugin: 'java-library'
apply plugin: 'org.akhikhl.gretty'
apply plugin: 'war'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
def loadProperties = {
def properties = new Properties()
file('src/main/webapp/WEB-INF/classes/explorviz.properties').withInputStream {
properties.load(it)
}
return properties
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.akhikhl.gretty:gretty:+'
}
}
repositories {
jcenter()
maven { url 'https://jitpack.io' }
// used for kieker and teetime snapshots
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
// # Uncomment lines below to force dependency downloading (e.g. when explorviz-backend was updated)
//configurations.all {
// resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
//}
configurations {
provided
compile.extendsFrom(provided)
}
dependencies {
// Core logic
//compile 'com.github.ExplorViz:explorviz-backend:master-SNAPSHOT'
//local core for developing reasons
compile project(':explorviz-backend')
compile project(':explorviz-backend-kiekeradapter')
// Dependency for this subproject. Add your dependencies in the same way.
provided group: 'de.sven-jacobs', name: 'loremipsum', version: '1.0'
testCompile 'junit:junit:4.12'
}
// Don't build war when tests fail
war.dependsOn check
// War plugin typically disables jar build
assemble.dependsOn jar
// Build .jar file with your "provided" dependencies only
jar {
baseName = project.name
from configurations.provided.asFileTree.files.collect { zipTree(it) }
}
// Tooling
pmd {
ignoreFailures = false
// Clear the rule set first. Otherwise we would have a lot of additional rules in our rule set.
ruleSets = []
ruleSetFiles = files("conf/pmd.xml")
}
checkstyle {
ignoreFailures = false
showViolations = false
configFile = file("conf/checkstyle.xml")
}
findbugs {
reportLevel = "low"
ignoreFailures = false
effort = "max"
}
// Renaming Dummy task
// Run with ./gradlew renameProject -PextensionName="X"
task renameProject(type: Copy) {
if (project.hasProperty('extensionName')) {
// relative copy destinationDir
into "."
// Rename dummy package and replace dummy string import declarations
def newExtensionName = project.property('extensionName')
def javaSrc = 'src/main/java/net/explorviz/extension/'
from(javaSrc + 'dummy') {
filter{ it.replaceAll("\\.dummy\\.", "\\." + newExtensionName + "\\.")}
into javaSrc + newExtensionName
}
// Replace dummy string in settings.gradle
String file = new File("settings.gradle").getText("UTF-8")
file = file.replaceAll("-dummy", "-" + newExtensionName)
new File("settings.gradle").write(file, "UTF-8")
// Replace dummy string in .project
file = new File(".project").getText("UTF-8")
file = file.replaceAll("-dummy", "-" + newExtensionName)
new File(".project").write(file, "UTF-8")
doLast {
delete javaSrc + 'dummy'
}
}
}
// Embedded Webserver
gretty {
httpPort = loadProperties().httpPort.toInteger()
servletContainer = loadProperties().servletContainer
contextPath = loadProperties().contextPath
recompileOnSourceChange = false
reloadOnClassChange = false
reloadOnConfigChange = false
reloadOnLibChange = false
}