ios.SPMPackages sets version to upToNextMajorVersion instead of exactVersion
zdtorok opened this issue · 4 comments
Issue Description
When I include an SPM dependency in the nativescript.config.ts file, I expect that it pulls down the exact version that I provide. Instead it inserts the dependency into the Xcode project as 'Up to Next Major Version' instead of 'Exact Version'.
When providing this:
ios: {
SPMPackages: [
{
name: 'arcgis-maps-sdk-swift',
libs: ['ArcGIS'],
repositoryURL: 'https://github.com/Esri/arcgis-maps-sdk-swift',
version: '200.5.0',
},
]
}
I expect the project to be generated like this:
repositoryURL = "https://github.com/Esri/arcgis-maps-sdk-swift";
requirement = {
kind = exactVersion;
version = 200.5.0;
};
Instead it is generated like this:
repositoryURL = "https://github.com/Esri/arcgis-maps-sdk-swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 200.5.0;
};
If this is the desired default behaviour, please provide an option to define this as an exact version.
Reproduction
Set in nativescript.config.ts:
ios: {
SPMPackages: [
{
name: 'arcgis-maps-sdk-swift',
libs: ['ArcGIS'],
repositoryURL: 'https://github.com/Esri/arcgis-maps-sdk-swift',
version: '200.5.0',
},
]
}
The generated Xcode project will contain the dependency as described above and will pull down version 200.5.1 instead of 200.5.0.
Relevant log output (if applicable)
No response
Environment
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Max
Shell: /bin/zsh
node: 22.1.0
npm: 9.6.3
nativescript: 8.7.2
# android
java: 11.0.21
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found
# ios
xcode: 16.0/16A242d
cocoapods: 1.15.2
python: 3.12.1
python3: 3.12.1
ruby: 3.3.5
platforms:
- DriverKit 24.0
- iOS 18.0
- macOS 15.0
- tvOS 18.0
- visionOS 2.0
- watchOS 11.0Dependencies
"dependencies": {},
"devDependencies": {
"pre-push": "0.1.1"
}Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct
I just refactored this bit to support semver ranges, will be published on nativescript@next soon, please give it a try and see if it works as expected.
Implemented in: ionic-team/trapeze@709173c
Available for testing in nativescript@8.8.2-next-11-28-2024-12073766705
Thank you @rigor789, I tested it and seems to be working fine. The above configuration produces now an 'Exact Version' rule which is what is needed.
Do you have an estimate when will it be released? I guess, in 8.8.3 but is that expected soon?
Thanks!
Thanks for testing! I can get that released in the next few days - though also feel free to use the next tag until then.
Released in 8.8.3: https://github.com/NativeScript/nativescript-cli/releases/tag/v8.8.3