Skip to content

Codegen improvements #2528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ internal class Gen(
}
val messageTypeName = ClassName.bestGuess(type.name)

val constructor = MethodSpec.constructorBuilder().addModifiers(Modifier.PRIVATE)
val constructor = MethodSpec.constructorBuilder()
messageClass.addMethod(MethodSpec.methodBuilder("newBuilder")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(ClassName.bestGuess("Builder"))
Expand Down Expand Up @@ -351,7 +351,7 @@ internal class Gen(
.addCode("return new \$T(\$L);\n", messageTypeName, buildMethodArgs)
.build())

val builderConstructor = MethodSpec.constructorBuilder().addModifiers(Modifier.PRIVATE)
val builderConstructor = MethodSpec.constructorBuilder()

for (field in type.fields) {
builder.addField(FieldSpec.builder(field.typeName, "${field.name}_", Modifier.PRIVATE).build())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vendor_package: "com.example"

include: "com.google.firebase.testing.LinkedListProto"
include: "com.google.firebase.testing.Other"
include: "com.google.firebase.testing.SimpleProto"
include: "com.google.firebase.testing.Types"
include: "com.google.firebase.testing.Types32"
include: "com.google.firebase.testing.Types64"
include: "com.google.firebase.testing.e2e.LinkedListProto"
include: "com.google.firebase.testing.e2e.Other"
include: "com.google.firebase.testing.e2e.SimpleProto"
include: "com.google.firebase.testing.e2e.Types"
include: "com.google.firebase.testing.e2e.Types32"
include: "com.google.firebase.testing.e2e.Types64"
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.firebase.testing;
package com.google.firebase.testing.e2e;

import static com.google.common.truth.Truth.assertThat;

import com.example.com.google.firebase.testing.LinkedListProto;
import com.example.com.google.firebase.testing.Other;
import com.example.com.google.firebase.testing.SimpleProto;
import com.example.com.google.firebase.testing.Types;
import com.example.com.google.firebase.testing.Types32;
import com.example.com.google.firebase.testing.Types64;
import com.example.com.google.firebase.testing.e2e.LinkedListProto;
import com.example.com.google.firebase.testing.e2e.Other;
import com.example.com.google.firebase.testing.e2e.SimpleProto;
import com.example.com.google.firebase.testing.e2e.Types;
import com.example.com.google.firebase.testing.e2e.Types32;
import com.example.com.google.firebase.testing.e2e.Types64;
import com.example.google.protobuf.Timestamp;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

syntax = "proto3";

package com.google.firebase.testing;
package com.google.firebase.testing.e2e;

message LinkedListProto {
int32 value = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

syntax = "proto3";

package com.google.firebase.testing;
package com.google.firebase.testing.e2e;

import "google/protobuf/timestamp.proto";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

syntax = "proto3";

package com.google.firebase.testing;
package com.google.firebase.testing.e2e;

message Types32 {
int32 i = 1;
Expand Down