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
GEODE-5688 Create task to generate all sources for better IDE behavior #2422
Conversation
Use `./gradle generate` to create the sources from both protobuf and ANTLR, then refresh the IDE sources and build as normal.
Why not just run the existing gradle tasks to generate the files? |
Can you tell me those names without looking?
On Sep 5, 2018 16:29, "Anthony Baker" <notifications@github.com> wrote:
Why not just run the existing gradle tasks to generate the files?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2422 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Aer30txE-l_Ij4FwH4mGuAwfHHgT0Rqaks5uYF5sgaJpZM4WZ3We>
.
|
@metatype there are multiple targets in different projects to execute. Having a meta-task that these, and any new ones, attach to makes it easy to document.
|
geode-core/build.gradle
Outdated
|
||
afterEvaluate { | ||
rootProject.generate.dependsOn(generateGrammarSource) | ||
project.assemble.dependsOn(generateGrammarSource) |
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.
Why do we need this dependency and all the others added after this line?
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.
assemble
is the lifecycle task most closely aligned with this task as a dependency, then we use mustRunAfter
to ensure that our generate tasks happen first within this project in all cases.
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.
I don’t understand why we need to do that though. They already happen before assemble by design. We should only need to add a pseudo target to encourage them to run outside of that normal behavior for quick project generation.
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.
@pivotal-jbarrett I'll remove the offending lines. Look for incoming commit...
@pivotal-jbarrett |
@metatype I don't see it as anything more than |
Authored-by: Robert Houghton <rhoughton@pivotal.io>
geode-core/build.gradle
Outdated
@@ -301,3 +301,7 @@ distributedTest { | |||
// Some tests have inner tests that should be ignored | |||
exclude "**/*\$*.class" | |||
} | |||
|
|||
afterEvaluate { |
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.
Why does this need to be done in afterEvaluate?
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 it does not. I had both generation tasks using identical formatting for consistency, but it is not needed here. I have removed the block for this dependency change.
I like the idea of this minimal task, but I somewhat agree with Anthony that having to remember to run Is there a way to hook this into the |
There is not a way to teach IDEA to generate or run arbitrary tasks. You can tell it to use gradle for all tasks or for none. |
…marSource Authored-by: Robert Houghton <rhoughton@pivotal.io>
@@ -61,3 +61,7 @@ task zip(type: Zip) { | |||
} | |||
|
|||
assemble.dependsOn 'zip' | |||
|
|||
afterEvaluate { |
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.
Is this afterEvaluate really necessary too?
Yes.
…On Fri, Sep 14, 2018 at 2:02 PM Jacob Barrett ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In geode-protobuf-messages/build.gradle
<#2422 (comment)>:
> @@ -61,3 +61,7 @@ task zip(type: Zip) {
}
assemble.dependsOn 'zip'
+
+afterEvaluate {
Is this afterEvaluate really necessary too?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2422 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aer30iu_nDcht-uyYa4fwrhkKtYg1UHoks5ubBlbgaJpZM4WZ3We>
.
|
Use
./gradle generate
to create the sources from both protobuf andANTLR, then refresh the IDE sources and build as normal.
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop
)?Is your initial contribution a single, squashed commit?
Does
gradlew build
run cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.