Skip to content

Commit

Permalink
upgrade release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
lexrus committed Sep 24, 2020
1 parent f1a2524 commit 4b35da9
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Xcode
#
build/
.build/
Carthage/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0
5.3
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--disable blankLinesAroundMark,blankLinesAtStartOfScope
--patternlet inline
--stripunusedargs closure-only
--swiftversion 5.0
--swiftversion 5.3
--wraparguments beforefirst
--wrapcollections beforefirst
4 changes: 2 additions & 2 deletions MonkeyKing.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MonkeyKing"
s.version = "1.16.0"
s.version = "1.17.0"
s.summary = "MonkeyKing helps you to post messages to Chinese Social Networks, or do OAuth and Payment."

s.description = <<-DESC
Expand All @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.authors = { "nixzhu" => "[email protected]" }
s.social_media_url = "https://twitter.com/nixzhu"

s.ios.deployment_target = "8.0"
s.ios.deployment_target = "9.0"
s.swift_version = '5.0'

s.source = { :git => "https://github.com/nixzhu/MonkeyKing.git", :tag => s.version }
Expand Down
36 changes: 22 additions & 14 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "MonkeyKing",
platforms: [
.iOS(.v8),
.iOS(.v9),
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "MonkeyKing",
name: "MonkeyKingStatic",
type: .static,
targets: ["MonkeyKingSource"]
),
.library(
name: "MonkeyKingDynamic",
type: .dynamic,
targets: ["MonkeyKingSource"]
),
.library(
name: "MonkeyKingXCFramework",
targets: ["MonkeyKing"]
),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "MonkeyKing",
dependencies: []
name: "MonkeyKingSource",
path: "Sources/MonkeyKing"
),
.testTarget(
name: "MonkeyKingTests",
dependencies: ["MonkeyKing"]
dependencies: ["MonkeyKing"],
path: "Tests/MonkeyKingTests"
),
.binaryTarget(
name: "MonkeyKing",
url: "https://github.com/nixzhu/MonkeyKing/releases/download/pre-1.17.0/MonkeyKing.xcframework.zip",
checksum: "1b4fafe9b3c438c7fe9f3490a5b4194baad0cb70c20ee374e0fb86326ee0e283"
)
]
)
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MonkeyKing also supports **OAuth** and **Mobile payment** via WeChat and Alipay!

## Requirements

Swift 5, iOS 8
Swift 5, iOS 9

(For Swift 4.2, use version 1.13.0)

Expand Down Expand Up @@ -175,6 +175,12 @@ github "nixzhu/MonkeyKing"
pod 'MonkeyKing'
```

### Swift Package Manager

```
https://github.com/nixzhu/MonkeyKing
```

## Contributors

Thanks to all the [contributors](https://github.com/nixzhu/MonkeyKing/graphs/contributors).
Expand Down
27 changes: 27 additions & 0 deletions Scripts/carthage_workaround.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# carthage-build.sh
# Usage example: ./carthage-build.sh --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
# Xcode 12 GM (12A7209)
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_12A7209 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig

echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"

rm -rf Carthage/Build

carthage build --no-skip-current --platform iOS

cd Carthage/Build && zip -vry MonkeyKing.Carthage.framework.zip ./ -x "*.DS_Store"

open .
30 changes: 30 additions & 0 deletions Scripts/xcframework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

xcodebuild archive -project "China.xcodeproj" \
-scheme "MonkeyKing" -configuration Release \
-sdk iphonesimulator \
-archivePath "build/MonkeyKing/Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild archive -project "China.xcodeproj" \
-scheme "MonkeyKing" -configuration Release \
-sdk iphoneos \
-archivePath "build/MonkeyKing/iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild -create-xcframework \
-framework build/MonkeyKing/Simulator.xcarchive/Products/Library/Frameworks/MonkeyKing.framework \
-framework build/MonkeyKing/iOS.xcarchive/Products/Library/Frameworks/MonkeyKing.framework \
-output build/MonkeyKing.xcframework

cd Build && find . -name "*.swiftinterface" -exec sed -i -e 's/MonkeyKing\.MonkeyKing/MonkeyKing/g' {} \;

zip -vry MonkeyKing.xcframework.zip MonkeyKing.xcframework/ -x "*.DS_Store"

echo "\n-----"
swift package compute-checksum MonkeyKing.xcframework.zip
echo "-----"

open .

0 comments on commit 4b35da9

Please sign in to comment.