Skip to content

Commit

Permalink
neat swift
Browse files Browse the repository at this point in the history
  • Loading branch information
feuyeux committed Oct 8, 2024
1 parent f9ef8ea commit e61979e
Show file tree
Hide file tree
Showing 12 changed files with 1,091 additions and 1,129 deletions.
2 changes: 1 addition & 1 deletion hello-grpc-swift/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import PackageDescription

let packageDependencies: [Package.Dependency] = [
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.23.1"),
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.24.1"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.74.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.28.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.1"),
Expand Down
27 changes: 15 additions & 12 deletions hello-grpc-swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,38 @@ swiftformat --indent 4 --swiftversion 6.0.1 --exclude "**/*.grpc.swift,**/*.pb.s
## build

```sh
# 老 Mac 用上最新 macOS
# https://dortania.github.io/OpenCore-Legacy-Patcher/INSTALLER.html#creating-the-installer
# https://github.com/getlantern/lantern
export PATH=/home/han/swift-6.0.1-RELEASE-ubuntu22.04/usr/bin:$PATH
```

brew install swift-protobuf grpc-swift
cd Sources/Common
```sh
swift build
swift build --product protoc-gen-swift
swift build --product protoc-gen-grpc-swift
```

```sh
export protoc_gen_swift=/mnt/d/coding/hello-grpc/hello-grpc-swift/.build/x86_64-unknown-linux-gnu/debug/protoc-gen-swift
export protoc_generate_grpc_swift=/mnt/d/coding/hello-grpc/hello-grpc-swift/.build/x86_64-unknown-linux-gnu/debug/protoc-gen-grpc-swift
sh proto2swift.sh
```

```sh
# 老 Mac 用上最新 macOS
# https://dortania.github.io/OpenCore-Legacy-Patcher/INSTALLER.html#creating-the-installer
# https://github.com/getlantern/lantern

# clean if meeting issue: "PCH was compiled with module cache path ..., but the path is currently ..."
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf .build
Clean: ⇧shift+⌘cmd+K in xcode
```

```sh

export proxy_port=56458
export http_proxy=127.0.0.1:$proxy_port
export https_proxy=127.0.0.1:$proxy_port
```

```sh
swift build
swift build --product protoc-gen-swift
swift build --product protoc-gen-grpc-swift
```

## run

```sh
Expand Down
Loading

0 comments on commit e61979e

Please sign in to comment.