You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of Swift 3, the language ships with SPM. For core-plot to support this mechanism, it would require:
Creating a Package.swift file to describe the module name, dependencies, exclusion etc...
Creating one or more module.modulemap files to map .h files to swift modules
This seems easy enough but the tricky part is with the multi-platform (OSX, iOS, tvOS) support with different includes, and possibly with file hierarchy.
According to the current package manager docs, "Note that at this time the Package Manager has no support for iOS, watchOS, or tvOS platforms." I'll see if I can get it working for the Mac, but we'll need to revisit this issue when support for other platforms is added.
I got the dependency part to work (core-plot being a dependency of a test project), e.g. "swift build" checking out the correct version (note: you need to tag a commit with strict semantic versioning e.g. 2.2.0 for this to work). The Package.swift of the parent project:
I hit a wall with the module.modulemap business. I tried using a single module.modulemap file and just import the global header (CorePlot-CocoaTouch.h in this case) but it would not compile.
I guess you would need either a more elaborate map, see the Swift Clang doc on Modules and modulemap grammar or one modulemap per .h file or group of .h files. Unfortunately, I do not understand the inner workings of core-plot, so understanding the cause was beyond the time I could spend on this.
Let me know if I can help testing something.
Note: Our project is in Swift 3, so I was using Xcode 8 beta 6 with Apple Swift version 3.0 (swiftlang-800.0.43.6 clang-800.0.38).
I'm not sure the Core Plot project in its current form is compatible with the Swift Package Manager. It makes certain assumptions about the structure of the source directories that we do not follow. Also, Core Plot includes a Dtrace probe that needs to be compiled as part of the build process. I don't see any way to do that with the current version of the SPM.
The probe may no longer be needed and we can rearrange the source files if necessary, but those changes will need to wait until after the 2.2 release is out the door.
The probe was removed a while ago (before the 2.3 release). I haven't looked at the Swift package manager lately to see what else would be required to support it.
@eskroch Would it be possible to revisit this issue and give it a higher priority? SPM is now quite mature. Its major limitation was that it didn't support resources, but the latest version now does. Hence, more and more applications are going to adopt SPM. Thanks
I merged pull request #436 on the release-2.4 branch. It looks ok to me but I'd appreciate some help with testing. Please make general comments here or open a new issue if you find specific problems that can be addressed separately.
Created an empty SwiftPM-managed project and successfully added CorePlot 👍 So for a first SPM support, it looks good enough to me. Doesn't break anything existing, and if users switch to SPM and encounter problems, I think it's better to collect issues during their transition than not releasing this at all. There's only so much one can do without a huge maintainer staff.
Activity
eskroch commentedon Aug 30, 2016
According to the current package manager docs, "Note that at this time the Package Manager has no support for iOS, watchOS, or tvOS platforms." I'll see if I can get it working for the Mac, but we'll need to revisit this issue when support for other platforms is added.
stefanhp commentedon Sep 1, 2016
If you're interested, I played around in a branch on our fork: feature/swift-package-manager.
I got the dependency part to work (core-plot being a dependency of a test project), e.g. "swift build" checking out the correct version (note: you need to tag a commit with strict semantic versioning e.g. 2.2.0 for this to work). The Package.swift of the parent project:
I hit a wall with the module.modulemap business. I tried using a single module.modulemap file and just import the global header (CorePlot-CocoaTouch.h in this case) but it would not compile.
I guess you would need either a more elaborate map, see the Swift Clang doc on Modules and modulemap grammar or one modulemap per .h file or group of .h files. Unfortunately, I do not understand the inner workings of core-plot, so understanding the cause was beyond the time I could spend on this.
Let me know if I can help testing something.
Note: Our project is in Swift 3, so I was using Xcode 8 beta 6 with Apple Swift version 3.0 (swiftlang-800.0.43.6 clang-800.0.38).
eskroch commentedon Sep 3, 2016
Xcode automatically generates a module map when building the Core Plot framework:
eskroch commentedon Sep 15, 2016
I'm not sure the Core Plot project in its current form is compatible with the Swift Package Manager. It makes certain assumptions about the structure of the source directories that we do not follow. Also, Core Plot includes a Dtrace probe that needs to be compiled as part of the build process. I don't see any way to do that with the current version of the SPM.
The probe may no longer be needed and we can rearrange the source files if necessary, but those changes will need to wait until after the 2.2 release is out the door.
nidegen commentedon Feb 10, 2020
What is the status on this? If the probe is not needed, I think the source dir structure should not be much of a problem:)
eskroch commentedon Feb 12, 2020
The probe was removed a while ago (before the 2.3 release). I haven't looked at the Swift package manager lately to see what else would be required to support it.
slizeray commentedon Aug 5, 2020
@eskroch Would it be possible to revisit this issue and give it a higher priority? SPM is now quite mature. Its major limitation was that it didn't support resources, but the latest version now does. Hence, more and more applications are going to adopt SPM. Thanks
3a4oT commentedon Dec 10, 2020
Seems like the source files structure is a major problem
3a4oT commentedon Dec 12, 2020
My attempt to add it at #436 cc. @eskroch
eskroch commentedon Dec 13, 2020
I merged pull request #436 on the
release-2.4branch. It looks ok to me but I'd appreciate some help with testing. Please make general comments here or open a new issue if you find specific problems that can be addressed separately.3a4oT commentedon Dec 13, 2020
Thanks, @eskroch . #437 should fix one :)
DivineDominion commentedon Jan 22, 2021
Created an empty SwiftPM-managed project and successfully added CorePlot 👍 So for a first SPM support, it looks good enough to me. Doesn't break anything existing, and if users switch to SPM and encounter problems, I think it's better to collect issues during their transition than not releasing this at all. There's only so much one can do without a huge maintainer staff.
Example Package file: