-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
92 lines (81 loc) · 3.35 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
plugins {
id 'com.github.prokod.gradle-crossbuild' version '0.14.1' apply false
id "org.jetbrains.kotlin.jvm" version "1.6.20" apply false
id "com.newrelic.gradle-verify-instrumentation-plugin" version "4.0" apply false
id "com.newrelic.gradle-compatibility-doc-plugin" version "1.1" apply false
}
allprojects {
apply plugin: 'idea'
// ignores MANIFEST.MF
normalization {
runtimeClasspath {
metaInf {
ignoreManifest()
}
}
}
group = 'com.newrelic.agent.java.security'
version = agentVersion + (project.findProperty("release") == "true" ? "" : "-SNAPSHOT")
version = version + (project.findProperty("release-suffix") != null ? project.findProperty("release-suffix") : "")
idea.module {
outputDir file('build/classes/main')
testOutputDir file('build/classes/test')
}
if (project.convention.findPlugin(JavaPluginConvention)) {
// Change the output directory for the main and test source sets back to the old path
sourceSets.main.output.classesDir = new File(buildDir, "classes/main")
sourceSets.test.output.classesDir = new File(buildDir, "classes/test")
}
tasks.withType(Copy) {
includeEmptyDirs = false
}
if ('newrelic-security-agent'.equals(project.name)){
apply from: "$rootProject.projectDir/gradle/script/generate-license-info.gradle"
}
}
// This fixes an issue with intellij where the test output build path is incorrect for the top-level java_agent module
idea.module {
testOutputDir = file('test')
excludeDirs += file("automation")
}
subprojects {
repositories {
mavenLocal()
// Sonatype SNAPSHOT repository
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
mavenCentral()
jcenter()
}
// SNAPSHOTs are considered to be "changing dependencies" and they are cached by gradle for 24 hours by default.
// The setting below eliminates the caching and forces the build to always refresh the SNAPSHOT dependency.
// https://docs.gradle.org/current/userguide/dynamic_versions.html#sub:declaring_dependency_with_changing_version
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
def isJavaProject = ![
'newrelic-security-agent', // is a parent project
'instrumentation-build',
'newrelic-security-data-schema',
'newrelic-security-api',
'instrumentation-security',
'instrumentation',
].contains(project.name)
if (isJavaProject) {
project.ext.javaProject = true
apply from: "$rootProject.projectDir/gradle/script/java.gradle"
} else {
// This fixes an issue with intellij where the test output build path is incorrect for non-java projects
idea.module {
testOutputDir = file('test')
}
}
}
ext {
// when upgrading ASM, check the javadoc for the following classes:
// SynchronizedAnnotationNode, SynchronizedClassNode, SynchronizedFieldNode, SynchronizedInnerClassNode, SynchronizedInnerClassNode, SynchronizedMethodNode,
// SynchronizedModuleExportNode, SynchronizedModuleNode, SynchronizedModuleOpenNode, SynchronizedModuleProvideNode, SynchronizedModuleRequireNode,
// SynchronizedTypeAnnotationNode
asmVersion=9.2
}