SoliticsSDK relies on JFrog Artifactory to host its framework. The registry, in this case, is private and can only be accessed through JFrog authentication. To integrate SoliticsSDK seamlessly, setting the registry for Swift Package Manager becomes essential. This readme will guide you in the process of gaining access to it.
-
- Troubleshoot
- Contact Us ###### TODO
For authentication with the private JFrog Swift Registry, you need to set up an internet password in your keychain. Follow these steps:
- Open Keychain Access on your macOS.
- Click on File > New Password Item.
- Enter the following details:
- Name: https://soliticsmobilesdk.jfrog.io
- Account Name: [Your Email]
- Password: [Your Password]
Add the password, and the SPM will use it for authentication with jfrog.
Swift Package Manager points to a default registry. In the following steps, we will point the registry to Solitics Artifactory instead.
A few side notes to consider before procedding:
- You can either set the registry per Xcode project, meaning only that project will have access to the registry, while others won't. Or globally, meaning every project will have access to it. Either way, there is a fallback that should point back to the default registry when a package is not found.
- Changing the registry requires a
Package.swiftfile and can be deleted after the registry has been set.
- Open Terminal
- Navigate to your project directory
cd ~/MyAppDirectory/- Create a dummy 'Package.swift' file (if non exist)
touch ./Package.swift- Use the following command to set the registry
- If you want to add the registry for every project add the
--globalflag
swift package-registry set "https://soliticsmobilesdk.jfrog.io/artifactory/api/swift/"If you want to double check the command succeeded run the following command
vi ./.swiftpm/configuration/registries.jsonor if used the --global flag
vi ~/.swiftpm/configuration/registries.jsonYou should see the following content:
{
"authentication" : {
},
"registries" : {
"[default]" : {
"supportsAvailability" : false,
"url" : "https://soliticsmobilesdk.jfrog.io/artifactory/api/swift/"
}
},
"version" : 1
}To exit enter :qa!
- This step only applies to if you created a dummy
Package.swift
rf -rf Package.swiftTo add a .git repository to your Xcode project, follow these steps:
-
Open Xcode and navigate to your project.
-
Select your project in the Project Navigator.
-
Click on "Swift Packages" tab.
-
Click on the "+" button to add a new package.
-
Enter the repository URL: https://github.com/solitics/solitics-package.
-
Choose a 'Dependency Rule' and select your target if not selected.
-
Xcode will ask you to enter the password for the keychain we added above, once granted Xcode will fetch the repository and add it to your project.
-
You should now see the Solitics Package on the left side bar, navigate to your project target and make sure the
SoliticsSwiftPackageis present inFrameworks, Libraries, and Embedded Content
-
If its not present, click the
+button and add from the manu
When trying to add the Solitics .git repository
- After setting the Keychain password xcode does not ask you to authenticate the jfrog registry, this means you didnot configure the password correctly and should try the steps agian. Keychain Authentication
- When adding the swift package you are promoted with an error
no registry configured for 'swift' scope.
Either xcode holds an old registry cache and we need to force update it, or you didnt add the registry correctly,
first lets try to force update the registry:
- Clean you derived data folder,and build folder.
- Close xcode completly and reopen.
If this does not help, try re-adding the registry. Set Registry
