Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into snoozemouse-master
Browse files Browse the repository at this point in the history
  • Loading branch information
pcantrell committed Oct 23, 2021
2 parents 9e95302 + 89b6cee commit 0c58c4a
Show file tree
Hide file tree
Showing 90 changed files with 1,217 additions and 1,179 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/swiftpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ master ]

jobs:
run_tests:
test:

runs-on: macos-latest

Expand Down
113 changes: 113 additions & 0 deletions .github/workflows/xcode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Xcode regression tests

on:
push:
branches: [ $default-branch, main, master, ci-experiments ]
pull_request:
branches: [ $default-branch, main, master ]

jobs:
test:

runs-on: macos-latest

strategy:
matrix:
include:

- scheme: 'Siesta macOS'
platform: 'OS X'

- scheme: 'Siesta iOS'
platform: 'iOS Simulator'
sim_os: 'iOS'
sim_os_version: 14.4
sim_device: 'iPhone 11 Pro'
xcode_sim_version: 12.4

- scheme: 'Siesta iOS'
platform: 'iOS Simulator'
sim_os: 'iOS'
sim_os_version: 13.7
sim_device: 'iPhone SE'
xcode_sim_version: 11.7

- scheme: 'Siesta iOS'
platform: 'iOS Simulator'
sim_os: 'iOS'
sim_os_version: 12.4
sim_device: 'iPhone 6'
xcode_sim_version: 10.3.0

- scheme: 'Siesta tvOS'
platform: 'tvOS Simulator'
sim_os: 'tvOS'
sim_os_version: 14.3
sim_device: 'Apple TV 4K 1080p'
xcode_sim_version: 12.4

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Set up environment
env:
scheme: ${{ matrix.scheme }}
platform: ${{ matrix.platform }}
sim_os: ${{ matrix.sim_os }}
sim_os_version: ${{ matrix.sim_os_version }}
sim_device: ${{ matrix.sim_device }}
xcode_sim_version: ${{ matrix.xcode_sim_version }}
run: |
set -x
echo "–––––– Available Xcode versions ––––––"
ls /Applications | grep Xcode
if [[ "$platform" =~ \ Simulator$ ]]; then
sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
sudo ln -s \
/Applications/Xcode_$xcode_sim_version.app/Contents/Developer/Platforms/iPhoneOS.platform/*/*/CoreSimulator/Profiles/Runtimes/$sim_os.simruntime \
/Library/Developer/CoreSimulator/Profiles/Runtimes/$sim_os\ $sim_os_version.simruntime
echo "–––––– Available runtimes ––––––"
xcrun simctl list runtimes
sim_os_version_minor=$(echo $sim_os_version | ruby -ne '$_ =~ /^(\d+\.\d+)/; puts $1') # spec below doesn't include patch version number
sim_simulator_udid=$(
xcrun simctl create "Siesta testing device" \
"com.apple.CoreSimulator.SimDeviceType.${sim_device// /-}" \
"com.apple.CoreSimulator.SimRuntime.${sim_os}-${sim_os_version_minor//./-}"
)
echo "–––––– Available devices after device create ––––––"
xcrun xctrace list devices 2>&1
echo "Prelaunching $sim_os simulator with UDID $sim_simulator_udid"
xcrun simctl boot $sim_simulator_udid
fi
git clone https://github.com/supermarin/xcpretty.git /tmp/xcpretty
- name: Build and test
env:
scheme: ${{ matrix.scheme }}
platform: ${{ matrix.platform }}
sim_os: ${{ matrix.sim_os }}
sim_os_version: ${{ matrix.sim_os_version }}
sim_device: ${{ matrix.sim_device }}
run: |
if [[ "$platform" =~ \ Simulator$ ]]; then
platform="$platform,OS=$sim_os_version,name=Siesta testing device"
fi
Siesta_TestMultipleNetworkProviders=1 \
xcodebuild test \
-project Siesta.xcodeproj \
-scheme "$scheme" \
-destination "platform=$platform" \
| /tmp/xcpretty/bin/xcpretty -c
buildresult=${PIPESTATUS[0]}
exit $buildresult
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
xcuserdata
.*cache*
*.log
Carthage/
.build
.swiftpm
Siesta.xcodeproj/xcshareddata/xcbaselines
Binary file removed .ios-dev-cert.p12
Binary file not shown.
106 changes: 0 additions & 106 deletions .travis.yml

This file was deleted.

Empty file removed Cartfile
Empty file.
9 changes: 0 additions & 9 deletions Cartfile.private

This file was deleted.

3 changes: 0 additions & 3 deletions Cartfile.resolved

This file was deleted.

24 changes: 12 additions & 12 deletions Docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ To a large extent, this is driven by user questions & requests. Please file issu

One high priority feature is the addition of standard [EntityCache](https://bustoutsolutions.github.io/siesta/api/Protocols/EntityCache.html) implementations, which will provide fast app start + _almost_ free offline access.

#### What if I’m still on Swift 2?
#### What if I’m still on an older version of Swift, and can’t build Siesta?

Use the `swift-2.2` or `swift-2.3` branch.
There are branches (e.g. `swift-2.2`) that mark versions of Siesta that work with older Swifts.

CocoaPods:

Expand All @@ -25,11 +25,19 @@ Carthage:
github "bustoutsolutions/siesta" "swift-2.2"
```

(Or substitute `swift-2.3` above.)
Look at the [list of project branches](https://github.com/bustoutsolutions/siesta/branches/all?query=swift-).


## Capabilities

#### Why doesn’t Siesta provide a typesafe `Resource<T>`?

One big future wish for Siesta is more static type safety when using custom transformers that map specific routes to specific model classes. Unfortunately, limitations of Swift’s generic type system prevent the seemingly obvious solution of a genericized `Resource<T>` from being workable in practice.

The missing feature is support for generalized existentials. There has been extensive discussion of this — there’s even a [manifesto](https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#generalized-existentials)! — but the problem has proved large and has been repeatedly deferred. That means we won’t be getting `Resource<T>` until some far future version of Swift.

In the meantime, [`typedContent(…)`](https://bustoutsolutions.github.io/siesta/api/Protocols/TypedContentAccessors.html#//apple_ref/swift/Method/typedContent(ifNone:)) and friends get the job done.

#### How do I do a backgrounded multipart request that switches to streaming mode while pulling a double shot of espresso?

Find a lower-level networking library. And a barista.
Expand All @@ -40,22 +48,14 @@ Siesta is a high-level library designed to make the common behaviors of REST ser

Use a lower-level networking library.

If you aren’t interested in holding a response entirely in memory, there’s little benefit to using Siesta. Siesta’s advantage over lower-level networking is the “parse once, share everywhere” nature of its observer architecture — which implies holding on to entire responses for reuse.
If you aren’t interested in holding a response entirely in memory, there’s little benefit to using Siesta. Siesta’s advantage over lower-level networking is the “parse once, share everywhere” nature of its observer architecture — which implies holding on to entire responses for reuse.

#### How do I control the number of concurrent requests? SSL validation? URLCache options?

Configure them in the underlying networking library you are using with Siesta.

From the time that it has constructed a request until the time it has a complete response, Siesta delegates all of its networking to the provider you specify. That is where all these options get configured. See the `networking:` parameter of [`Service.init(...)`](https://bustoutsolutions.github.io/siesta/api/Classes/Service.html#//apple_ref/swift/Method/init(baseURL:useDefaultTransformers:networking:)).

#### Why doesn’t Siesta provide a typesafe `Resource<T>`?

One big future wish for Siesta is more static type safety when using custom transformers that map specific routes to specific model classes. Unfortunately, limitations of Swift’s generic type system prevent the seemingly obvious solution of a genericized `Resource<T>` from being workable in practice.

The missing feature is support for generalized existentials. There has been extensive discussion of this — there’s even a [manifesto](https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#generalized-existentials)! — but the problem has proved large and has been repeatedly deferred. That means we won’t be getting `Resource<T>` until some far future version of Swift.

In the meantime, [`typedContent(…)`](https://bustoutsolutions.github.io/siesta/api/Protocols/TypedContentAccessors.html#//apple_ref/swift/Method/typedContent(ifNone:)) and friends get the job done.

## Contact

#### How do I ask a question that isn’t here?
Expand Down
2 changes: 1 addition & 1 deletion Examples/GithubBrowser/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Pods
Package.resolved
Loading

0 comments on commit 0c58c4a

Please sign in to comment.