Comments (10)
@BartoszCichecki Thanks for the report. This is happening because there is a package listed in your Project.xcodeproj
that is missing from your Package.resolved
so the plugin has nothing to check against. Do you know why this might be the case for your project? If you are able to put up an example repo I can take a look as well.
In the meantime, this crash has been fixed in 0.1.2 and a warning will print to your console or CI logs identifying the missing package.
from danger-spm_version_updates.
Thanks for quick response. I updated to 0.1.2 and it doesn't crash, but it prints quite a bit of warnings now for what looks to be all packages. For example:
Unable to locate the current version for adjust/ios_sdk (https://github.com/adjust/ios_sdk) in Project.xcworkspace/xcshareddata/swiftpm/Package.resolved
and when I check the Package.resolved
file, I can find the version:
{
"package": "Adjust",
"repositoryURL": "https://github.com/adjust/ios_sdk",
"state": {
"branch": null,
"revision": "a7b50f187855dfc0fb84114c22661216393387ae",
"version": "4.32.1"
}
},
Danger is configured like this:
# SPM Version Updates
spm_version_updates.check_when_exact = true
spm_version_updates.report_above_maximum = true
spm_version_updates.check_for_updates("Project.xcodeproj")
Both dangerfile, Project.xcodeproj and Project.xcworkspace are in the root dir of the repo. Path to Package.resolved is also correct.
Maybe the parsing of Package.resolved is failiing? Let me know what info you need.
from danger-spm_version_updates.
Hmm, I'm guessing this is due to how Xcode mangles repo URLs. Can you look at the Adjust URL in Project.xcodeproj/project.xcodeproj
?
from danger-spm_version_updates.
4153F63E28FD5048003BEEA3 /* XCRemoteSwiftPackageReference "ios_sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/adjust/ios_sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.29.0;
};
};
from danger-spm_version_updates.
In addition to having a Project.xcworkspace/xcshareddata/swiftpm/Package.resolved
do you also have a Project.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
file? (note in the second path project.xcworkspace
is always that name regardless of your actual project name).
Digging around I came across this link https://stackoverflow.com/a/71721448 which suggests there may be multiple .resolved files in projects that use both SPM and CocoaPods. (According to Apple the .xcodeproj form is canonically correct https://developer.apple.com/documentation/xcode/building-swift-packages-or-apps-that-use-them-in-continuous-integration-workflows#Use-the-expected-version-of-a-package-dependency )
I'll release a new version soon to handle this issue and the URL mangling cases, and also add more debug logging. In the meantime you can email me your Package.resolved if you're comfortable with that Harold . Martin @ gmail
from danger-spm_version_updates.
Working on addressing the multiple resolved files in #2
Will follow-up on the URL issue in another PR
from danger-spm_version_updates.
Addressing URL issue in #3
from danger-spm_version_updates.
In addition to having a Project.xcworkspace/xcshareddata/swiftpm/Package.resolved do you also have a Project.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved file? (note in the second path project.xcworkspace is always that name regardless of your actual project name).
There is only 1 packaged resolved file: Project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Also tested 1.3 with exactly the same result.
from danger-spm_version_updates.
I think we're finally on the verge of solving this... does your Package.resolved have "version": 1
?
If so it's not currently supported... but working on it now should be done tomorrow
from danger-spm_version_updates.
Yes! Thanks! 👏
from danger-spm_version_updates.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from danger-spm_version_updates.