Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// Keep gradle/java.gradle as the source of truth while consumers move to plugins {}.
apply(from = rootDir.resolve("gradle/java.gradle"))
plugins {
id("dd-trace-java.dependency-locking")
}

apply(from = rootDir.resolve("gradle/java_deps.gradle"))
apply(from = rootDir.resolve("gradle/java_no_deps.gradle"))
4 changes: 0 additions & 4 deletions gradle/java.gradle

This file was deleted.

8 changes: 4 additions & 4 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ def scriptApplyExceptions = [
'gradle/publish.gradle': [':dd-java-agent'] as Set,
]
boolean forbidLegacyScriptApplies = project.rootProject.name == 'dd-trace-java'
def javaGradleApplyLinePattern = ~/^\s*(?:\w+\.)?apply(?:\s+from\s*:|\s*\(\s*from\s*=).*/
// Script plugins that must be applied through a 'dd-trace-java.module.*' convention plugin instead.
def legacyScriptApplyLinePattern = ~/^\s*(?:\w+\.)?apply(?:\s+from\s*:|\s*\(\s*from\s*=).*/
// Script plugins that must be replaced by their corresponding convention plugins.
def forbiddenScriptApplies = [
'gradle/java.gradle' : 'Apply a \'dd-trace-java.module.*\' convention plugin instead of applying the script plugin \'gradle/java.gradle\' directly.',
'gradle/java.gradle' : 'Apply the \'dd-trace-java.conventions.java\' convention plugin instead of applying the script plugin \'gradle/java.gradle\' directly.',
'gradle/publish.gradle': 'Apply the \'dd-trace-java.module.distributable.*\' convention plugin instead of applying the script plugin \'gradle/publish.gradle\' directly.',
]
def forbidLegacyScriptApplyStep = { String text ->
if (forbidLegacyScriptApplies) {
text.readLines().each { line ->
if (javaGradleApplyLinePattern.matcher(line).matches()) {
if (legacyScriptApplyLinePattern.matcher(line).matches()) {
forbiddenScriptApplies.each { script, message ->
if (line.contains(script) && !scriptApplyExceptions.getOrDefault(script, []).contains(project.path)) {
throw new AssertionError(message)
Expand Down
Loading