-
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
Other target-dir remapping fixes #577
Other target-dir remapping fixes #577
Conversation
Use `startsWith` instead of `includes` to check for remapping of `target-dir` that starts with `libs` or `src/main` (Followup to PR apache#572)
@@ -303,13 +303,13 @@ function getInstallDestination (obj) { | |||
return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.substring(4), path.basename(obj.src)); | |||
} else if (obj.src.endsWith('.aidl')) { | |||
return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.substring(4), path.basename(obj.src)); | |||
} else if (obj.targetDir.includes('libs')) { | |||
} else if (obj.targetDir.startsWith('libs')) { |
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.
From PR #576: What if there is a character other than /
after libs
?
if (obj.src.endsWith('.so')) { | ||
return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.substring(5), path.basename(obj.src)); | ||
} else { | ||
return path.join('app', obj.targetDir, path.basename(obj.src)); | ||
} | ||
} else if (obj.targetDir.includes('src/main')) { | ||
} else if (obj.targetDir.startsWith('src/main')) { |
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.
From PR #576: What if there is a character other than /
after src/main
?
Codecov Report
@@ Coverage Diff @@
## master #577 +/- ##
=======================================
Coverage 62.11% 62.11%
=======================================
Files 17 17
Lines 1985 1985
Branches 371 371
=======================================
Hits 1233 1233
Misses 752 752
Continue to review full report at Codecov.
|
cordova-android/spec/unit/pluginHandlers/handlers.spec.js Lines 113 to 117 in f79eda4
|
Not true since |
@brodybits sorry I have read |
Use startsWith instead of
includes
to check for remapping oftarget-dir
that starts withlibs
orsrc/main
(Followup to PR #572)
Discovered while reviewing code related to change proposed in PR #576.
I think this is a very rare case that is not covered by the unit tests. I don't think we should delay 7.1.4 hotfix to get this fix in.
I am not sure whether or not it is worth the time to add unit tests to cover this edge case.Tests added, expected to be a rare edge case