-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix dest overwrite #539
Fix dest overwrite #539
Conversation
|
Unfortunately this proposal does not resolve the issue reported in #540. |
Thanks! I'd like to get this merged in. There's one other spot in |
I think so, would like to see unit test coverage to ensure it does not break again. Not sure if we need to do this in the hotfix. This fix is definitely needed in master as well. |
Supposedly, EDIT: Ah, shit, just noticed |
The update is only for the case when I think it should not break a supported case that is already working. If I am mistaken a specific example would be really helpful. |
Yeah, sorry, see my edit, the remap function should not return null, it should return the path unmodified, that’s why I thought it will break it as I only checked the changes, once I checked the code I noticed that was missing |
@jcesarmobile I didn't want to introduce too many changes to the codebase. Passing in the existing dest and returning it doesn't make sense to me. I think if anything we should check if the path needs to be modified and then call |
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.
Looks good to me, but send the PR to master and we will cherry pick
for Java source only (GH-539) Co-Authored-By: Christopher J. Brody <[email protected]> Co-Authored-By: Kyle Kirbatski <[email protected]>
I just pushed changes to add unit test and fix the issue in case of uninstall. Unfortunately I am not able to rebase this fix onto master since the code in master seems to assume that it always has Android Studio mapping. I will investigate a possible solution. |
for Java source only (apacheGH-539) Co-Authored-By: Christopher J. Brody <[email protected]> Co-Authored-By: Kyle Kirbatski <[email protected]>
Fallback to old path mapping if no Android Studio path mapping exists Co-authored-by: Christopher J. Brody <[email protected]> Co-authored-by: Kyle Kirbatski <[email protected]>
@@ -34,7 +34,7 @@ var handlers = { | |||
// a later plugins release. This is for legacy plugins to work with Cordova. | |||
|
|||
if (options && options.android_studio === true) { | |||
dest = studioPathRemap(obj); | |||
dest = studioPathRemap(obj) || dest; |
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.
It is not possible to cherry-pick or rebase this change to work on master. This change will be clobbered by another solution that works more easily on master.
Fallback to old path mapping if no Android Studio path mapping exists (with minor change needed to work on for 7.1.x branch) Co-authored-by: Christopher J. Brody <[email protected]> Co-authored-by: Kyle Kirbatski <[email protected]>
I just pushed an update that would be much easier to cherry-pick between 7.1.x and master. Note that this update basically clobbers the change proposed by @kkirby in ed0991c. At this point I can think of 2 ways forward:
@jcesarmobile please tell me which way you want to proceed with this. I would like to express appreciation to @kkirby for pointing out the issue and contributing the unit test, even if we cannot use the originally proposed solution. |
I prefer the other one as it’s going to be easier to maintain in case we need more hot fixes before we have a 8.0.0 ready |
What do you mean by "the other one"? |
I just rebased on master (actually pushed the first 3 changes from PR #542 to resolve the original issue on master). Fix should be straightforward to cherry-pick on 7.1.x. @jcesarmobile please give final confirmation so that I can merge this one into master. |
P.S. If someone else does a squash merge, please keep the "Co-authored-by" comments from the commits to give due credit to both @kkirby and myself. |
The “other” was #542, but as you keep changing both I don’t know anymore |
@jcesarmobile I was hoping to close in on an approved solution for this one and #540, sorry I did not really understand you before. I would slightly favor keeping this one separate from #540 since they are two different problems. A final review of the changes I pushed would be really helpful as well. |
Closing now in favor of PR #542. I just put this change back onto the 7.1.x branch (including the original commits by @kkirby). I am closing this because the proposed change is only a partial solution for the issues we need to fix in #542, to resolve #540 and maybe some other issues with plugins using the old project structure. @kkirby will absolutely get co-author credit for the added test and solution for the case when |
for Java source only (apacheGH-539) Co-Authored-By: Christopher J. Brody <[email protected]> Co-Authored-By: Kyle Kirbatski <[email protected]>
Fallback to old path mapping if no Android Studio path mapping exists (with slight difference on 7.1.x branch) Co-authored-by: Christopher J. Brody <[email protected]> Co-authored-by: Kyle Kirbatski <[email protected]>
for Java source only (apacheGH-539) Co-Authored-By: Christopher J. Brody <[email protected]> Co-Authored-By: Kyle Kirbatski <[email protected]>
Fallback to old path mapping if no Android Studio path mapping exists (with slight difference on 7.1.x branch) Co-authored-by: Christopher J. Brody <[email protected]> Co-authored-by: Kyle Kirbatski <[email protected]>
for Java source only (apacheGH-539) Co-Authored-By: Christopher J. Brody <[email protected]> Co-Authored-By: Kyle Kirbatski <[email protected]>
Fallback to old path mapping if no Android Studio path mapping exists (with slight difference on 7.1.x branch) Co-authored-by: Christopher J. Brody <[email protected]> Co-authored-by: Kyle Kirbatski <[email protected]>
Now fixed in the latest patch release |
Platforms affected
Android
What does this PR do?
Makes sure that we don't overwrite the
target-dir
of asource-file
if the project base is android studio and thetarget-dir
is the proper install path and doesn't need to be re-mapped.What testing has been done on this change?
I've added a new unit test, confirmed the problem exists, fixed the issue and re-ran the tests.
Checklist
More details
Latest release (7.1.2) breaks our build. After investigation it appears that
source-file.install
handler was updated to extract the functionality of path remapping for android studio. However, if the path doesn't need to be remapped, the function returns undefined, thus updating dest to be undefined.Related lines
7a97fd7...7.1.2#diff-4f73e5f70cec312ae82aa7d023e3c88bR320
7a97fd7...7.1.2#diff-4f73e5f70cec312ae82aa7d023e3c88bR50
Resolution
Just change line 50 to
studioPathRemap(obj) || dest