Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add asdf:*PROTOC-RELATIVE-PATH* to control whether a relative or abso…

…lute

file path is used for the proto file argument to protoc.  The internal
Google compiler wants a relative file path, but the external compiler wants
an absolute path.  Also, add syntax="proto2" to all proto files so the
Google internal protobuf compiler is happy with them.
  • Loading branch information...
commit da7eaa9236fd32f076bd4c0da982bbd8e8073dd8 1 parent 1bbff50
@brown authored
View
2  example/addressbook.proto
@@ -1,5 +1,7 @@
// See README.txt for information and build instructions.
+syntax = "proto2"; // for compatibility with internal Google compiler
+
package tutorial;
option java_package = "com.example.tutorial";
View
2  google/protobuf/descriptor.proto
@@ -36,7 +36,7 @@
// A valid .proto file can be translated directly to a FileDescriptorProto
// without any other information (e.g. without reading its imports).
-
+syntax = "proto2"; // for compatibility with internal Google compiler
package google.protobuf;
option java_package = "com.google.protobuf";
View
1  google/protobuf/unittest.proto
@@ -34,6 +34,7 @@
//
// A proto file we will use for unit testing.
+syntax = "proto2"; // for compatibility with internal Google compiler
// Some generic_services option(s) added automatically.
// See: http://go/proto2-generic-services-default
View
1  google/protobuf/unittest_import.proto
@@ -34,6 +34,7 @@
//
// A proto file which is imported by unittest.proto to test importing.
+syntax = "proto2"; // for compatibility with internal Google compiler
// We don't put this in a package within proto2 because we need to make sure
// that the generated code doesn't depend on being in the proto2 namespace.
View
10 protobuf.asd
@@ -47,6 +47,11 @@
"Pathname of the Lisp protocol buffer compiler backend, protoc-gen-lisp.")
(export '*protoc-gen-lisp*)
+(defvar *protoc-relative-path* nil
+ "Proto file arguments to the protobuf compiler are relative paths?")
+(export '*protoc-relative-path*)
+
+
(defclass protobuf-source-file (cl-source-file)
((relative-proto-pathname
:initarg :proto-pathname
@@ -145,6 +150,9 @@ relative to PARENT-PATH."
(defmethod perform ((operation proto-to-lisp) (component protobuf-source-file))
(let* ((source-file (proto-input component))
+ (source-file-argument (if *protoc-relative-path*
+ (file-namestring source-file)
+ (namestring source-file)))
;; Around methods on output-file may globally redirect output
;; products, so we must call that method instead of executing
;; (component-pathname component).
@@ -155,7 +163,7 @@ relative to PARENT-PATH."
(namestring *protoc-gen-lisp*)
search-path
(directory-namestring output-file)
- (namestring source-file))))
+ source-file-argument)))
(unless (zerop status)
(error 'compile-failed :component component :operation operation))))
View
2  testproto1.proto
@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+syntax = "proto2"; // for compatibility with internal Google compiler
+
// dummy message to include in other messages.
message Test1Msg {
optional int32 foo = 1;
View
2  testproto2.proto
@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+syntax = "proto2"; // for compatibility with internal Google compiler
+
message TimeProtocol {
repeated group G = 1 {
required int32 V1 = 2;
Please sign in to comment.
Something went wrong with that request. Please try again.