-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
116 lines (93 loc) · 3.62 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
apply plugin: 'java'
sourceCompatibility = '1.6'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
task wrapper(type: Wrapper) {
gradleVersion = '4.10'
}
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = 'eu.mihosoft.vrl.codetools.Main'
}
repositories {
mavenCentral()
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
// loads the property file
loadProperties('build.properties')
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.4.0.3')
}
}
dependencies {
// TODO: Add dependencies here ...
// You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.12'
compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.3.2.3')
compile fileTree (dir: './lib', includes: ['*.jar'])
compile files(vrldir+'/plugins/vrl-ug.jar')
compile files(vrldir+'/plugins/vrl-ug-api.jar')
compile files(vrldir+'/plugins/VRL-UserData.jar')
// compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.2.8.5-SNAPSHOT', classifier: 'sources')
// compile (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.2.8.5-SNAPSHOT', classifier: 'javadoc')
}
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")}).
filter({file->return !file.name.startsWith("vrl-ug.jar")}).
filter({file->return !file.name.startsWith("vrl-ug-api.jar")}).
filter({file->return !file.name.startsWith("vrl-userdata.jar")}).
files.collect { zipTree(it) }
// project class files compiled from source
from files(sourceSets.main.output.classesDir)
}
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]) << {
println(">> copying vrl plugin to: " + getVRLDir()+"/plugin-updates")
copy {
from buildDir.getPath() + "/libs/"+rootProject.name + ".jar"
into getVRLDir() + "/plugin-updates"
include '**/*.jar'
}
}