فهرست منبع

add compile script

yokyo 5 سال پیش
والد
کامیت
2055b937dc
5فایلهای تغییر یافته به همراه21 افزوده شده و 0 حذف شده
  1. 1 0
      .gitignore
  2. 14 0
      build
  3. 2 0
      modules/checkin.proto
  4. 2 0
      modules/notice.proto
  5. 2 0
      modules/shop.proto

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+*.pb.go

+ 14 - 0
build

@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+import os
+print('compile proto to go file')
+for cur, dirs, files in os.walk('.'):
+    if cur[2:8] == 'google':
+        continue
+    for file in files:
+        f, ext = os.path.splitext(file)
+        if ext != '.proto':
+            continue
+        os.system('protoc --go_out=. {}'.format(os.path.join(cur,file)))
+        print('.')
+
+print('done. check if there any errors')

+ 2 - 0
modules/checkin.proto

@@ -0,0 +1,2 @@
+syntax = "proto3";
+package protos.modules;

+ 2 - 0
modules/notice.proto

@@ -0,0 +1,2 @@
+syntax = "proto3";
+package protos.modules;

+ 2 - 0
modules/shop.proto

@@ -0,0 +1,2 @@
+syntax = "proto3";
+package protos.modules;