Skip to content
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

Make the plugin output directory configurable #356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kilink
Copy link
Member

@kilink kilink commented Mar 22, 2022

Make outputDir configurable, so that users can have full control over the output path.

Additionally, the GenerateJavaTask lazy by converting inputs to gradle Properties.

See: https://docs.gradle.org/current/userguide/lazy_configuration.html

@BeforeEach
fun setUp() {
val projectResourcePath = Paths.get("src", "test", "resources", "test-project")
projectResourcePath.toFile().copyRecursively(target = projectDir.toFile())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests were writing to the resources directory, which could make them nondeterministic. I switched them to use a temporary directory and copy the project files into it between each test case.

@kilink kilink requested review from berngp and chali March 22, 2022 03:09

open class GenerateJavaTask : DefaultTask() {
@Input
var generatedSourcesDir: String = project.buildDir.absolutePath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of feel like this property should be deprecated, and people should just set the outputDir directly if they need to customize it. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I don't think anyone is using it per se.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked internal usages and we have a few. We can get rid of it in a subsequent release after I've given them a heads up to switch to using outputDir

@kilink
Copy link
Member Author

kilink commented Mar 22, 2022

Would fix #281

Make outputDir configurable, so that users can have full control over the output
path.

Additionally, the GenerateJavaTask lazy by converting inputs to gradle Properties.

See: https://docs.gradle.org/current/userguide/lazy_configuration.html
@berngp
Copy link
Contributor

berngp commented Jul 8, 2022

@kilink could you please rebase with the latest master, as time allows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants