-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
152 lines (126 loc) · 4.37 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
147
148
149
150
151
152
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'eclipse'
apply plugin: 'com.jfrog.artifactory'
version = '0.2-SNAPSHOT'
group = 'edu.gcsc.lua'
if (System.env['TRAVIS'] != null) {
project.ext.set ("buildInfo.build.number", System.env.TRAVIS_BUILD_NUMBER)
project.ext.set ("buildInfo.build.name", rootProject.name)
} else {
project.ext.set ("buildInfo.build.number", '0' )
project.ext.set ("buildInfo.build.name", rootProject.name+"-local")
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
wrapper {
gradleVersion = '5.1'
}
repositories {
mavenCentral()
mavenLocal()
// 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"
}
maven {
name 'JFrog OSS snapshot repo'
url 'https://oss.jfrog.org/oss-snapshot-local/'
}
}
buildscript {
repositories {
maven {
url 'http://oss.jfrog.org/artifactory/plugins-release'
}
maven {
name 'jcenter'
url 'http://jcenter.bintray.com'
}
}
dependencies {
classpath 'me.champeau.gradle:antlr4-gradle-plugin:0.1'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.0.1')
}
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.easymock', name: 'easymock', version: '3.3'
implementation (group: 'eu.mihosoft.vrl', name: 'vrl', version: '0.4.4+')
implementation "org.antlr:antlr4-runtime:4.5"
implementation (group: 'edu.gcsc.lua', name: 'luaautocomplete', version: '0.2-SNAPSHOT')
implementation (group: 'edu.gcsc.lua', name: 'ug4luaautocomplete', version: '0.2-SNAPSHOT')
implementation (group: 'org.luaj', name: 'luaj-jse', version: '3.0')
implementation (group: 'org.luaj', name: 'luaj-jse', version: '3.0', classifier: 'sources')
implementation (group: 'org.luaj', name: 'luaj-jse', version: '3.0', 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)
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
jar
}
}
}
//artifactory {
// contextUrl = "http://oss.jfrog.org/artifactory"
// publish {
// repository {
// repoKey = 'oss-snapshot-local'
// username = "turpid-monkey"
// password = System.getenv()['bintrayKey']
// maven = true
// }
// defaults {
// publications ('mavenJava')
// }
// }
// resolve {
// repository {
// repoKey = 'libs-release'
// maven = true
// }
// }
//}
// 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')
// compiles and installs the vrl plugin to the specified folder
task installVRLPlugin(dependsOn: [clean,jar]) {
doLast {
def vrlPluginPath = System.getenv()['HOME'] + "/" + vrldir+ "/plugin-updates"
println(">> copying vrl plugin to: " + vrlPluginPath)
copy {
from buildDir.getPath()+"/libs/"+rootProject.name + "-" + rootProject.version + ".jar"
into vrlPluginPath
include '**/*.jar'
}
}
}