-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
146 lines (123 loc) · 4.42 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
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
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2010–2012 Steinbeis Forschungszentrum (STZ Ölbronn),
* Copyright (c) 2012–2018 Goethe Universität Frankfurt am Main, Germany
*
* This file is part of Visual Reflection Library (VRL).
*
* VRL is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* as published by the Free Software Foundation.
*
* see: http://opensource.org/licenses/LGPL-3.0
* file://path/to/VRL/src/eu/mihosoft/vrl/resources/license/lgplv3.txt
*
* VRL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* This version of VRL includes copyright notice and attribution requirements.
* According to the LGPL this information must be displayed even if you modify
* the source code of VRL. Neither the VRL Canvas attribution icon nor any
* copyright statement/attribution may be removed.
*
* Attribution Requirements:
*
* If you create derived work you must do three things regarding copyright
* notice and author attribution.
*
* First, the following text must be displayed on the Canvas:
* "based on VRL source code". In this case the VRL canvas icon must be removed.
*
* Second, the copyright notice must remain. It must be reproduced in any
* program that uses VRL.
*
* Third, add an additional notice, stating that you modified VRL. In addition
* you must cite the publications listed below. A suitable notice might read
* "VRL source code modified by YourName 2012".
*
* Note, that these requirements are in full accordance with the LGPL v3
* (see 7. Additional Terms, b).
*
* Publications:
*
* M. Hoffer, C.Poliwoda, G.Wittum. Visual Reflection Library -
* A Framework for Declarative GUI Programming on the Java Platform.
* Computing and Visualization in Science, 2011, in press.
*/
apply plugin: 'java'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
wrapper {
gradleVersion = '6.8'
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.4.0.3')
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.10'
compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.4.0.3')
compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.4.0.3', classifier: 'javadoc')
compile group: 'org.apache.xmlrpc', name: 'xmlrpc-client', version: '3.1.3'
compile group: 'org.apache.xmlrpc', name: 'xmlrpc-server', version: '3.1.3'
// local dependencies can be added by putting them to the lib/jar folder
compile files("lib/jars/")
}
def loadProperties(String sourceFileName) {
def config = new Properties()
def propFile = new File(projectDir,sourceFileName)
if (propFile.isFile()) {
config.load(new FileInputStream(propFile))
for (Map.Entry property in config) {
ext.set(property.key, property.value)
}
}
}
// create a fat-jar (class files plus dependencies
// excludes VRL.jar (plugin jar files must not start with 'vrl-\\d+')
jar {
// dependencies except VRL
from configurations.runtime.asFileTree.
filter({file->return !file.name.startsWith("vrl-0")}).
files.collect { zipTree(it) }
// project class files compiled from source
from files(sourceSets.main.output.classesDirs)
}
// loads the property file
loadProperties('build.properties')
String getVRLDir() {
String result
if (vrldir.isEmpty()) {
result = System.getProperty("user.home");
result+= "/.vrl/"
result+= eu.mihosoft.vrl.system.Constants.VERSION_MAJOR
result+= "/default"
} else {
result = vrldir
}
return result
}
// compiles and installs the vrl plugin to the specified folder
task installVRLPlugin(dependsOn: [clean,jar]) {
doLast {
println(">> copying vrl plugin to: " + getVRLDir() + "/plugin-updates")
copy {
from buildDir.getPath() + "/libs/" + rootProject.name + ".jar"
into getVRLDir() + "/plugin-updates"
include '**/*.jar'
}
}
}