-
Notifications
You must be signed in to change notification settings - Fork 15
Resolve extra classpath lazily when configuring Protobuf generation tasks #377
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 61c69a7.
private fun extraClasspath(project: Project, task: GenerateProtoTask): String { | ||
var extensions: FileCollection = project.configurations.getByName(EXTENSIONS) | ||
|
||
if (task.isTest) { |
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.
Turns out this isn't reliable - extractIncludeJvmTestProto is considered main
because it doesn't perfectly match p-g-p's criteria. I haven't looked how deeply that check failing affects our config.
extractIncludeProtoTasks().forEach { task -> | ||
val isTest = task.isTestTask() | ||
if ((!test && !isTest) || (test && isTest)) { | ||
logger.log(DEBUG_LOG_LEVEL, "Adding input files to task ${task.name} from ${it.taskName}") |
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.
logger.debug?
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.
This constant maps to debug right now, but I like to be able to change the value to make logs noisier at will. I can back out that pattern in a separate PR but don't want to right now.
Fixes this warning:
Definitely open to less hacky approaches...