-
Notifications
You must be signed in to change notification settings - Fork 5
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
Auto-insert 'use Traits' into files via .build.php during build process #240
Conversation
@jaswsinc A review here when you get a chance, please. I've tested this with Phing and it works as expected. Note that this PR depends on wpsharks/phings#73 to work properly while building the Lite version. Right now the generated Lite builds include Pro-only Trait files that should be excluded before the |
@raamdev This all looks great to me. The only thing I'm realizing now is that the order of our Phing targets could prevent this from working as expected. Currently (and I don't see a way around this), the So that means whenever it copies files over to create the lite version, it's going to be copying over files that have already had Traits inserted into them from the pro build that came before the lite build begins. Whenever the What I'd suggest is that you have an open comment marker:
and then a closing comment marker:
Whenever the replacements are done, leave the markers, but change what is inside them. This way it can be run over and over again without issue, and if it runs during the lite build, it will overwrite was done run for the pro build. |
Ah, tricky tricky. Good catch.
Yep, that sounds like a better idea. I'll work on that and let you know when I'm ready for another review. :-) |
@jaswsinc writes...
Actually, that's not true. The build script copies the repo files into the Lite staging area, not the built Pro files from So, I'm not seeing that any changes are necessary, are you? |
Noting that wpsharks/phings#73 has been implemented and can be tested from the dev branch. |
I think you make a good argument for that being the way it should be done, or at least much closer to that idea. The Phing build system is turning into something now where that seems like a more desirable behavior. However, as it exists right now, everything before the See: https://github.com/websharks/phings/blob/160410/src/psr4/targets.xml#L21 |
@jaswsinc writes...
I think you're making my point. The
EDIT: See next comment.
Hmm, yeah. That recursion is confusing. It's not that big of a deal. I already knew about the recursion, but it always takes me some extra time to think about the program flow when I'm doing something to the Lite build process. I'll open a GitHub issue so that we can look into separating out the |
Umm, LOL. Here I go again, agreeing with you and then immediately reversing course in my next comment. @jaswsinc writes...
That is not correct. As it stands right now, the Here's why: The
At that point, we have a fresh set of unmodified files from the repo directory in our Comet Cache Lite staging area, files that have not been affected by the Pro build process and therefore have not yet been touched by So, when we run To confirm all of this you can run a test with the way things are now and you'll see. After running a
So, I'm back to feeling that nothing needs to change in this PR. 😄 |
@jaswsinc In d36924d I updated the We're discussing in wpsharks/phings#76 how the By simply having the If you checkout this |
Right. This looks great to me. |
See wpsharks/comet-cache#709