Skip to content

Commit

Permalink
Repair SPM support; fix Xcode warnings; bump minimal deployment targe…
Browse files Browse the repository at this point in the history
…t to iOS 9.0; update CI&CD
  • Loading branch information
Aleksandr Zhuhan committed Feb 4, 2021
1 parent 5f213c1 commit daaed2a
Show file tree
Hide file tree
Showing 16 changed files with 210 additions and 66 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CD

on:
release:
types:
- created

jobs:
build:

runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- name: Deploy to Cocoapods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
set -eo pipefail
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
pod lib lint --allow-warnings
pod trunk push --allow-warnings
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- name: SPM build
run: swift build

- name: Lint Podspec
run: |
set -eo pipefail
pod lib lint --allow-warnings --use-libraries
- name: Carthage update
run: ./scripts/carthage.sh build --platform "ios,macos" --no-skip-current
19 changes: 0 additions & 19 deletions .github/workflows/main.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,17 @@ DerivedData
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# 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
.build/
.swiftpm/

### OSX ###
.DS_Store
.AppleDouble
Expand Down
8 changes: 5 additions & 3 deletions Examples/iOS Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 1030;
LastUpgradeCheck = 1230;
ORGANIZATIONNAME = "9elements GmbH";
TargetAttributes = {
2BF4D77A1AF11E2E00C801B2 = {
Expand Down Expand Up @@ -267,6 +267,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -292,7 +293,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -324,6 +325,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -342,7 +344,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
76 changes: 72 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,86 @@
// swift-tools-version:5.1
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "imglyKit",
defaultLocalization: .resolved(),
platforms: [
.iOS(.v8),
.macOS(.v10_10)
.iOS(.v9), .macOS(.v10_10),
],
products: [
.library(
name: "imglyKit",
targets: ["imglyKit"]
)
],
dependencies: []
dependencies: [],
targets: [
.target(
name: "imglyKit",
dependencies: ["imglyKit-ObjC"],
path: "imglyKit",
exclude: Exclude.resolved(),
resources: Resource.resolved()
),
.target(
name: "imglyKit-ObjC",
path: "imglyKit/Backend/Processing/ObjC",
publicHeadersPath: ""
)
]
)

private extension LanguageTag {
static func resolved() -> LanguageTag? {
#if os(iOS)
return .init("en")
#elseif os(macOS)
return nil
#endif
}
}

private enum Exclude {
static func common() -> [String] {
[
"Supporting Files",
"Backend/Processing/ObjC"
]
}

static func platform() -> [String] {
#if os(iOS)
return []
#elseif os(macOS)
return [
"Frontend",
]
#endif
}

static func resolved() -> [String] {
common() + platform()
}
}

private extension Resource {
static func common() -> [Self] {
[
.process("Backend/Filter Responses"),
.process("Backend/Fonts")
]
}

static func platform() -> [Self] {
#if os(iOS)
return []
#elseif os(macOS)
return []
#endif
}

static func resolved() -> [Self] {
common() + platform()
}
}
Loading

0 comments on commit daaed2a

Please sign in to comment.