-
Notifications
You must be signed in to change notification settings - Fork 318
Make CSI plugin collect too much classpaths #9985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0ebc011
6cedb81
8ebb511
aa35af4
d472a9e
e1ec9b5
f11ea17
b0b8121
79c9526
6a373c9
9bddc7f
207d849
eda1af3
c189714
f2f5205
3aebe10
b5ef0ba
dea2a7c
5c32a8c
c84d247
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,3 +77,6 @@ mise*.local.toml | |
| .config/mise*.toml | ||
| # asdf | ||
| .tool-versions | ||
|
|
||
| # Exclude kotlin build files | ||
| .kotlin | ||
This file was deleted.
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extracted from |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| package datadog.gradle.plugin.csi | ||
|
|
||
| import org.gradle.api.file.ConfigurableFileCollection | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.file.ProjectLayout | ||
| import org.gradle.api.model.ObjectFactory | ||
| import org.gradle.api.provider.ListProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
| import org.gradle.kotlin.dsl.listProperty | ||
| import org.gradle.kotlin.dsl.property | ||
| import java.io.File | ||
| import javax.inject.Inject | ||
|
|
||
|
|
||
| /** | ||
| * This extension allows to configure the Call Site Instrumenter plugin execution. | ||
| */ | ||
| abstract class CallSiteInstrumentationExtension @Inject constructor( | ||
| objectFactory: ObjectFactory, | ||
| layout: ProjectLayout | ||
| ) { | ||
| companion object { | ||
| const val CALL_SITE_CLASS_SUFFIX = "CallSite" | ||
| const val CALL_SITE_CONSOLE_REPORTER = "CONSOLE" | ||
| const val CALL_SITE_ERROR_CONSOLE_REPORTER = "ERROR_CONSOLE" | ||
| } | ||
|
|
||
| /** | ||
| * The location of the source code to generate call site ({@code <project>/src/main/java} by default). | ||
| */ | ||
| val srcFolder: DirectoryProperty = objectFactory.directoryProperty().convention( | ||
| layout.projectDirectory.dir("src").dir("main").dir("java") | ||
| ) | ||
|
|
||
| /** | ||
| * The location to generate call site source code ({@code <project>/build/generated/sources/csi} by default). | ||
| */ | ||
| val targetFolder: DirectoryProperty = objectFactory.directoryProperty().convention( | ||
| layout.buildDirectory.dir("generated/sources/$CSI_SOURCE_SET") | ||
| ) | ||
|
|
||
| /** | ||
| * The generated call site source file suffix (#CALL_SITE_CLASS_SUFFIX by default). | ||
| */ | ||
| val suffix: Property<String> = objectFactory.property<String>().convention(CALL_SITE_CLASS_SUFFIX) | ||
|
|
||
| /** | ||
| * The reporters to use after call site instrumenter run (only #CALL_SITE_CONSOLE_REPORTER and #CALL_SITE_ERROR_CONSOLE_REPORTER supported for now). | ||
| */ | ||
| val reporters: ListProperty<String> = objectFactory.listProperty<String>().convention( | ||
| listOf( | ||
| CALL_SITE_ERROR_CONSOLE_REPORTER | ||
| ) | ||
| ) | ||
|
|
||
| /** | ||
| * The location of the dd-trace-java project to look for the call site instrumenter (optional, current project root folder used if not set). | ||
| */ | ||
| abstract val rootFolder: Property<File> | ||
|
|
||
| /** | ||
| * The JVM to use to run the call site instrumenter (optional, default JVM used if not set). | ||
| */ | ||
| val javaVersion: Property<JavaLanguageVersion> = | ||
| objectFactory.property<JavaLanguageVersion>().convention(JavaLanguageVersion.current()) | ||
|
|
||
| /** | ||
| * The JVM arguments to run the call site instrumenter. | ||
| */ | ||
| val jvmArgs: ListProperty<String> = | ||
| objectFactory.listProperty<String>().convention(listOf("-Xmx128m", "-Xms64m")) | ||
|
|
||
| /** | ||
| * The paths used to look for the call site instrumenter dependencies. | ||
| * | ||
| * The plugin includes by default **only** the `main` and `test` source sets, and their | ||
| * related compilation classpath. As we don't want other test configurations by default. | ||
| * | ||
| * However, it's possible to contribute additional paths to look for dependencies. | ||
| */ | ||
| val additionalPaths: ConfigurableFileCollection = objectFactory.fileCollection() | ||
|
Comment on lines
+74
to
+82
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: Before the csi plugin consumed all test configurations, which forced to resolved all jvm test suites configurations. Now that the csi plugin is now restricted to the standard main and test, a way is needed to provide additional paths to the call site instrumenter generator. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!