-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #67
- Loading branch information
Showing
8 changed files
with
889 additions
and
38 deletions.
There are no files selected for viewing
408 changes: 397 additions & 11 deletions
408
compiler-plugin/src/main/java/com/trueaccord/scalapb/Scalapb.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
syntax = "proto2"; | ||
|
||
package com.trueaccord.proto.e2e; | ||
|
||
import "scalapb/scalapb.proto"; | ||
|
||
// Demonstrates a sealed trait and two messages extending it. | ||
|
||
option (scalapb.options) = { | ||
// All classes that extend a sealed trait need to be in the same Scala | ||
// file, so we set single_file to true. | ||
single_file: true | ||
|
||
// Generate the base trait. | ||
preamble: [ | ||
"sealed trait MyBaseTrait {", | ||
" def getFoo: Int", | ||
" def getBar: String", | ||
"}" | ||
]; | ||
}; | ||
|
||
message Type1 { | ||
option (scalapb.message).extends = "MyBaseTrait"; | ||
optional int32 foo = 1; | ||
optional string bar = 2; | ||
} | ||
|
||
message Type2 { | ||
option (scalapb.message).extends = "MyBaseTrait"; | ||
optional int32 foo = 1; | ||
optional string bar = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.