Skip to content

apsoftwareservice/solitics-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solitics-Packge

A Wrapper Package for Solitics Swift SDK.


Overview

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.

Table of Contents

  1. JFrog Configuration

  2. Usage

  3. Support


JFrog Configuration

  • Keychain Authentication

For authentication with the private JFrog Swift Registry, you need to set up an internet password in your keychain. Follow these steps:

  1. Open Keychain Access on your macOS.
  2. Click on File > New Password Item.

    Alt Text

  3. Enter the following details:
  • Set Registry

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.swift file and can be deleted after the registry has been set.
  1. Open Terminal
  2. Navigate to your project directory
cd ~/MyAppDirectory/
  1. Create a dummy 'Package.swift' file (if non exist)
touch ./Package.swift
  1. Use the following command to set the registry
  • If you want to add the registry for every project add the --global flag
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.json

or if used the --global flag

vi ~/.swiftpm/configuration/registries.json

You should see the following content:

{
  "authentication" : {

  },
  "registries" : {
    "[default]" : {
      "supportsAvailability" : false,
      "url" : "https://soliticsmobilesdk.jfrog.io/artifactory/api/swift/"
    }
  },
  "version" : 1
}

To exit enter :qa!

  1. This step only applies to if you created a dummy Package.swift
rf -rf Package.swift

Usage

  • Pulling the package using SPM

To add a .git repository to your Xcode project, follow these steps:

  1. Open Xcode and navigate to your project.

  2. Select your project in the Project Navigator.

  3. Click on "Swift Packages" tab.

  4. Click on the "+" button to add a new package.

  5. Enter the repository URL: https://github.com/solitics/solitics-package.

    Alt Text

  6. Choose a 'Dependency Rule' and select your target if not selected.

  7. Click 'Add Pacakge'

    Alt Text

  8. 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.

  9. You should now see the Solitics Package on the left side bar, navigate to your project target and make sure the SoliticsSwiftPackage is present in Frameworks, Libraries, and Embedded Content Alt Text

  10. If its not present, click the + button and add from the manu Alt Text


Support

  • Troubleshoot

When trying to add the Solitics .git repository

  1. 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
  2. When adding the swift package you are promoted with an error no registry configured for 'swift' scope. Alt Text 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:

  1. Clean you derived data folder,and build folder.
  2. Close xcode completly and reopen.

If this does not help, try re-adding the registry. Set Registry

About

Solitics SPM Package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages