Skip to content

Commit

Permalink
Merge pull request #478 from uber/update
Browse files Browse the repository at this point in the history
Update for Xcode 15, fix broken tests, preliminary support for Swift 6 compiler
  • Loading branch information
alanzeino authored Aug 14, 2024
2 parents 8828a65 + 96d6437 commit 8c1b1a3
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 15 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,54 @@ on:
branches: [ master ]

env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app
DEVELOPER_DIR: /Applications/Xcode_15.4.app

jobs:
build:
runs-on: macos-12
NeedleFoundationTests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleFoundationTests"
run: xcodebuild test -project NeedleFoundation.xcodeproj -scheme NeedleFoundation -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
run: xcodebuild test -project NeedleFoundation.xcodeproj -scheme NeedleFoundation -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15'
NeedleGeneratorTests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleGeneratorTests"
run: cd Generator && swift test -Xswiftc -DDEBUG
NeedleGeneratorBinary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleGeneratorBinary"
run: cd Generator && swift build -c release
NeedleSampleMVCApp:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleSampleMVCApp"
run: xcodebuild build -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
run: xcodebuild build -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15'
NeedleSampleMVCTests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleSampleMVCTests"
run: xcodebuild test -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeTests -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
run: xcodebuild test -project Sample/MVC/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeTests -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15'
NeedleSamplePluginizedApp:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleSamplePluginizedApp"
run: xcodebuild build -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
run: xcodebuild build -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToe -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15'
NeedleSamplePluginizedScoreSheetTests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleSamplePluginizedScoreSheetTests"
run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme ScoreSheetTests -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme ScoreSheetTests -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15'
NeedleSamplePluginizedTicTacToeCoreTests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: "NeedleSamplePluginizedTicTacToeCoreTests"
run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeCoreTests -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
run: xcodebuild test -project Sample/Pluginized/TicTacToe/TicTacToe.xcodeproj -scheme TicTacToeCoreTests -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15'
2 changes: 1 addition & 1 deletion Generator/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.10
import PackageDescription

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion Generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Needle is intended to be heavily multi-threaded. This makes stepping through the

### Structure of generated code

The shortest way to describe the code generated by needle is that it's primary purpose is to create classes that conform to all the `*Dependency` protocols in your application code.
The shortest way to describe the code generated by needle is that its primary purpose is to create classes that conform to all the `*Dependency` protocols in your application code.

In order to do this needle creates Provider classes which perform the job just described. So the providers need to have a number of vars, one for each of the vars in the protocol. The body of these vars is quite simple. Typically, something like:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import Foundation

/// A serializer that produces the class definitation source code for the
/// A serializer that produces the class definition source code for the
/// plugin extension provider.
class PluginExtensionDynamicContentSerializer: Serializer {

Expand All @@ -36,7 +36,7 @@ class PluginExtensionDynamicContentSerializer: Serializer {

return """
/// \(component.data.name) plugin extension
extension \(component.data.name): ExtensionRegistration {
extension \(component.data.name): NeedleFoundation.ExtensionRegistration {
public func registerExtensionItems() {
\(properties)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DependencyGraphExporterTests: AbstractGeneratorTests {
registerProviderFactory(\"^->RootComponent->LoggedOutComponent\", factory1434ff4463106e5c4f1bb3a8f24c1d289f2c0f2e)
"""))
XCTAssertTrue(generated.contains("""
registerProviderFactory(\"^->RootComponent->LoggedInComponent\", factoryEmptyDependencyProvider)
registerProviderFactory(\"^->RootComponent->LoggedInComponent\", factory2d08e87342cecea575b3e3b0c44298fc1c149afb)
"""))
XCTAssertTrue(generated.contains("""
registerProviderFactory(\"^->RootComponent\", factoryEmptyDependencyProvider)
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.10
import PackageDescription

let package = Package(
Expand Down

0 comments on commit 8c1b1a3

Please sign in to comment.