SkillAgentSearch skills...

ESOpenSourceLicensesKit

A script to generate an HTML file of all the license files used with your CocoaPods Project

Install / Use

/learn @goodnewsnl/ESOpenSourceLicensesKit
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Build Platform Version Quality

ESOpenSourceLicensesKit

Requires Xcode 7.0 and Swift 2.0

A script to automatically generate an HTML file of all the license files used with your CocoaPods Project

Example

See example-output.html for an example output

Usage

CocoaPods

Add the following lines to your PodFile:

pod 'ESOpenSourceLicensesKit'

post_install do |installer_representation|
    system("ruby Pods/ESOpenSourceLicensesKit/ESOpenSourceLicensesKit/Scripts/generate_licenses.rb --post_install")
end

Run pod update or pod install

Swift

And then open a ESOpenSourceLicensesViewController:

import ESOpenSourceLicensesKit
        
let vc = ESOpenSourceLicensesViewController()
let navvc = UINavigationController(rootViewController: vc)
self.presentViewController(navvc, animated: true) { _ in
    
}

Objective-c (not recommended)

Make a swift / objc bridge.

And then open a ESOpenSourceLicensesViewController:

#import <ESOpenSourceLicensesViewController.h>

ESOpenSourceLicensesViewController *vc = [ESOpenSourceLicensesViewController new];
UINavigationController *navVc = [[UINavigationController alloc] initWithRootViewController:vc];
[self presentViewController:navVc animated:YES completion:nil];

Manual

Remember that the project depends on CocoaPods. Because it searches for LICENSE files within the Pods directory. But if you prefer not to use this pod, you can manually call the bash script from your terminal:

cd /Path/to/xcode-workspace/
ruby ./generate_licenses.rb --input licenses.html

Then drag/drop the licenses.html file to your project and you can use it to load in a UIWebView

Customization

let openSourceView = ESOpenSourceLicensesView()
openSourceView.licenseBackgroundColor = UIColor.blackColor()
openSourceView.licenseTextColor = UIColor.whiteColor()

Todo

  • [x] CocoaPods
  • [x] Customization of the ESOpenSourceLicensesKit
  • [x] Swift 1.2
  • [x] Swift 2.0
  • [ ] A .plist file of all the licenses
  • [ ] An array representation of the license files
View on GitHub
GitHub Stars14
CategoryDevelopment
Updated4y ago
Forks8

Languages

Swift

Security Score

75/100

Audited on Apr 14, 2021

No findings