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

[BEAM-3253] Swap to use local variable instead of using 'ext' #6926

Closed
wants to merge 1 commit into from

Conversation

lukecwik
Copy link
Member

@lukecwik lukecwik commented Nov 2, 2018


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@lukecwik
Copy link
Member Author

lukecwik commented Nov 2, 2018

R: @adude3141
CC: @swegner

@adude3141
Copy link
Contributor

@lukecwik As commented on the other PR, I was convinced, that task implements ExtensionAware, so that that property is scoped to the task. Indeed, the docs seem to support my understanding.

I ll revalidate that... and comment here again.

Sorry for the confusions I might have introduced. Definitelythis var should not have project scope.

@adude3141
Copy link
Contributor

adude3141 commented Nov 2, 2018

Added that to task config:
println "task: ${outFile}"
println "task: ${ext.outFile}"
println "project: ${project.outFile}"
println "project ext: ${project.ext.outFile}"

project outfile throws exception as expected

Could not get unknown property 'outFile' for project ':beam-examples-java' of type org.gradle.api.Project.

Of course u might access it like

${project.validateShadedJarDoesntLeakNonOrgApacheBeamClasses.outFile}

but that's what was intended...

Or do you think even a task property has to broad of a scope?

@lukecwik
Copy link
Member Author

lukecwik commented Nov 2, 2018

I was incorrect in thinking this would have made a project property and thanks for showing me that it is a task property. In this case it doesn't matter but I don't see much value in having the 'outFile' property be consumed by any chance versus using Gradles definition of outputs already.

I'll close this for now, if you also think that exposing outFile isn't useful, feel free to re-open.

@lukecwik lukecwik closed this Nov 2, 2018
@adude3141
Copy link
Contributor

adude3141 commented Nov 4, 2018

Honestly, I just thought outFile to have the proper semantics to justify a task property.

But of course your right, that it currently provides not much value, especially as that property must be treated as readonly.

For instance, one might to try to do a
project.validateShadedJarDoesntLeakNonOrgApacheBeamClasses.outFile=project.file('shoutOutHere')
println project.validateShadedJarDoesntLeakNonOrgApacheBeamClasses.outFile
which unfortunately will not work. I should have implemented an lazy setting as outputs.files { outFile } instead of directly setting outputs.files outFile

But I guess, this does not matter as no one will ever try to overwrite the output file anyway.

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

2 participants