Introduce extension for built-ins serialization, drop .kotlin_class_names
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization;
|
||||
|
||||
import "core/serialization/src/descriptors.proto";
|
||||
|
||||
option java_outer_classname = "BuiltInsProtoBuf";
|
||||
option optimize_for = LITE_RUNTIME;
|
||||
|
||||
extend Package {
|
||||
// id in StringTable
|
||||
repeated int32 class_name = 150 [packed = true];
|
||||
}
|
||||
@@ -155,6 +155,8 @@ message Class {
|
||||
|
||||
message Package {
|
||||
repeated Callable member = 1;
|
||||
|
||||
extensions 100 to 199;
|
||||
}
|
||||
|
||||
message Callable {
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: core/serialization/src/builtins.proto
|
||||
|
||||
package org.jetbrains.jet.descriptors.serialization;
|
||||
|
||||
public final class BuiltInsProtoBuf {
|
||||
private BuiltInsProtoBuf() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
registry.add(org.jetbrains.jet.descriptors.serialization.BuiltInsProtoBuf.className);
|
||||
}
|
||||
public static final int CLASS_NAME_FIELD_NUMBER = 150;
|
||||
/**
|
||||
* <code>extend .org.jetbrains.jet.descriptors.serialization.Package { ... }</code>
|
||||
*/
|
||||
public static final
|
||||
com.google.protobuf.GeneratedMessageLite.GeneratedExtension<
|
||||
org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package,
|
||||
java.util.List<java.lang.Integer>> className = com.google.protobuf.GeneratedMessageLite
|
||||
.newRepeatedGeneratedExtension(
|
||||
org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package.getDefaultInstance(),
|
||||
null,
|
||||
null,
|
||||
150,
|
||||
com.google.protobuf.WireFormat.FieldType.INT32,
|
||||
true);
|
||||
|
||||
static {
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
||||
+2
@@ -418,6 +418,8 @@ public class DescriptorSerializer {
|
||||
}
|
||||
}
|
||||
|
||||
extension.serializePackage(fragments, builder, stringTable);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
@@ -7726,8 +7726,9 @@ public final class ProtoBuf {
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Class)
|
||||
}
|
||||
|
||||
public interface PackageOrBuilder
|
||||
extends com.google.protobuf.MessageLiteOrBuilder {
|
||||
public interface PackageOrBuilder extends
|
||||
com.google.protobuf.GeneratedMessageLite.
|
||||
ExtendableMessageOrBuilder<Package> {
|
||||
|
||||
// repeated .org.jetbrains.jet.descriptors.serialization.Callable member = 1;
|
||||
/**
|
||||
@@ -7748,10 +7749,10 @@ public final class ProtoBuf {
|
||||
* Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Package}
|
||||
*/
|
||||
public static final class Package extends
|
||||
com.google.protobuf.GeneratedMessageLite
|
||||
implements PackageOrBuilder {
|
||||
com.google.protobuf.GeneratedMessageLite.ExtendableMessage<
|
||||
Package> implements PackageOrBuilder {
|
||||
// Use Package.newBuilder() to construct.
|
||||
private Package(com.google.protobuf.GeneratedMessageLite.Builder builder) {
|
||||
private Package(com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package, ?> builder) {
|
||||
super(builder);
|
||||
|
||||
}
|
||||
@@ -7874,6 +7875,10 @@ public final class ProtoBuf {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!extensionsAreInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
@@ -7881,9 +7886,13 @@ public final class ProtoBuf {
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
com.google.protobuf.GeneratedMessageLite
|
||||
.ExtendableMessage<org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package>.ExtensionWriter extensionWriter =
|
||||
newExtensionWriter();
|
||||
for (int i = 0; i < member_.size(); i++) {
|
||||
output.writeMessage(1, member_.get(i));
|
||||
}
|
||||
extensionWriter.writeUntil(200, output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
@@ -7896,6 +7905,7 @@ public final class ProtoBuf {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, member_.get(i));
|
||||
}
|
||||
size += extensionsSerializedSize();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
@@ -7971,9 +7981,8 @@ public final class ProtoBuf {
|
||||
* Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Package}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageLite.Builder<
|
||||
org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package, Builder>
|
||||
implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.PackageOrBuilder {
|
||||
com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<
|
||||
org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package, Builder> implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.PackageOrBuilder {
|
||||
// Construct using org.jetbrains.jet.descriptors.serialization.ProtoBuf.Package.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
@@ -8031,6 +8040,7 @@ public final class ProtoBuf {
|
||||
}
|
||||
|
||||
}
|
||||
this.mergeExtensionFields(other);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -8041,6 +8051,10 @@ public final class ProtoBuf {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!extensionsAreInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+9
-1
@@ -18,10 +18,18 @@ package org.jetbrains.jet.descriptors.serialization;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PackageFragmentDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class SerializerExtension {
|
||||
public static final SerializerExtension DEFAULT = new SerializerExtension() {};
|
||||
public void serializePackage(
|
||||
@NotNull Collection<PackageFragmentDescriptor> packageFragments,
|
||||
@NotNull ProtoBuf.Package.Builder proto,
|
||||
@NotNull StringTable stringTable
|
||||
) {
|
||||
}
|
||||
|
||||
public void serializeCallable(
|
||||
@NotNull CallableMemberDescriptor callable,
|
||||
|
||||
Reference in New Issue
Block a user