Add initial grpc generation, and add to gradle build

This commit is contained in:
Piv
2020-05-08 18:24:20 +09:30
parent 270dd8e362
commit 98dc0395e3
7 changed files with 114 additions and 8 deletions

View File

@@ -0,0 +1,70 @@
{
"object": {
"pins": [
{
"package": "grpc-swift",
"repositoryURL": "https://github.com/grpc/grpc-swift.git",
"state": {
"branch": null,
"revision": "373ffd54c1c1a319d0ddac9476d13be9023584bb",
"version": "1.0.0-alpha.11"
}
},
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
"version": "1.2.0"
}
},
{
"package": "swift-nio",
"repositoryURL": "https://github.com/apple/swift-nio.git",
"state": {
"branch": null,
"revision": "40bdad80882d307abe2c0bb36cf3bd4d3e03fe04",
"version": "2.16.1"
}
},
{
"package": "swift-nio-http2",
"repositoryURL": "https://github.com/apple/swift-nio-http2.git",
"state": {
"branch": null,
"revision": "82eb3fa0974b838358ee46bc6c5381e5ae5de6b9",
"version": "1.11.0"
}
},
{
"package": "swift-nio-ssl",
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
"state": {
"branch": null,
"revision": "ae213938e151964aa691f0e902462fbe06baeeb6",
"version": "2.7.1"
}
},
{
"package": "swift-nio-transport-services",
"repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
"state": {
"branch": null,
"revision": "85a67aea7caf5396ed599543dd23cffeb6dbbf96",
"version": "1.5.1"
}
},
{
"package": "SwiftProtobuf",
"repositoryURL": "https://github.com/apple/swift-protobuf.git",
"state": {
"branch": null,
"revision": "7790acf0a81d08429cb20375bf42a8c7d279c5fe",
"version": "1.8.0"
}
}
]
},
"version": 1
}

View File

@@ -7,20 +7,21 @@ let package = Package(
name: "SwiftyCar",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SwiftyCar",
targets: ["SwiftyCar"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0-alpha.11")
],
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: "Generated",
dependencies: [.product(name: "GRPC", package: "grpc-swift")]),
.target(
name: "SwiftyCar",
dependencies: []),
dependencies: ["Generated"]),
.testTarget(
name: "SwiftyCarTests",
dependencies: ["SwiftyCar"]),

View File

@@ -1,3 +0,0 @@
struct SwiftyCar {
var text = "Hello, World!"
}

View File

@@ -0,0 +1,10 @@
//
// main.swift
//
//
// Created by Michael Pivato on 8/5/20.
//
// Entry-Point to the Swift Car Controller
print("Hello World!")

16
SwiftyCar/build.gradle Normal file
View File

@@ -0,0 +1,16 @@
configurations{
swift {
canBeConsumed = false
canBeResolved = true
}
}
dependencies {
swift project(path: ':protobuf', configuration: 'swift')
}
task copySwiftCode(type: Copy, dependsOn: configurations.swift) {
// Copy python protobuf code from proto project.
from zipTree(configurations.swift.asPath)
into './Sources/Generated'
}