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

ios.SPMPackages sets version to upToNextMajorVersion instead of exactVersion #5822

Closed
3 tasks done
zdtorok opened this issue Nov 28, 2024 · 4 comments
Closed
3 tasks done

Comments

@zdtorok
Copy link

zdtorok commented Nov 28, 2024

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.0

Dependencies

"dependencies": {},
"devDependencies": {
  "pre-push": "0.1.1"
}

Please accept these terms

@zdtorok zdtorok added the bug-pending-triage Reported bug, pending triage to confirm. label Nov 28, 2024
@rigor789
Copy link
Member

rigor789 commented Nov 28, 2024

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

@rigor789 rigor789 added known limitation in progress and removed bug-pending-triage Reported bug, pending triage to confirm. labels Nov 28, 2024
@zdtorok
Copy link
Author

zdtorok commented Nov 29, 2024

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!

@rigor789
Copy link
Member

Thanks for testing! I can get that released in the next few days - though also feel free to use the next tag until then.

@rigor789
Copy link
Member

rigor789 commented Dec 3, 2024

@rigor789 rigor789 closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants