forked from DataDog/dd-trace-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdd-trace-java.gradle
105 lines (86 loc) · 2.94 KB
/
dd-trace-java.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
buildscript {
configurations.classpath {
resolutionStrategy {
// both axion-release and spotless use jgit, use the axion-release version
force 'org.eclipse.jgit:org.eclipse.jgit:5.12.0.202106070339-r'
}
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.27.0'
id "com.diffplug.spotless" version "5.17.1"
id 'com.github.spotbugs' version '4.6.0'
id 'com.dorongold.task-tree' version '2.1.0'
id "de.thetaphi.forbiddenapis" version "3.2"
id 'org.unbroken-dome.test-sets' version '4.0.0'
id 'pl.allegro.tech.build.axion-release' version '1.13.6'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
id "com.github.johnrengelman.shadow" version "7.1.2" apply false
id "me.champeau.jmh" version "0.6.5" apply false
id 'org.gradle.playframework' version '0.12' apply false
}
description = 'dd-trace-java'
def isCI = System.getenv("CI") != null
apply from: "$rootDir/gradle/scm.gradle"
apply from: "$rootDir/gradle/spotless.gradle"
def compileTask = tasks.register("compile")
allprojects {
group = 'com.datadoghq'
version = scmVersion.version
if (isCI) {
buildDir = "$rootDir/workspace/${projectDir.path.replace(rootDir.path, '')}/build/"
}
apply from: "$rootDir/gradle/dependencies.gradle"
apply from: "$rootDir/gradle/util.gradle"
compileTask.configure {
dependsOn tasks.withType(AbstractCompile)
}
}
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
tasks.register("latestDepTest")
nexusPublishing {
repositories {
def forceLocal = project.hasProperty('forceLocal') && forceLocal
if (forceLocal && !isCI) {
local {
// For testing use with https://hub.docker.com/r/sonatype/nexus
// docker run --rm -d -p 8081:8081 --name nexus sonatype/nexus
// Doesn't work for testing releases though... (due to staging)
nexusUrl = uri("http://localhost:8081/nexus/content/repositories/releases/")
snapshotRepositoryUrl = uri("http://localhost:8081/nexus/content/repositories/snapshots/")
username = "admin"
password = "admin123"
}
} else {
sonatype {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
allprojects {
tasks.withType(JavaForkOptions).configureEach {
maxHeapSize = System.properties["datadog.forkedMaxHeapSize"]
minHeapSize = System.properties["datadog.forkedMinHeapSize"]
jvmArgs "-XX:ErrorFile=/tmp/hs_err_pid%p.log"
jvmArgs "-XX:+HeapDumpOnOutOfMemoryError"
jvmArgs "-XX:HeapDumpPath=/tmp"
}
}
tasks.register('writeMuzzleTasksToFile') {
doLast {
def muzzleFile = file("${buildDir}/muzzleTasks")
assert muzzleFile.parentFile.mkdirs() || muzzleFile.parentFile.directory
muzzleFile.text = subprojects.findAll { subproject -> subproject.plugins.hasPlugin('muzzle') }
.collect { it.path + ":muzzle" }
.join('\n')
}
}