Skip to content

Commit

Permalink
Merge pull request #8 from nextbike/feat/SPM-support
Browse files Browse the repository at this point in the history
feat: Support Swift Package Manager
  • Loading branch information
jonasvogel authored Jul 19, 2023
2 parents e29e460 + deb6fb0 commit b311219
Show file tree
Hide file tree
Showing 20 changed files with 176 additions and 569 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Swift

on: [push]

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v1
with:
swift-version: "5.8.0"
- name: Build
run: swift build
- name: Run tests
run: swift test
90 changes: 89 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,90 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "phrase-swift",
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "PhraseSwift",
targets: ["PhraseSwift"]),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "PhraseSwift"),
.testTarget(
name: "PhraseSwiftTests",
dependencies: ["PhraseSwift"]),
]
)
18 changes: 6 additions & 12 deletions PhraseSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,23 @@

Pod::Spec.new do |s|
s.name = 'PhraseSwift'
s.version = '0.1.3'
s.version = '1.0.0'
s.summary = 'A swift port of Squares Phrase library.'

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!

s.description = <<-DESC
TODO: Add long description of the pod here.
Use curly bracket placeholders within strings and be able to use the same localization phrases as on Android.
DESC

s.homepage = 'https://github.com/nextbike/phrase-swift'
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
s.author = { 'Jan Meier' => 'meier@nextbike.com' }
s.author = { 'Jonas Vogel' => 'vogel@nextbike.com' }
s.source = { :git => 'https://github.com/nextbike/phrase-swift.git', :tag => s.version.to_s }

s.ios.deployment_target = '8.0'

s.swift_versions = ['4', '5']
s.swift_versions = ['5']

s.source_files = 'PhraseSwift/PhraseSwift/*.swift', 'PhraseSwift/PhraseSwift/Extensions/*.swift'
s.source_files = 'Sources/PhraseSwift/*.swift', 'Sources/PhraseSwift/Extensions/*.swift'

s.frameworks = 'UIKit'
s.frameworks = 'Foundation'
end
Loading

0 comments on commit b311219

Please sign in to comment.