apache / cordova-ios

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

Swift Package Manager support for CordovaLib #1154

Closed dpogue closed 2 years ago

dpogue commented 2 years ago

Platforms affected

iOS

Motivation and Context

This adds a Package.swift file to allow installing the CordovaLib library through Swift Package Manager.

This also cleans up our Cocoapods spec file to remove the need to explicitly list each header.

Description

Swift Package Manager requires all the public headers to be in an include folder, so all the headers from Classes/Public were moved to include/Cordova.

Also got rid of the precompiled header because SwiftPM doesn't know how to do that, and we were only precompiling Foundation and UIKit.

Xcode 13 also adds a new warning when framework headers are used with relative imports "myfile.h" rather than framework imports <myfile.h>. I've cleaned up the imports for all the public headers. (Note: some of the plugins use private headers, which must retain the relative import syntax)

Testing

Checklist

codecov-commenter commented 2 years ago

Codecov Report

Merging #1154 (fc931bf) into master (4c81363) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1154   +/-   ##
=======================================
  Coverage   74.86%   74.86%           
=======================================
  Files          13       13           
  Lines        1723     1723           
=======================================
  Hits         1290     1290           
  Misses        433      433           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4c81363...fc931bf. Read the comment docs.