3
.gitignore
vendored
3
.gitignore
vendored
@@ -19,4 +19,5 @@
|
|||||||
build
|
build
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
||||||
Pods
|
Pods
|
||||||
|
CarControlleriOS/**/car
|
||||||
@@ -6,7 +6,6 @@ target 'CarController' do
|
|||||||
use_frameworks!
|
use_frameworks!
|
||||||
|
|
||||||
# Pods for CarController
|
# Pods for CarController
|
||||||
pod 'SwiftGRPC'
|
pod 'gRPC-Swift', '1.0.0-alpha.11'
|
||||||
pod 'SwiftyZeroMQ5'
|
pod 'SwiftyZeroMQ5'
|
||||||
pod 'SwiftProtobuf', '~> 1.0'
|
|
||||||
end
|
end
|
||||||
|
|||||||
16
CarControlleriOS/build.gradle
Normal file
16
CarControlleriOS/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 './CarController/CarController'
|
||||||
|
}
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
29
gradlew
vendored
29
gradlew
vendored
@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|||||||
else
|
else
|
||||||
eval `echo args$i`="\"$arg\""
|
eval `echo args$i`="\"$arg\""
|
||||||
fi
|
fi
|
||||||
i=$((i+1))
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
case $i in
|
case $i in
|
||||||
(0) set -- ;;
|
0) set -- ;;
|
||||||
(1) set -- "$args0" ;;
|
1) set -- "$args0" ;;
|
||||||
(2) set -- "$args0" "$args1" ;;
|
2) set -- "$args0" "$args1" ;;
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -175,14 +175,9 @@ save () {
|
|||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
APP_ARGS=$(save "$@")
|
APP_ARGS=`save "$@"`
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|||||||
3
gradlew.bat
vendored
3
gradlew.bat
vendored
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
|||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
|||||||
@@ -12,17 +12,28 @@ configurations {
|
|||||||
canBeResolved = false
|
canBeResolved = false
|
||||||
canBeConsumed = true
|
canBeConsumed = true
|
||||||
}
|
}
|
||||||
|
// For Swift Codegen
|
||||||
|
swift {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protobuf {
|
protobuf {
|
||||||
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
|
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
|
||||||
plugins {
|
plugins {
|
||||||
|
swift {
|
||||||
|
path = "$projectDir/grpc_plugins/protoc-gen-swift"
|
||||||
|
}
|
||||||
grpc {
|
grpc {
|
||||||
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.1' // CURRENT_GRPC_VERSION
|
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.1' // CURRENT_GRPC_VERSION
|
||||||
}
|
}
|
||||||
grpc_python {
|
grpc_python {
|
||||||
path = "$projectDir/grpc_plugins/grpc_python_plugin_1.28.1-${osdetector.classifier}"
|
path = "$projectDir/grpc_plugins/grpc_python_plugin_1.28.1-${osdetector.classifier}"
|
||||||
}
|
}
|
||||||
|
grpc_swift {
|
||||||
|
path = "$projectDir/grpc_plugins/protoc-gen-grpc-swift-$osdetector.classifier"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
generateProtoTasks {
|
generateProtoTasks {
|
||||||
all().each { task ->
|
all().each { task ->
|
||||||
@@ -32,12 +43,16 @@ protobuf {
|
|||||||
python {}
|
python {}
|
||||||
}
|
}
|
||||||
task.plugins {
|
task.plugins {
|
||||||
|
swift{}
|
||||||
grpc { // Options added to --grpc_out
|
grpc { // Options added to --grpc_out
|
||||||
option 'lite'
|
option 'lite'
|
||||||
}
|
}
|
||||||
grpc_python {
|
grpc_python {
|
||||||
outputSubDir = 'python'
|
outputSubDir = 'python'
|
||||||
}
|
}
|
||||||
|
grpc_swift {
|
||||||
|
outputSubDir = 'swift'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,8 +62,13 @@ task packPythonGrpc(type: Zip, dependsOn: protobuf.generateProtoTasks.all()) {
|
|||||||
from protobuf.generatedFilesBaseDir + '/main/python'
|
from protobuf.generatedFilesBaseDir + '/main/python'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task packSwiftGrpc(type: Zip, dependsOn: protobuf.generateProtoTasks.all()) {
|
||||||
|
from protobuf.generatedFilesBaseDir + '/main/swift'
|
||||||
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
python(packPythonGrpc)
|
python(packPythonGrpc)
|
||||||
|
swift(packSwiftGrpc)
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
BIN
protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64
Executable file
BIN
protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64
Executable file
Binary file not shown.
BIN
protobuf/grpc_plugins/protoc-gen-swift
Executable file
BIN
protobuf/grpc_plugins/protoc-gen-swift
Executable file
Binary file not shown.
@@ -1,4 +1,5 @@
|
|||||||
include ':app'
|
include ':app'
|
||||||
include ':protobuf'
|
include ':protobuf'
|
||||||
include 'car'
|
include 'car'
|
||||||
|
include 'CarControlleriOS'
|
||||||
rootProject.name='CarController'
|
rootProject.name='CarController'
|
||||||
|
|||||||
Reference in New Issue
Block a user