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

Add support for 'alwaysOutOfDate' PBX Shell Script property #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marco-saia-datadog
Copy link

This PR adds support for the alwaysOutOfDate property in PBX Shell Scripts.

Setting alwaysOutOfDate to true disables dependency analysis for the given build phase, clearing warnings such as:

Script has ambiguous dependencies causing it to run on every build

Since by default the property is not added to the PBX project file by Xcode, I have decided to write it down in the PBX file only if explicitly specified in the pbxShellScriptBuildPhaseObj options, hence the null check.

@breautek
Copy link
Contributor

I think this is a good addition, and one that Cordova itself could probably use. I've enabled the CI tests which obviously requires some chore work since it's still configured to use NodeJS 10 (It's been years since this package had updates!)

I've added a 3.1.0 milestone so that this PR isn't forgotten for when we prepare the next release, though a 4.0.0 already exists so this feature might be added with the next major release instead of a minor release.

Code wise, I think is 👍 just the CI needs to be updated to use modern NodeJS versions and then this PR will need a rebase.

@marco-saia-datadog
Copy link
Author

Wonderful! Thank you @breautek 😃

@breautek
Copy link
Contributor

breautek commented Jul 2, 2024

Hey @marco-saia-datadog

If you could rebase this PR it should fix the CI for you.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.98%. Comparing base (c491d3a) to head (fe105da).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #143   +/-   ##
=======================================
  Coverage   89.97%   89.98%           
=======================================
  Files           6        6           
  Lines        2374     2376    +2     
=======================================
+ Hits         2136     2138    +2     
  Misses        238      238           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test this PR explicitly but did confirm that alwaysOutOfDate is a field that XCode (At least XCode 15 uses). 👍

alwaysOutOfDate is only ever assigned if the options value is not null. This means if the value is undefined, then obj.alwaysOutOfDate will also be undefined, matching old behaviour. If the value is explicitly set to null, then it will be left undefined on obj.alwaysOutOfDate. Any other value is passed through. 👍

I left a nitpick to use !== over != for mostly code consistency reasons.

I do have concerns about the test using boolean true when Xcode appears to use 1/0 values and I don't see any evidence that our pbxWriter will do this translation.

lib/pbxProject.js Outdated Show resolved Hide resolved
test/addBuildPhase.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants