From 07b8d3bdf0dd20e91ebbbaec69af4a32efb77f22 Mon Sep 17 00:00:00 2001 From: Zhengxin Date: Sun, 19 Apr 2020 01:30:51 +0800 Subject: [PATCH 1/6] Add Java Support --- .gitignore | 74 +--------------------- pom.xml | 56 ++++++++++++++++ proto/wechaty/puppet.proto | 2 + proto/wechaty/puppet/base.proto | 1 + proto/wechaty/puppet/contact.proto | 1 + proto/wechaty/puppet/event.proto | 1 + proto/wechaty/puppet/friendship.proto | 1 + proto/wechaty/puppet/message.proto | 1 + proto/wechaty/puppet/room.proto | 1 + proto/wechaty/puppet/room_invitation.proto | 1 + proto/wechaty/puppet/room_member.proto | 1 + proto/wechaty/puppet/tag.proto | 1 + 12 files changed, 68 insertions(+), 73 deletions(-) create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index 246e8f60..15aedc70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,74 +1,2 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -package-lock.json -t/ -t.* -dist/ -.ropeproject/ -build/ -__pycache__/ +target/ .idea - -# Generated temp dirs -generated/ - -id_rsa* -t/ -t.* diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..d96ef76a --- /dev/null +++ b/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + io.github.wechaty + wechaty-grpc-proto + jar + 1.0.0 + wechaty-grpc-proto + + + UTF-8 + UTF-8 + + + + + + io.grpc + grpc-all + 1.28.1 + + + + + + + kr.motd.maven + os-maven-plugin + 1.6.2 + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:3.11.4:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:1.28.1:exe:${os.detected.classifier} + ${basedir}/proto/wechaty + + + + + compile + compile-custom + + + + + + + + diff --git a/proto/wechaty/puppet.proto b/proto/wechaty/puppet.proto index 94330402..4be68584 100644 --- a/proto/wechaty/puppet.proto +++ b/proto/wechaty/puppet.proto @@ -13,6 +13,8 @@ syntax = "proto3"; package wechaty; +option java_package="io.github.wechaty.puppet"; + import public "puppet/base.proto"; import public "puppet/contact.proto"; import public "puppet/event.proto"; diff --git a/proto/wechaty/puppet/base.proto b/proto/wechaty/puppet/base.proto index b864655e..8e2df6bd 100644 --- a/proto/wechaty/puppet/base.proto +++ b/proto/wechaty/puppet/base.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; message StartRequest {} message StartResponse {} diff --git a/proto/wechaty/puppet/contact.proto b/proto/wechaty/puppet/contact.proto index f161bfdb..ee2fa1c6 100644 --- a/proto/wechaty/puppet/contact.proto +++ b/proto/wechaty/puppet/contact.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/event.proto b/proto/wechaty/puppet/event.proto index fc87c711..8a118c28 100644 --- a/proto/wechaty/puppet/event.proto +++ b/proto/wechaty/puppet/event.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; enum EventType { EVENT_TYPE_UNSPECIFIED = 0; diff --git a/proto/wechaty/puppet/friendship.proto b/proto/wechaty/puppet/friendship.proto index 32ca0965..262fa728 100644 --- a/proto/wechaty/puppet/friendship.proto +++ b/proto/wechaty/puppet/friendship.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/message.proto b/proto/wechaty/puppet/message.proto index 8b3232d5..174dc485 100644 --- a/proto/wechaty/puppet/message.proto +++ b/proto/wechaty/puppet/message.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/room.proto b/proto/wechaty/puppet/room.proto index e4d58df6..073805f2 100644 --- a/proto/wechaty/puppet/room.proto +++ b/proto/wechaty/puppet/room.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/room_invitation.proto b/proto/wechaty/puppet/room_invitation.proto index f0b49797..1ea1e3cc 100644 --- a/proto/wechaty/puppet/room_invitation.proto +++ b/proto/wechaty/puppet/room_invitation.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/room_member.proto b/proto/wechaty/puppet/room_member.proto index 0a776fae..763a81b3 100644 --- a/proto/wechaty/puppet/room_member.proto +++ b/proto/wechaty/puppet/room_member.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; message RoomMemberPayloadRequest { string id = 1; diff --git a/proto/wechaty/puppet/tag.proto b/proto/wechaty/puppet/tag.proto index ee5dbd8a..7127ff86 100644 --- a/proto/wechaty/puppet/tag.proto +++ b/proto/wechaty/puppet/tag.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; +option java_package="io.github.wechaty.puppet"; import "google/protobuf/wrappers.proto"; From b9346910d2c4415772890c36238e56c68bcbf4fe Mon Sep 17 00:00:00 2001 From: Zhengxin Date: Sun, 19 Apr 2020 01:33:54 +0800 Subject: [PATCH 2/6] Add Java Support --- .gitignore | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 15aedc70..1a1a6b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,76 @@ -target/ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +package-lock.json +t/ +t.* +dist/ +.ropeproject/ +build/ +__pycache__/ +.idea + +# Generated temp dirs +generated/ + +id_rsa* +t/ + .idea +target/ From b183c98d2c86ab60b93a4018661c5e6069cb1426 Mon Sep 17 00:00:00 2001 From: Zhengxin Date: Sun, 19 Apr 2020 01:34:44 +0800 Subject: [PATCH 3/6] Add Java Support --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1a1a6b5b..d4d1259b 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ generated/ id_rsa* t/ +t.* .idea target/ From e5b33c692a30bd16a558ada0885ebaea2c4a685a Mon Sep 17 00:00:00 2001 From: Zhengxin Date: Sun, 19 Apr 2020 01:48:17 +0800 Subject: [PATCH 4/6] Add Java Support --- pom.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pom.xml b/pom.xml index d96ef76a..af494b2e 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,25 @@ UTF-8 + + Wechaty is a Wechat Bot SDK for Personal Account that lets you create software to extend the functionality of the Wechat, + writen in Node.js with TypeScript, Support all platforms including Linux, Windows, Darwin(OSX/Mac) and Docker. + + https://github.com/Chatie/grpc + + + + Zhengxin Diao + diaozxin@gmail.com + + + + + https://github.com/Chatie/grpc + scm:git:ssh://github.com/Chatie/grpc.git + scm:git:ssh://git@github.com/Chatie/grpc.git + HEAD + From 916a340beb5ba94d9ad30e780e3bcc5c8b7f4b6a Mon Sep 17 00:00:00 2001 From: Zhengxin Date: Mon, 20 Apr 2020 10:45:32 +0800 Subject: [PATCH 5/6] fix maven artifactId,version And add Kotlin support --- pom.xml | 175 +++++++++++++++++++-- proto/wechaty/puppet.proto | 2 +- proto/wechaty/puppet/base.proto | 2 +- proto/wechaty/puppet/contact.proto | 2 +- proto/wechaty/puppet/event.proto | 2 +- proto/wechaty/puppet/friendship.proto | 2 +- proto/wechaty/puppet/message.proto | 2 +- proto/wechaty/puppet/room.proto | 2 +- proto/wechaty/puppet/room_invitation.proto | 2 +- proto/wechaty/puppet/room_member.proto | 2 +- proto/wechaty/puppet/tag.proto | 2 +- 11 files changed, 168 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index af494b2e..ef2669ca 100644 --- a/pom.xml +++ b/pom.xml @@ -1,20 +1,15 @@ - 4.0.0 io.github.wechaty - wechaty-grpc-proto + 0.11.25-SANPSHOT + 4.0.0 + grpc jar - 1.0.0 - wechaty-grpc-proto - - - UTF-8 - UTF-8 - - Wechaty is a Wechat Bot SDK for Personal Account that lets you create software to extend the functionality of the Wechat, + Wechaty is a Wechat Bot SDK for Personal Account that lets you create software to extend the functionality of the + Wechat, writen in Node.js with TypeScript, Support all platforms including Linux, Windows, Darwin(OSX/Mac) and Docker. https://github.com/Chatie/grpc @@ -33,39 +28,185 @@ HEAD + + 1.8 + 1.3.72 + 1.3.4 + 1.25.0 + 0.1.1 + 3.11.4 + + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlinx + kotlinx-coroutines-core + ${kotlinx.coroutines.version} + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.protobuf + protobuf-java-util + ${protobuf.version} + io.grpc - grpc-all - 1.28.1 + grpc-netty-shaded + ${grpc.version} + + + io.grpc + grpc-protobuf + ${grpc.version} + + + io.grpc + grpc-stub + ${grpc.version} + + + javax.annotation + javax.annotation-api + 1.3.2 + + + io.grpc + grpc-kotlin-stub + ${grpc.kotlin.version} + + kr.motd.maven os-maven-plugin - 1.6.2 + 1.5.0.Final + org.xolstice.maven.plugins protobuf-maven-plugin - 0.6.1 + 0.5.0 - com.google.protobuf:protoc:3.11.4:exe:${os.detected.classifier} - grpc-java - io.grpc:protoc-gen-grpc-java:1.28.1:exe:${os.detected.classifier} + com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} ${basedir}/proto/wechaty + grpc-java compile compile-custom + + grpc-java + io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${basedir}/proto/wechaty + + + + grpc-kotlin + + compile + compile-custom + + + grpc-kotlin + io.grpc:protoc-gen-grpc-kotlin:${grpc.kotlin.version}:exe:${os.detected.classifier} + ${basedir}/proto/wechaty + + + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + ${project.build.directory}/generated-sources/protobuf/java/ + ${project.build.directory}/generated-sources/protobuf/grpc-java/ + ${project.build.directory}/generated-sources/protobuf/grpc-kotlin/ + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + + default-compile + none + + + + default-testCompile + none + + + + java-compile + compile + + compile + + + + + ${java.version} + ${java.version} + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + + java + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.0.1 + + + copy-dependencies + package + copy-dependencies diff --git a/proto/wechaty/puppet.proto b/proto/wechaty/puppet.proto index 4be68584..fba37c92 100644 --- a/proto/wechaty/puppet.proto +++ b/proto/wechaty/puppet.proto @@ -13,7 +13,7 @@ syntax = "proto3"; package wechaty; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc"; import public "puppet/base.proto"; import public "puppet/contact.proto"; diff --git a/proto/wechaty/puppet/base.proto b/proto/wechaty/puppet/base.proto index 8e2df6bd..e72be44e 100644 --- a/proto/wechaty/puppet/base.proto +++ b/proto/wechaty/puppet/base.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; message StartRequest {} message StartResponse {} diff --git a/proto/wechaty/puppet/contact.proto b/proto/wechaty/puppet/contact.proto index ee2fa1c6..cb14f8e4 100644 --- a/proto/wechaty/puppet/contact.proto +++ b/proto/wechaty/puppet/contact.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/event.proto b/proto/wechaty/puppet/event.proto index 8a118c28..785e5e75 100644 --- a/proto/wechaty/puppet/event.proto +++ b/proto/wechaty/puppet/event.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; enum EventType { EVENT_TYPE_UNSPECIFIED = 0; diff --git a/proto/wechaty/puppet/friendship.proto b/proto/wechaty/puppet/friendship.proto index 262fa728..15494ade 100644 --- a/proto/wechaty/puppet/friendship.proto +++ b/proto/wechaty/puppet/friendship.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/message.proto b/proto/wechaty/puppet/message.proto index 174dc485..a3a9a503 100644 --- a/proto/wechaty/puppet/message.proto +++ b/proto/wechaty/puppet/message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/room.proto b/proto/wechaty/puppet/room.proto index 073805f2..e66ebe84 100644 --- a/proto/wechaty/puppet/room.proto +++ b/proto/wechaty/puppet/room.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/room_invitation.proto b/proto/wechaty/puppet/room_invitation.proto index 1ea1e3cc..7f2df8b1 100644 --- a/proto/wechaty/puppet/room_invitation.proto +++ b/proto/wechaty/puppet/room_invitation.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; import "google/protobuf/wrappers.proto"; diff --git a/proto/wechaty/puppet/room_member.proto b/proto/wechaty/puppet/room_member.proto index 763a81b3..4b2e34a6 100644 --- a/proto/wechaty/puppet/room_member.proto +++ b/proto/wechaty/puppet/room_member.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; message RoomMemberPayloadRequest { string id = 1; diff --git a/proto/wechaty/puppet/tag.proto b/proto/wechaty/puppet/tag.proto index 7127ff86..72207686 100644 --- a/proto/wechaty/puppet/tag.proto +++ b/proto/wechaty/puppet/tag.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; -option java_package="io.github.wechaty.puppet"; +option java_package="io.github.wechaty.grpc.puppet"; import "google/protobuf/wrappers.proto"; From c327b63936c252714a71c409f4ada0bcb99fdc30 Mon Sep 17 00:00:00 2001 From: Zhengxin Date: Mon, 20 Apr 2020 10:54:21 +0800 Subject: [PATCH 6/6] fix maven artifactId,version And add Kotlin support --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ef2669ca..01a23c7c 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ kr.motd.maven os-maven-plugin - 1.5.0.Final + 1.6.2 @@ -100,7 +100,7 @@ org.xolstice.maven.plugins protobuf-maven-plugin - 0.5.0 + 0.6.1 com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} ${basedir}/proto/wechaty