Skip to content

Commit 07b2324

Browse files
authored
Merge pull request #27 from DataDog/tyler/add-gradle
Add gradle build scripts.
2 parents b16ca52 + 5a6bd2d commit 07b2324

File tree

13 files changed

+482
-0
lines changed

13 files changed

+482
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#########
33
target
44

5+
# Gradle #
6+
#########
7+
/.gradle
8+
*/build/
9+
dd-trace-examples/**/build/
10+
511
# Eclipse #
612
###########
713
*.launch

build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
allprojects {
2+
apply plugin: 'maven'
3+
4+
group = 'com.datadoghq'
5+
version = '0.1.2-SNAPSHOT'
6+
}
7+
8+
subprojects {
9+
apply plugin: 'java'
10+
sourceCompatibility = 1.7
11+
targetCompatibility = 1.7
12+
13+
task packageSources(type: Jar) {
14+
classifier = 'sources'
15+
from sourceSets.main.allSource\
16+
}
17+
artifacts.archives packageSources
18+
repositories {
19+
mavenLocal()
20+
21+
maven { url "http://repo.maven.apache.org/maven2" }
22+
}
23+
}

dd-java-agent-ittests/build.gradle

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
description = 'dd-java-agent-ittests'
2+
dependencies {
3+
testCompile project(':dd-java-agent')
4+
testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
5+
testCompile group: 'junit', name: 'junit', version: '4.12'
6+
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
7+
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
8+
testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
9+
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.1.v20170120'
10+
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.1.v20170120'
11+
testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '8.0.41'
12+
testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.0.41'
13+
testCompile(group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119') {
14+
exclude(module: 'httpclient')
15+
}
16+
testCompile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
17+
testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
18+
testCompile(group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0') {
19+
exclude(module: 'netty-handler')
20+
}
21+
testCompile(group: 'org.cassandraunit', name: 'cassandra-unit', version: '3.1.3.2') {
22+
exclude(module: 'netty-handler')
23+
}
24+
testCompile group: 'org.elasticsearch.client', name: 'transport', version: '5.4.1'
25+
testCompile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.2'
26+
testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
27+
testCompile group: 'javax.jms', name: 'javax.jms-api', version: '2.0.1'
28+
testCompile group: 'org.apache.activemq.tooling', name: 'activemq-junit', version: '5.14.5'
29+
testCompile group: 'org.apache.activemq', name: 'activemq-broker', version: '5.14.5'
30+
}
31+
32+
test {
33+
jvmArgs "-javaagent:${project(':dd-java-agent').buildDir}/libs/dd-java-agent-${project.version}-shadow.jar"
34+
jvmArgs "-Dorg.jboss.byteman.verbose=true"
35+
}
36+
37+
test.dependsOn project(':dd-java-agent').shadowJar

dd-java-agent/build.gradle

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
plugins {
2+
id 'application'
3+
id "com.github.johnrengelman.shadow" version "2.0.1"
4+
}
5+
6+
description = 'dd-java-agent'
7+
mainClassName = "com.datadoghq.trace.agent.AnnotationsTracingAgent"
8+
9+
dependencies {
10+
compile project(':dd-trace')
11+
compile project(':dd-trace-annotations')
12+
13+
compile group: 'io.opentracing.contrib', name: 'opentracing-agent', version: '0.1.0'
14+
compile group: 'org.reflections', name: 'reflections', version: '0.9.11'
15+
16+
17+
compile(group: 'io.opentracing.contrib', name: 'opentracing-web-servlet-filter', version: '0.0.9') {
18+
exclude(module: 'jetty-servlet')
19+
}
20+
compile(group: 'io.opentracing.contrib', name: 'opentracing-mongo-driver', version: '0.0.2') {
21+
exclude(module: 'mongodb-driver-async')
22+
exclude(module: 'mongo-java-driver')
23+
}
24+
compile group: 'io.opentracing.contrib', name: 'opentracing-jdbc', version: '0.0.2'
25+
compile(group: 'io.opentracing.contrib', name: 'opentracing-okhttp3', version: '0.0.5') {
26+
exclude(module: 'okhttp')
27+
}
28+
compile(group: 'io.opentracing.contrib', name: 'opentracing-jms-2', version: '0.0.3') {
29+
exclude(module: 'javax.jms-api')
30+
}
31+
compile(group: 'io.opentracing.contrib', name: 'opentracing-aws-sdk', version: '0.0.2') {
32+
exclude(module: 'aws-java-sdk')
33+
}
34+
compile(group: 'io.opentracing.contrib', name: 'opentracing-cassandra-driver', version: '0.0.2') {
35+
exclude(module: 'cassandra-driver-core')
36+
}
37+
compile(group: 'io.opentracing.contrib', name: 'opentracing-elasticsearch-client', version: '0.0.2') {
38+
exclude(module: 'transport')
39+
}
40+
compile(group: 'io.opentracing.contrib', name: 'opentracing-apache-httpclient', version: '0.0.2') {
41+
exclude(module: 'httpclient')
42+
}
43+
44+
testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
45+
testCompile group: 'junit', name: 'junit', version: '4.12'
46+
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
47+
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
48+
compileOnly group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.3.6.v20151106'
49+
compileOnly group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.0.M1'
50+
compileOnly group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
51+
compileOnly group: 'org.mongodb', name: 'mongodb-driver-async', version: '3.4.2'
52+
compileOnly group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
53+
compileOnly group: 'javax.jms', name: 'javax.jms-api', version: '2.0.1'
54+
compileOnly group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119'
55+
compileOnly group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0'
56+
compileOnly group: 'org.elasticsearch.client', name: 'transport', version: '5.4.1'
57+
compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
58+
}
59+
60+
jar {
61+
manifest {
62+
attributes(
63+
// I don't think we want to define this since we can't really load after startup:
64+
//"Agent-Class": "com.datadoghq.trace.agent.AnnotationsTracingAgent",
65+
"Premain-Class": "com.datadoghq.trace.agent.AnnotationsTracingAgent",
66+
"Can-Redefine-Classes": true,
67+
"Can-Retransform-Classes": true,
68+
// It is dangerous putting everything on the bootstrap classpath,
69+
// but kept for consistency with previous versions.
70+
"Boot-Class-Path": "./${jar.archiveName}.jar"
71+
)
72+
}
73+
}
74+
75+
shadowJar {
76+
append 'otarules.btm'
77+
78+
classifier 'shadow'
79+
80+
// mergeServiceFiles()
81+
82+
relocate('', 'dd.deps.') {
83+
exclude '%ant[META-INF/**/*]'
84+
}
85+
}

dd-trace-annotations/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
description = 'dd-trace-annotations'
2+
dependencies {
3+
testCompile group: 'junit', name: 'junit', version: '3.8.1'
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description = 'async-tracing'
2+
dependencies {
3+
compile project(':dd-trace')
4+
compile group: 'io.opentracing.contrib', name: 'opentracing-spanmanager', version: '0.0.5'
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description = 'dropwizard-mongo-client'
2+
dependencies {
3+
compile project(':dd-trace-annotations')
4+
compile group: 'io.dropwizard', name: 'dropwizard-core', version: '0.9.2'
5+
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
6+
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.7.0'
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description = 'spring-boot-jdbc'
2+
dependencies {
3+
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.41'
4+
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.3.RELEASE'
5+
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '1.5.3.RELEASE'
6+
}

dd-trace/build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
plugins {
2+
id "com.github.johnrengelman.shadow" version "2.0.1"
3+
}
4+
5+
description = 'dd-trace'
6+
dependencies {
7+
compile group: 'io.opentracing', name: 'opentracing-api', version: '0.30.0'
8+
compile group: 'io.opentracing', name: 'opentracing-noop', version: '0.30.0'
9+
compile group: 'io.opentracing', name: 'opentracing-util', version: '0.30.0'
10+
compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
11+
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8'
12+
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.8.8'
13+
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
14+
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
15+
compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
16+
testCompile group: 'junit', name: 'junit', version: '4.12'
17+
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
18+
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
19+
}
20+
21+
shadowJar {
22+
// mergeServiceFiles()
23+
24+
classifier 'shadow'
25+
26+
relocate('', 'dd.deps.') {
27+
exclude '%ant[META-INF/**/*]'
28+
}
29+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Fri Jun 30 11:21:26 PDT 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip

0 commit comments

Comments
 (0)