-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
136 lines (116 loc) · 3.69 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
buildscript {
// Fallback use internet ones
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/plugins-release' }
maven { url 'http://repo.spring.io/milestone' }
maven { url 'https://plugins.gradle.org/m2/' }
}
project.repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/milestone' }
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'https://repository.jboss.org/nexus/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'http://repo.maven.apache.org/maven2' }
}
dependencies {
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2'
classpath 'net.ltgt.gradle:gradle-apt-plugin:0.8'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
}
}
apply plugin: 'idea'
apply from: 'gradle/branch.gradle'
apply from: 'gradle/java.gradle'
apply from: 'gradle/lombok.gradle'
apply from: 'gradle/sonar.gradle'
apply from: 'gradle/protobuf.gradle'
apply plugin: 'eu.appsatori.fatjar'
group = 'org.apache.hbase'
version = '1.0.0-SNAPSHOT'
description = 'POC on Hbase coprocessors'
defaultTasks 'clean', 'build', 'fatJar'
dependencies {
// Hbase dependencies
["org.apache.hbase:hbase-client:${hbase_version}",
"org.apache.hbase:hbase-common:${hbase_version}",
"org.apache.hbase:hbase-protocol:${hbase_version}",
"org.apache.hbase:hbase-server:${hbase_version}",
"org.apache.hbase:hbase-annotations:${hbase_version}"].each {
compile(it) {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
ext {
fatJarExclude = true
}
}
}
// Copy of hbase-protocol files to compile, extract *.proto and avoid compiling them twice
// testCompile files('lib/hbase-protocol-1.2.3-protobuf.jar') FIXME: Runtime issue due to packages
// Explicitly add Protobuf dependencies
compile("com.google.protobuf:protobuf-java:${protobuf_version}") {
ext {
fatJarExclude = true
}
}
// Bytecode modifiction
compile "org.javassist:javassist:${javassist_version}"
// Testing libraries
testCompile 'org.assertj:assertj-core:3.6.2'
testCompile 'junit:junit'
// Hbase test libraries
testCompile("org.apache.hbase:hbase-testing-util:${hbase_version}") {
exclude module: 'slf4j-log4j12'
exclude module: 'log4j'
}
// Java agent utilities (able to load agent on JVM at runtime)
testCompile 'com.ea.agentloader:ea-agent-loader:1.0.2'
// Logging purpose
testRuntime 'org.slf4j:slf4j-log4j12:1.7.23'
}
tasks.withType(Jar) {
manifest {
attributes(
'Premain-Class': 'fr.poc.hbase.coprocessor.policy.agent.CoprocessorPolicyAgent',
'Agent-Class': 'fr.poc.hbase.coprocessor.policy.agent.CoprocessorPolicyAgent',
'Can-Redefine-Classes': 'true',
'Can-Retransform-Classes': 'true',
'Can-Set-Native-Method-Prefix': 'false'
)
}
}
test {
environment 'PATH', "./developer/bin;${System.getenv()['PATH']}"
environment 'hadoop.log.dir', ''
environment 'hadoop.tmp.dir', ''
exclude '**/*AgentTest*'
ignoreFailures true
testLogging {
events 'skipped', 'failed'
}
}
task agentTest(type: Test, description: 'Runs the tests with policy agent', group: 'verification') {
testClassesDir = sourceSets.test.output.classesDir
classpath = sourceSets.test.runtimeClasspath
environment 'PATH', "./developer/bin;${System.getenv()['PATH']}"
environment 'hadoop.log.dir', ''
environment 'hadoop.tmp.dir', ''
include '**/*AgentTest*'
ignoreFailures true
testLogging {
events 'skipped', 'failed'
}
}
test.dependsOn agentTest
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}
fatJar{
exclude 'META-INF/*.MF'
}