Skip to content

Commit 4a61d6c

Browse files
authored
docs: structure SPM plugin changes and add missing step (ionic-team#439)
1 parent 85944b2 commit 4a61d6c

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

docs/main/ios/spm.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,29 @@ At this point you're done and can build and work as normal.
124124

125125
If your plugin only contains Swift aside from the required `[Name]Plugin.m` and `[Name]Plugin.h` you can use the [capacitor-plugin-converter](https://github.com/ionic-team/capacitor-plugin-converter).
126126

127-
This tool will add the following required things to your main swift plugin file, `[Name]Plugin.swift`:
128-
129-
- Add Conformance to the `CAPBridgedPlugin` protocol to your class
130-
- Add 3 variables to your class. `identifier`, `jsName`, and `pluginMethods`
131-
- `identifer` will correspond to the first argument to the `CAP_PLUGIN` macro
132-
- `jsName` will correspond to the second argument to the `CAP_PLUGIN` macro
133-
- `pluginMethods` will be an array of the methods passed to the `CAP_PLUGIN` macro
127+
This tool will do the following changes:
128+
129+
- Add the following required things to your main swift plugin file, `[Name]Plugin.swift`:
130+
- Add Conformance to the `CAPBridgedPlugin` protocol to your class.
131+
- Add 3 variables to your class. `identifier`, `jsName`, and `pluginMethods`:
132+
- `identifer` will correspond to the first argument to the `CAP_PLUGIN` macro.
133+
- `jsName` will correspond to the second argument to the `CAP_PLUGIN` macro.
134+
- `pluginMethods` will be an array of the methods passed to the `CAP_PLUGIN` macro.
135+
- A `Package.swift` file will be created at the root of your plugin folder.
134136
- The following files will be removed as they are no longer needed:
135137
- `Plugin.xcodeproj`
136138
- `Plugin.xcworkspace`
137139
- `Plugin/Info.plist`
138140
- `PluginTests/Info.plist`
139141
- `Podfile`
140-
- To fit SPM best practices, the Project files will be moved to `Sources` and `Tests` directories
141-
- The plugins `package.json` will get the following fixes:
142+
- To fit SPM best practices, the Project files will be moved to `Sources` and `Tests` directories.
143+
- The plugins `package.json` will get the following changes:
142144
- The files array will add these files or directories:
143145
- `ios/Sources`
144146
- `ios/Tests`
145147
- `Package.swift`
146148
- `verify:ios` will be changed to `xcodebuild -scheme YourPluginName -destination generic/platform=iOS` to allow it to continue to work as you expect.
147-
- Your plugin podspec will be changed so that `s.source_files` now points to the `Sources` directory rather than the `Plugin` directory
149+
- Your plugin podspec will be changed so that `s.source_files` now points to the `Sources` directory rather than the `Plugin` directory.
148150

149151

150152
See the documentation in the repository at [capacitor-plugin-converter](https://github.com/ionic-team/capacitor-plugin-converter) for more.

0 commit comments

Comments
 (0)