1- package datadog.gradle.plugin
1+ package datadog.gradle.plugin.csi
22
33import org.gradle.api.GradleException
44import org.gradle.api.JavaVersion
55import org.gradle.api.Plugin
66import org.gradle.api.Project
7- import org.gradle.api.file.DirectoryProperty
8- import org.gradle.api.file.ProjectLayout
9- import org.gradle.api.model.ObjectFactory
107import org.gradle.api.plugins.JavaPluginExtension
11- import org.gradle.api.provider.ListProperty
12- import org.gradle.api.provider.Property
138import org.gradle.api.tasks.JavaExec
149import org.gradle.api.tasks.SourceSet
1510import org.gradle.api.tasks.SourceSetContainer
@@ -24,51 +19,6 @@ import java.nio.file.Paths
2419import javax.inject.Inject
2520
2621private const val CALL_SITE_INSTRUMENTER_MAIN_CLASS = " datadog.trace.plugin.csi.PluginApplication"
27- private const val CALL_SITE_CLASS_SUFFIX = " CallSite"
28- private const val CALL_SITE_CONSOLE_REPORTER = " CONSOLE"
29- private const val CALL_SITE_ERROR_CONSOLE_REPORTER = " ERROR_CONSOLE"
30-
31- /* *
32- * This extension allows to configure the Call Site Instrumenter plugin execution.
33- */
34- abstract class CallSiteInstrumentationExtension @Inject constructor(objectFactory : ObjectFactory , layout : ProjectLayout ) {
35- /* *
36- * The location of the source code to generate call site ({@code <project>/src/main/java} by default).
37- */
38- val srcFolder: DirectoryProperty = objectFactory.directoryProperty().convention(
39- layout.projectDirectory.dir(" src" ).dir(" main" ).dir(" java" )
40- )
41- /* *
42- * The location to generate call site source code ({@code <project>/build/generated/sources/csi} by default).
43- */
44- val targetFolder: DirectoryProperty = objectFactory.directoryProperty().convention(
45- layout.buildDirectory.dir(" generated${File .separatorChar} sources${File .separatorChar} csi" )
46- )
47- /* *
48- * The generated call site source file suffix (#CALL_SITE_CLASS_SUFFIX by default).
49- */
50- val suffix: Property <String > = objectFactory.property(String ::class .java).convention(CALL_SITE_CLASS_SUFFIX )
51- /* *
52- * The reporters to use after call site instrumenter run (only #CALL_SITE_CONSOLE_REPORTER and #CALL_SITE_ERROR_CONSOLE_REPORTER supported for now).
53- */
54- val reporters: ListProperty <String > = objectFactory.listProperty(String ::class .java).convention(listOf (
55- CALL_SITE_ERROR_CONSOLE_REPORTER
56- ))
57- /* *
58- * The location of the dd-trace-java project to look for the call site instrumenter (optional, current project root folder used if not set).
59- */
60- abstract val rootFolder: Property <File >
61-
62- /* *
63- * The JVM to use to run the call site instrumenter (optional, default JVM used if not set).
64- */
65- abstract val javaVersion: Property <JavaLanguageVersion >
66-
67- /* *
68- * The JVM arguments to run the call site instrumenter.
69- */
70- val jvmArgs: ListProperty <String > = objectFactory.listProperty(String ::class .java).convention(listOf (" -Xmx128m" , " -Xms64m" ))
71- }
7222
7323abstract class CallSiteInstrumentationPlugin : Plugin <Project >{
7424 @get:Inject
0 commit comments