Skip to content

Instantly share code, notes, and snippets.

@YutoMizutani
Last active September 2, 2018 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YutoMizutani/7ccf98cc7ff67d012f178d679ef183b9 to your computer and use it in GitHub Desktop.
Save YutoMizutani/7ccf98cc7ff67d012f178d679ef183b9 to your computer and use it in GitHub Desktop.
複数OSに対応したSwift oss library作成チュートリアル ref: https://qiita.com/YutoMizutani/items/20ed0ae2558dbd69f463
github "ReactiveX/RxSwift" ~> 4.0
ExampleApp/
 ├ ExampleApp.xcodeproj/
 ├ ExampleApp.xcworkspace/
 ├ ExampleApp/
 └ Podfile
RxBluetoothKit.xcodeproj/
Source/
Tests/
 └ Info.plist
docs/
 └ index.html
scripts/
 └ all-tests.sh
.gitignore
.jazzy.yaml
.swift-version
.swiftlint.yml
.travis.yml
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
RxBluetoothKit.podspec
$ mkdir <foo>
$ cd <foo>
$ git init
$ git flow init
$ carthage update
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
Carthage/
.build/
.gitignore
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
ExampleApp/
 ├ ExampleApp.xcodeproj/
 └ ExampleApp/
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
Carthage/
.build/
.gitignore
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
$ pod spec create <foo>
ExampleApp/
 ├ ExampleApp.xcodeproj/
 ├ ExampleApp.xcworkspace/
 ├ ExampleApp/
 └ Podfile
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
Carthage/
.build/
.gitignore
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
<foo>.podspec
$ echo 4.0 > .swift-version
$ [sudo] gem install jazzy
$ touch .jazzy.yml
$ jazzy -o docs
ExampleApp/
 ├ ExampleApp.xcodeproj/
 ├ ExampleApp.xcworkspace/
 ├ ExampleApp/
 └ Podfile
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
docs/
 └ index.html
Carthage/
.build/
.jazzy.yml
.swift-version
.gitignore
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
<foo>.podspec
$ brew install swiftlint
$ touch .swiftlint.yml
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
ExampleApp/
 ├ ExampleApp.xcodeproj/
 ├ ExampleApp.xcworkspace/
 ├ ExampleApp/
 └ Podfile
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
docs/
 └ index.html
Carthage/
.build/
.jazzy.yml
.swift-version
.swiftlint.yml
.gitignore
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
<foo>.podspec
$ touch .travis.yml
$ mkdir scripts
$ touch ./scripts/all-tests.sh
ExampleApp/
 ├ ExampleApp.xcodeproj/
 ├ ExampleApp.xcworkspace/
 ├ ExampleApp/
 └ Podfile
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
docs/
 └ index.html
Carthage/
.build/
.jazzy.yml
.swift-version
.swiftlint.yml
.gitignore
.travis.yml
Cartfile
Cartfile.private
Cartfile.resolved
LICENSE
Package.swift
README.md
<foo>.podspec
$ swift package init --type library
Source/
 └ <foo>/
  └ test.swift
Tests/
 ├ <foo>Tests/
 │ ├ <foo>Tests.swift
 │ └ XCTestManifests.swift
 └ LinuxMain.swift
.gitignore
Package.swift
README.md
$ swift build
$ swift package generate-xcodeproj
<foo>.xcodeproj/
Source/
 └ <foo>/
   └ test.swift
Tests/
 └ <foo>Tests/
   └ <foo>Tests.swift
.build/
.gitignore
LICENSE
Package.swift
README.md
<foo>.xcodeproj/
Source/
 ├ <foo>/
 │ └ <foo>.swift
 └ Info.plist
Tests/
 ├ <foo>Tests/
 │ └ <foo>Tests.swift
 └ Info.plist
.build/
.gitignore
LICENSE
Package.swift
README.md
$ brew install carthage
$ touch Cartfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment