-
Notifications
You must be signed in to change notification settings - Fork 274
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
generatedFileDir does not follow Gradle Java Plugin conventions (nor can you) #16
Comments
This is a duplicate of #13. I think it makes sense to let Then |
This actually looks like something the user should be able to configure to be something else. We can by default put it some place, but it should be able to be overridden. |
It not only looks bad, but also causes problem in setting up directory structure when sourceSet.name is artificially added to it. Gradle default practice is to have a java directory inside its source set, but its impossible use that structure currently. |
I am working on a new version that will change the default output path to |
@ejona86 Allow overriding the outputDir on the codegen plugin or task granularity is hard to implement correctly (see #13 (comment)). So far, people have been just wanting that generated files of different codegen plugins can be in separate directories, which doesn't require fine-grained customization. |
@zhangkun83, how will we commit code generated code? https://github.com/grpc/grpc-java/blob/master/build.gradle#L60 |
@ejona86 this is a use case for customizing the global base dir, which we can still support. |
Let's move discussions to #13 |
In the plugin, generatedSourceDir is always set to
${generatedSourceDir}/${sourceSet.name}
.Given
generatedFileDir = "${projectDir}/src"
, this dumps the compiled sources intosubproject/src/main/com/test
vs. a more canonicalsubproject/src/main/java/com/test
. Since thesourceSet.name
is always appended to the generatedFileDir, there's no good way to get the latter behavior.The default behavior of the Java Plugin would be
${project.projectDir}/src/${sourceSet.name}/java
I'm afraid I'm not familiar enough with Gradle internals to suggest a better solution, but I'd almost rather just be able to say
generatedFileDir = "${projectDir}/src/main/java
and not worry about the sourceSet name.The text was updated successfully, but these errors were encountered: