apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

feat: support extending export options #1210

Closed dertieran closed 1 year ago

dertieran commented 2 years ago

Motivation and Context

Support extending the exportOptions through the buildOpts.

Resolves #1209

Checklist

erisu commented 2 years ago

Code wise everything looks good.

Can you provide me your example build command on how you tested it. How you set a single or multiple export options.

This information needs to be added later to the Cordova docs so others understand how to use it.

dertieran commented 2 years ago

Not quite sure if this is what you mean, but I'm not using cordova through the cli. So I didn't provide a way to set the exportOptions through the cli, but I guess it could be added as an option to the build.json.

I tested it through my build script that looks something like this

const build = async function ({ release, platforms }) {
    const exportOptions = { uploadSymbols: !release };
    const options = { release, device: release, exportOptions };
    await cordova.build({ verbose: !release, platforms, options });
};

build({ release: true, platforms: ['ios'] });

This will then not include the .symbols in the produced .ipa file. This command should not print anything in that case (by default it does).

unzip -l platforms/ios/build/device/<app>.ipa | grep Symbols

Also as mentioned in the issue, right now the code does not allow to overwrite the defaults. Not sure if that would be a good idea or if it would break the whole build. 😅

I hope this helps, let me know if I can help with anything else.