Add initial grpc generation, and add to gradle build
This commit is contained in:
13
.gitignore
vendored
13
.gitignore
vendored
@@ -20,4 +20,15 @@ build
|
||||
__pycache__
|
||||
|
||||
Pods
|
||||
CarControlleriOS/**/car
|
||||
CarControlleriOS/**/car
|
||||
car/.idea
|
||||
|
||||
.build
|
||||
SwiftyCar/Packages
|
||||
SwiftyCar/*.xcodeproj
|
||||
SwiftyCar/Sources/Generated
|
||||
SwiftyCar/xcuserdata/
|
||||
xcuserdata/
|
||||
.settings
|
||||
.project
|
||||
.classpath
|
||||
70
SwiftyCar/Package.resolved
Normal file
70
SwiftyCar/Package.resolved
Normal 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
|
||||
}
|
||||
@@ -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"]),
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
struct SwiftyCar {
|
||||
var text = "Hello, World!"
|
||||
}
|
||||
10
SwiftyCar/Sources/SwiftyCar/main.swift
Normal file
10
SwiftyCar/Sources/SwiftyCar/main.swift
Normal 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
16
SwiftyCar/build.gradle
Normal 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'
|
||||
}
|
||||
@@ -2,4 +2,5 @@ include ':app'
|
||||
include ':protobuf'
|
||||
include 'car'
|
||||
include 'CarControlleriOS'
|
||||
include 'SwiftyCar'
|
||||
rootProject.name='CarController'
|
||||
|
||||
Reference in New Issue
Block a user