Skip to content

Commit da0d065

Browse files
committed
Merge branch 'Swinject-master'
2 parents 54e73d8 + da247bf commit da0d065

File tree

86 files changed

+3929
-3224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3929
-3224
lines changed

.Package.Test.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/Pod Lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This is the First Workflow for Testing with Github Actions
2+
3+
name: Pod Lint
4+
on:
5+
push:
6+
branches: [ "master" ]
7+
pull_request:
8+
branches: [ "master" ]
9+
env:
10+
ENCODING: LC_CTYPE=en_US.UTF-8
11+
jobs:
12+
pod-lint:
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
- name: Linting PodSpec for Cocoapods
18+
run: export "${{ env. ENCODING }}" | pod lib lint
19+
shell: bash
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This is the First Workflow for Testing with Github Actions
2+
3+
name: Testing
4+
on:
5+
workflow_dispatch:
6+
env:
7+
PROJECT: Swinject.xcodeproj
8+
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
9+
jobs:
10+
test:
11+
runs-on: macos-10.15
12+
strategy:
13+
matrix:
14+
include:
15+
- platform-version: iOS
16+
DEST: "OS=14.4,name=iPhone 8"
17+
SCHEME: "Swinject-iOS"
18+
SDK: "iphonesimulator"
19+
ACTION: "test"
20+
PLATFORM: "iOS"
21+
- platform-version: macOS
22+
DEST: "arch=x86_64"
23+
SCHEME: "Swinject-macOS"
24+
SDK: "macosx"
25+
ACTION: "test"
26+
PLATFORM: "OSX"
27+
- platform-version: tvOS
28+
DEST: "OS=14.3,name=Apple TV 4K"
29+
SCHEME: "Swinject-tvOS"
30+
SDK: "appletvsimulator"
31+
ACTION: "test"
32+
PLATFORM: "tvOS"
33+
- platform-version: watchOS
34+
DEST: "OS=7.2,name=Apple Watch Series 6 - 44mm"
35+
SCHEME: "Swinject-watchOS"
36+
SDK: "watchsimulator"
37+
ACTION: "build"
38+
PLATFORM: "watchOS"
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
- name: Testing Framework for - "${{ matrix.PLATFORM }}"
43+
run: xcodebuild "${{ matrix.ACTION }}" -project "${{ env.PROJECT }}" -scheme "${{ matrix.SCHEME }}" -sdk "${{ matrix.SDK }}" -destination "${{ matrix.DEST }}" -configuration Release ENABLE_TESTABILITY=YES | xcpretty
44+
shell: bash

.github/workflows/SPM Testing.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This is the First Workflow for Testing with Github Actions
2+
3+
name: SPM Check
4+
5+
on:
6+
push:
7+
branches: [ "master" ]
8+
pull_request:
9+
branches: [ "master" ]
10+
11+
jobs:
12+
spm-check:
13+
runs-on: macos-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: swift-actions/setup-swift@v2
17+
with:
18+
swift-version: "5.9"
19+
- name: Build
20+
run: swift build -v
21+
- name: Run tests
22+
run: swift test -v

.travis.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,47 @@ env:
55
- PROJECT=Swinject.xcodeproj
66
git:
77
submodules: false
8+
addons:
9+
homebrew:
10+
packages:
11+
- xcodegen
812
matrix:
913
include:
10-
- env: JOB="LINUX_SPM" SWIFT_VERSION="5.0"
14+
- env: JOB="LINUX_SPM" SWIFT_VERSION="5.2.2"
1115
os: linux
1216
language: generic
1317
sudo: required
14-
dist: trusty
18+
dist: bionic
1519
before_install:
16-
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
20+
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
21+
before_script:
1722
script:
1823
- mv .Package.Test.swift Package.swift
1924
- swift build
2025
- swift test
2126
- env: JOB="POD_LINT"
22-
osx_image: xcode10.2
27+
osx_image: xcode12.5
2328
before_install:
2429
script:
2530
- pod lib lint
26-
- env: JOB="XCODE" DEST="OS=10.0,name=iPhone 6" SCHEME="Swinject-iOS" SDK="iphonesimulator" ACTION="test" PLATFORM="iOS"
27-
osx_image: xcode10.2
31+
- env: JOB="XCODE" DEST="OS=14.0.1,name=iPhone 8" SCHEME="Swinject-iOS" SDK="iphonesimulator" ACTION="test" PLATFORM="iOS"
32+
osx_image: xcode12.5
2833
- env: JOB="XCODE" DEST="arch=x86_64" SCHEME="Swinject-macOS" SDK="macosx" ACTION="test" PLATFORM="OSX"
29-
osx_image: xcode10.2
30-
- env: JOB="XCODE" DEST="OS=10.0,name=Apple TV 1080p" SCHEME="Swinject-tvOS" SDK="appletvsimulator" ACTION="test" PLATFORM="tvOS"
31-
osx_image: xcode10.2
32-
- env: JOB="XCODE" DEST="OS=2.2,name=Apple Watch - 42mm" SCHEME="Swinject-watchOS" SDK="watchsimulator" ACTION="build" PLATFORM="watchOS"
33-
osx_image: xcode10.2
34+
osx_image: xcode12.5
35+
- env: JOB="XCODE" DEST="OS=14.0,name=Apple TV 4K" SCHEME="Swinject-tvOS" SDK="appletvsimulator" ACTION="test" PLATFORM="tvOS"
36+
osx_image: xcode12.5
37+
- env: JOB="XCODE" DEST="OS=7.0,name=Apple Watch Series 6 - 44mm" SCHEME="Swinject-watchOS" SDK="watchsimulator" ACTION="build" PLATFORM="watchOS"
38+
osx_image: xcode12.5
3439

3540
before_install:
36-
- curl -L -O https://github.com/Carthage/Carthage/releases/download/0.33.0/Carthage.pkg
37-
- sudo installer -pkg Carthage.pkg -target /
38-
- rm Carthage.pkg
39-
- carthage bootstrap --verbose --platform $PLATFORM
41+
- xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
42+
- trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
43+
- echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
44+
- 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
45+
- export XCODE_XCCONFIG_FILE="$xcconfig"
46+
before_script:
47+
- rm -r Swinject.xcodeproj
48+
- xcodegen generate
4049
script:
4150
- set -o pipefail
4251
- xcodebuild "$ACTION" -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DEST" -configuration Release ENABLE_TESTABILITY=YES | xcpretty

CONTRIBUTING.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Pull requests are more appreciated to improve Swinject or to fix problems. Any k
2020

2121
### Getting Started
2222

23-
Framework dependencies of Swinject are managed with [Carthage](https://github.com/Carthage/Carthage/releases). Make sure you have its latest version installed. The latest installer is available at [the Carthage release page](https://github.com/Carthage/Carthage/releases).
24-
2523
To setup a Swinject repository in your local Mac, run `git clone` command in Terminal.
2624

2725
`git clone --recursive [email protected]:Swinject/Swinject.git`
@@ -30,11 +28,11 @@ Move to the Swinject directory.
3028

3129
`cd Swinject`
3230

33-
Then run `carthage` command to build the frameworks that Swinject uses.
31+
Now it is ready to open `Swinject.xcodeproj`. Modify the code, run unit tests, and submit your pull request.
3432

35-
`carthage bootstrap`
33+
### Project Generation
3634

37-
Now it is ready to open `Swinject.xcodeproj`. Modify the code, run unit tests, and submit your pull request.
35+
If you need to add / change any project settings or files inside the `Sources` folder, remember to also update the `project.yml`, which keeps our project generation in sync with the `Swinject.xcodeproj`.
3836

3937
### Code Style
4038

@@ -48,3 +46,9 @@ The installation of SwiftLint to your environment is optional. [Hound CI](https:
4846
Some Swift source files are generated from ERB files, e.g. `Resolver.swift` is generated from `Resolver.erb`, to easily maintain a set of functions that only differ the number of arguments. The generated source files are located under `GeneratedCode` group in the Xcode project. Do not modify the generated code directly, but instead modify the source ERB code. After modifying the ERB code, run `script/gencode` script to generate the Swift code.
4947

5048
**Thank you for contributing!**
49+
50+
## For Maintainers
51+
52+
### Making a new release version
53+
54+
Our release procedure is described as [Makefile](https://github.com/Swinject/Swinject/blob/master/Makefile). Run `make help` coomand for more info.

Cartfile.private

Lines changed: 0 additions & 2 deletions
This file was deleted.

Cartfile.resolved

Lines changed: 0 additions & 2 deletions
This file was deleted.

Documentation/Assembler.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ protocol LogHandler {
6161

6262
class Logger {
6363

64-
class var sharedInstance: Logger!
64+
static let sharedInstance = Logger()
65+
66+
private init() {}
6567

6668
var logHandlers = [LogHandler]()
6769

Documentation/ObjectScopes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Above holds for reference types - value types are not shared in this object scop
3939
Custom object scopes can be defined like this:
4040
```swift
4141
extension ObjectScope {
42-
static let custom = ObjectScope(storageFactory: PermamentStorage.init)
42+
static let custom = ObjectScope(storageFactory: PermanentStorage.init)
4343
}
4444
```
4545
Instances in `.custom` scope will be shared in the same way as in `.container` scope but can be discarded as needed:

0 commit comments

Comments
 (0)