Permalink
Browse files

Prefer a .proto file's "package" to its "java_package" when determini…

…ng what

Lisp package the code will live in.
  • Loading branch information...
1 parent 3fb8fbc commit 341cc6cc0791ab580c569fd5a2cac4efb885e08f @brown committed Feb 9, 2012
Showing with 8 additions and 10 deletions.
  1. +2 −2 example/package.lisp
  2. +1 −1 message-test.lisp
  3. +3 −5 protoc/lisp/helpers.cc
  4. +2 −2 protoc/package.lisp
View
@@ -6,7 +6,7 @@
(defpackage #:address-book
(:use #:common-lisp)
- (:import-from #:com.example.tutorial
+ (:import-from #:tutorial
#:+person-phone-type-home+
#:+person-phone-type-mobile+
#:+person-phone-type-work+
@@ -19,7 +19,7 @@
#:person-phone-number
#:phone)
;; The "number" and "type" field names conflict with Common Lisp symbols.
- (:shadowing-import-from #:com.example.tutorial
+ (:shadowing-import-from #:tutorial
#:number
#:type)
(:export #:add-person
View
@@ -36,7 +36,7 @@
(:documentation "Tests for protocol buffer messages.")
(:use #:common-lisp
#:com.google.base
- #:com.google.protobuf.test
+ #:protobuf-unittest-import
#:hu.dwim.stefil
#:protobuf-test-config
#:protobuf-unittest)
View
@@ -67,12 +67,10 @@ string StripProto(const string& filename) {
}
string FileLispPackage(const FileDescriptor* file) {
- if (file->options().has_java_package()) {
- return LispifyName(file->options().java_package());
-// } else if (file->options().has_java_outer_classname()) {
-// return LispifyName(file->options().java_outer_classname());
- } else if (file->package().size() != 0) {
+ if (file->package().size() != 0) {
return LispifyName(file->package());
+ } else if (file->options().has_java_package()) {
+ return LispifyName(file->options().java_package());
} else {
return "protocol-buffer";
}
View
@@ -61,7 +61,7 @@
;;#:name
#:parameter
#:proto-file)
- (:import-from #:com.google.protobuf
+ (:import-from #:google.protobuf
;; Constants
#:+field-descriptor-proto-label-label-optional+
#:+field-descriptor-proto-label-label-repeated+
@@ -257,7 +257,7 @@
#:uninterpreted-option
#:value)
;; Descriptor symbols that conflict with standard Common Lisp symbols.
- (:shadowing-import-from #:com.google.protobuf
+ (:shadowing-import-from #:google.protobuf
#:method
#:number
#:package

0 comments on commit 341cc6c

Please sign in to comment.