-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·57 lines (43 loc) · 1.48 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
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
repositories {
maven {
url 'https://repo1.maven.org/maven2'
}
flatDir {
dirs 'lib'
}
}
group = 'com.newrelic.instrumentation.labs'
version = '1.6'
dependencies {
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
implementation group: 'com.newrelic.agent.java', name: 'newrelic-api', version: '6.5.0'
implementation group: 'com.newrelic.agent.java', name: 'newrelic-agent', version: '6.5.0'
}
jar {
manifest {
attributes 'Implementation-Title': project.group + '.' + project.name, 'Implementation-Vendor-Id': 'com.newrelic.labs', 'Implementation-Version': version
}
}
task install(dependsOn: jar, type: Copy) {
description = 'Copies compiled jar to the NEW_RELIC_EXTENSIONS_DIR.'
group = 'New Relic Labs'
def extDir = System.getenv("NEW_RELIC_EXTENSIONS_DIR") ?: " "
from jar
into extDir
}
install.doFirst {
def extDir = System.getenv("NEW_RELIC_EXTENSIONS_DIR")
if (extDir == null) {
throw new Exception("Must set NEW_RELIC_EXTENSIONS_DIR.")
}
if (extDir.startsWith("~" + File.separator)) {
extDir = System.getProperty("user.home") + extDir.substring(1);
}
if (!file(extDir).directory) {
throw new Exception(extDir + "NEW_RELIC_EXTENSIONS_DIR, set as '" + extDir + "'is not a valid directory.")
}
}