Manual to SPM integration
Migration From Normal Frameworks to Swift Package Manager
if you are integrating the SPM for first time, then follow the below steps or else you can skip this part and go directly upgrade documents
You can watch the video explanation as well here on migration
https://drive.google.com/file/d/1FSBcRMewwo_-zgXzhP0f7hsKmVjAvuRv/view?usp=sharing
Step 1: Navigate to Package Dependencies in Xcode
- Open your project in Xcode.
- In the Project Navigator, select the Project (not a specific target).
- Click on the Package Dependencies tab.
Step 2: Add a New Package
-
In the Package Dependencies tab, click the + button.
-
A popup will appear. In the Search or enter package URL field at the top-right, enter the following URL:
Then please enter the below URL
https://nucleijenkinsbot:<token>@github.com/CDNA-Technologies/nuclei-ios-sdk-frameworks
Note: Please contact the Nuclei Team for the token to access the repository.
Step 3: Fetch the Package and Choose Version
-
After entering the URL, Xcode will fetch the repository and show the latest release.
-
In the Dependency Rule section, select Exact Version from the dropdown.
-
If the Nuclei team has specified a version, enter it. Otherwise, leave it to default, which will pull the latest release.
-
Click Add Package to proceed.
Step 4: Select Modules to Add
-
After adding the package, you will be prompted to select modules.
-
Ensure that you select Nuclei Core for your main target. If you have multiple targets, you can add it to the others later.
Important: Only add Native Categories if necessary. If a category is implemented in Svelte, you don’t need to add its native module—Nuclei Core will handle Svelte integrations automatically.
-
-
Avoid adding unnecessary modules to prevent increasing your app size.
-
Step 5: Complete the Integration
-
After selecting the necessary modules, click Add Package.
-
Xcode will take a moment to load the package configurations.
-
Once done, you can see the Nuclei SDK under Package Dependencies in the Project Navigator, along with the specified version.
-
You’re all set! Now, build your project to complete the integration.
You can look at the side project navigator you can see the package dependies of stating nuclei and it's version
Step 6 (If Necessary): Add Modules to Other Targets
-
If you need to add Nuclei categories to other targets, navigate to Target Settings in your project.
-
In the General tab, scroll down to Frameworks, Libraries, and Embedded Content.
-
Click the + button and search for the specific category module you need to add.
-
Select it and repeat as necessary for other targets.
By following these steps, you should be able to smoothly integrate the Nuclei SDK into your iOS project using Swift Package Manager. Let us know if you have any questions or run into any issues!
NOTE: The Nuclei Core bundle should be there in Frameworks, Libraries and Embedded Content, or else any Nuclei Categories won't work
If any native category was there, please add those categories bundles only adding others will increase size of the app