Introduce PackageFragment protobuf message for kjsm/builtins/common metadata
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -442,3 +442,16 @@ message SinceKotlinInfo {
|
|||||||
message SinceKotlinInfoTable {
|
message SinceKotlinInfoTable {
|
||||||
repeated SinceKotlinInfo info = 1;
|
repeated SinceKotlinInfo info = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
|
||||||
|
// Is not used in the JVM back-end
|
||||||
|
message PackageFragment {
|
||||||
|
optional StringTable strings = 1;
|
||||||
|
optional QualifiedNameTable qualified_names = 2;
|
||||||
|
|
||||||
|
optional Package package = 3;
|
||||||
|
|
||||||
|
repeated Class class = 4;
|
||||||
|
|
||||||
|
extensions 100 to 199;
|
||||||
|
}
|
||||||
|
|||||||
@@ -21191,6 +21191,893 @@ public final class ProtoBuf {
|
|||||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.SinceKotlinInfoTable)
|
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.SinceKotlinInfoTable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface PackageFragmentOrBuilder extends
|
||||||
|
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.PackageFragment)
|
||||||
|
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.
|
||||||
|
ExtendableMessageOrBuilder<PackageFragment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
boolean hasStrings();
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.StringTable getStrings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
boolean hasQualifiedNames();
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable getQualifiedNames();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
boolean hasPackage();
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.Package getPackage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
java.util.List<org.jetbrains.kotlin.serialization.ProtoBuf.Class>
|
||||||
|
getClass_List();
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.Class getClass_(int index);
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
int getClass_Count();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code org.jetbrains.kotlin.serialization.PackageFragment}
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
|
||||||
|
* Is not used in the JVM back-end
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class PackageFragment extends
|
||||||
|
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.ExtendableMessage<
|
||||||
|
PackageFragment> implements
|
||||||
|
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.PackageFragment)
|
||||||
|
PackageFragmentOrBuilder {
|
||||||
|
// Use PackageFragment.newBuilder() to construct.
|
||||||
|
private PackageFragment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.ExtendableBuilder<org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment, ?> builder) {
|
||||||
|
super(builder);
|
||||||
|
this.unknownFields = builder.getUnknownFields();
|
||||||
|
}
|
||||||
|
private PackageFragment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}
|
||||||
|
|
||||||
|
private static final PackageFragment defaultInstance;
|
||||||
|
public static PackageFragment getDefaultInstance() {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PackageFragment getDefaultInstanceForType() {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||||
|
private PackageFragment(
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||||
|
initFields();
|
||||||
|
int mutable_bitField0_ = 0;
|
||||||
|
org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput =
|
||||||
|
org.jetbrains.kotlin.protobuf.ByteString.newOutput();
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput =
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance(
|
||||||
|
unknownFieldsOutput);
|
||||||
|
try {
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
int tag = input.readTag();
|
||||||
|
switch (tag) {
|
||||||
|
case 0:
|
||||||
|
done = true;
|
||||||
|
break;
|
||||||
|
default: {
|
||||||
|
if (!parseUnknownField(input, unknownFieldsCodedOutput,
|
||||||
|
extensionRegistry, tag)) {
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 10: {
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.Builder subBuilder = null;
|
||||||
|
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||||
|
subBuilder = strings_.toBuilder();
|
||||||
|
}
|
||||||
|
strings_ = input.readMessage(org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.PARSER, extensionRegistry);
|
||||||
|
if (subBuilder != null) {
|
||||||
|
subBuilder.mergeFrom(strings_);
|
||||||
|
strings_ = subBuilder.buildPartial();
|
||||||
|
}
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 18: {
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.Builder subBuilder = null;
|
||||||
|
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||||
|
subBuilder = qualifiedNames_.toBuilder();
|
||||||
|
}
|
||||||
|
qualifiedNames_ = input.readMessage(org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.PARSER, extensionRegistry);
|
||||||
|
if (subBuilder != null) {
|
||||||
|
subBuilder.mergeFrom(qualifiedNames_);
|
||||||
|
qualifiedNames_ = subBuilder.buildPartial();
|
||||||
|
}
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 26: {
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.Package.Builder subBuilder = null;
|
||||||
|
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||||
|
subBuilder = package_.toBuilder();
|
||||||
|
}
|
||||||
|
package_ = input.readMessage(org.jetbrains.kotlin.serialization.ProtoBuf.Package.PARSER, extensionRegistry);
|
||||||
|
if (subBuilder != null) {
|
||||||
|
subBuilder.mergeFrom(package_);
|
||||||
|
package_ = subBuilder.buildPartial();
|
||||||
|
}
|
||||||
|
bitField0_ |= 0x00000004;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 34: {
|
||||||
|
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||||
|
class__ = new java.util.ArrayList<org.jetbrains.kotlin.serialization.ProtoBuf.Class>();
|
||||||
|
mutable_bitField0_ |= 0x00000008;
|
||||||
|
}
|
||||||
|
class__.add(input.readMessage(org.jetbrains.kotlin.serialization.ProtoBuf.Class.PARSER, extensionRegistry));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.setUnfinishedMessage(this);
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||||
|
e.getMessage()).setUnfinishedMessage(this);
|
||||||
|
} finally {
|
||||||
|
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||||
|
class__ = java.util.Collections.unmodifiableList(class__);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
unknownFieldsCodedOutput.flush();
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
// Should not happen
|
||||||
|
} finally {
|
||||||
|
unknownFields = unknownFieldsOutput.toByteString();
|
||||||
|
}
|
||||||
|
makeExtensionsImmutable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.protobuf.Parser<PackageFragment> PARSER =
|
||||||
|
new org.jetbrains.kotlin.protobuf.AbstractParser<PackageFragment>() {
|
||||||
|
public PackageFragment parsePartialFrom(
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||||
|
return new PackageFragment(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public org.jetbrains.kotlin.protobuf.Parser<PackageFragment> getParserForType() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int bitField0_;
|
||||||
|
public static final int STRINGS_FIELD_NUMBER = 1;
|
||||||
|
private org.jetbrains.kotlin.serialization.ProtoBuf.StringTable strings_;
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public boolean hasStrings() {
|
||||||
|
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.StringTable getStrings() {
|
||||||
|
return strings_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int QUALIFIED_NAMES_FIELD_NUMBER = 2;
|
||||||
|
private org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable qualifiedNames_;
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public boolean hasQualifiedNames() {
|
||||||
|
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable getQualifiedNames() {
|
||||||
|
return qualifiedNames_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int PACKAGE_FIELD_NUMBER = 3;
|
||||||
|
private org.jetbrains.kotlin.serialization.ProtoBuf.Package package_;
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public boolean hasPackage() {
|
||||||
|
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.Package getPackage() {
|
||||||
|
return package_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int CLASS_FIELD_NUMBER = 4;
|
||||||
|
private java.util.List<org.jetbrains.kotlin.serialization.ProtoBuf.Class> class__;
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public java.util.List<org.jetbrains.kotlin.serialization.ProtoBuf.Class> getClass_List() {
|
||||||
|
return class__;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public java.util.List<? extends org.jetbrains.kotlin.serialization.ProtoBuf.ClassOrBuilder>
|
||||||
|
getClass_OrBuilderList() {
|
||||||
|
return class__;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public int getClass_Count() {
|
||||||
|
return class__.size();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.Class getClass_(int index) {
|
||||||
|
return class__.get(index);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.ClassOrBuilder getClass_OrBuilder(
|
||||||
|
int index) {
|
||||||
|
return class__.get(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initFields() {
|
||||||
|
strings_ = org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.getDefaultInstance();
|
||||||
|
qualifiedNames_ = org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.getDefaultInstance();
|
||||||
|
package_ = org.jetbrains.kotlin.serialization.ProtoBuf.Package.getDefaultInstance();
|
||||||
|
class__ = java.util.Collections.emptyList();
|
||||||
|
}
|
||||||
|
private byte memoizedIsInitialized = -1;
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
byte isInitialized = memoizedIsInitialized;
|
||||||
|
if (isInitialized == 1) return true;
|
||||||
|
if (isInitialized == 0) return false;
|
||||||
|
|
||||||
|
if (hasQualifiedNames()) {
|
||||||
|
if (!getQualifiedNames().isInitialized()) {
|
||||||
|
memoizedIsInitialized = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasPackage()) {
|
||||||
|
if (!getPackage().isInitialized()) {
|
||||||
|
memoizedIsInitialized = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < getClass_Count(); i++) {
|
||||||
|
if (!getClass_(i).isInitialized()) {
|
||||||
|
memoizedIsInitialized = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!extensionsAreInitialized()) {
|
||||||
|
memoizedIsInitialized = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
memoizedIsInitialized = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||||
|
throws java.io.IOException {
|
||||||
|
getSerializedSize();
|
||||||
|
org.jetbrains.kotlin.protobuf.GeneratedMessageLite
|
||||||
|
.ExtendableMessage<org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment>.ExtensionWriter extensionWriter =
|
||||||
|
newExtensionWriter();
|
||||||
|
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||||
|
output.writeMessage(1, strings_);
|
||||||
|
}
|
||||||
|
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||||
|
output.writeMessage(2, qualifiedNames_);
|
||||||
|
}
|
||||||
|
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||||
|
output.writeMessage(3, package_);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < class__.size(); i++) {
|
||||||
|
output.writeMessage(4, class__.get(i));
|
||||||
|
}
|
||||||
|
extensionWriter.writeUntil(200, output);
|
||||||
|
output.writeRawBytes(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int memoizedSerializedSize = -1;
|
||||||
|
public int getSerializedSize() {
|
||||||
|
int size = memoizedSerializedSize;
|
||||||
|
if (size != -1) return size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||||
|
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||||
|
.computeMessageSize(1, strings_);
|
||||||
|
}
|
||||||
|
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||||
|
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||||
|
.computeMessageSize(2, qualifiedNames_);
|
||||||
|
}
|
||||||
|
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||||
|
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||||
|
.computeMessageSize(3, package_);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < class__.size(); i++) {
|
||||||
|
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||||
|
.computeMessageSize(4, class__.get(i));
|
||||||
|
}
|
||||||
|
size += extensionsSerializedSize();
|
||||||
|
size += unknownFields.size();
|
||||||
|
memoizedSerializedSize = size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
@java.lang.Override
|
||||||
|
protected java.lang.Object writeReplace()
|
||||||
|
throws java.io.ObjectStreamException {
|
||||||
|
return super.writeReplace();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(
|
||||||
|
org.jetbrains.kotlin.protobuf.ByteString data)
|
||||||
|
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(
|
||||||
|
org.jetbrains.kotlin.protobuf.ByteString data,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(byte[] data)
|
||||||
|
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(
|
||||||
|
byte[] data,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return PARSER.parseFrom(input);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return PARSER.parseFrom(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseDelimitedFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return PARSER.parseDelimitedFrom(input);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseDelimitedFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return PARSER.parseFrom(input);
|
||||||
|
}
|
||||||
|
public static org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parseFrom(
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return PARSER.parseFrom(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Builder newBuilder() { return Builder.create(); }
|
||||||
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
|
public static Builder newBuilder(org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment prototype) {
|
||||||
|
return newBuilder().mergeFrom(prototype);
|
||||||
|
}
|
||||||
|
public Builder toBuilder() { return newBuilder(this); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code org.jetbrains.kotlin.serialization.PackageFragment}
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* A part of the package, which is used to serialize .kjsm/.meta.js, .kotlin_builtins and .kotlin_metadata files.
|
||||||
|
* Is not used in the JVM back-end
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class Builder extends
|
||||||
|
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.ExtendableBuilder<
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment, Builder> implements
|
||||||
|
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.PackageFragment)
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragmentOrBuilder {
|
||||||
|
// Construct using org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment.newBuilder()
|
||||||
|
private Builder() {
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void maybeForceBuilderInitialization() {
|
||||||
|
}
|
||||||
|
private static Builder create() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder clear() {
|
||||||
|
super.clear();
|
||||||
|
strings_ = org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.getDefaultInstance();
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000001);
|
||||||
|
qualifiedNames_ = org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.getDefaultInstance();
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000002);
|
||||||
|
package_ = org.jetbrains.kotlin.serialization.ProtoBuf.Package.getDefaultInstance();
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000004);
|
||||||
|
class__ = java.util.Collections.emptyList();
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000008);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder clone() {
|
||||||
|
return create().mergeFrom(buildPartial());
|
||||||
|
}
|
||||||
|
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment getDefaultInstanceForType() {
|
||||||
|
return org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment build() {
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment result = buildPartial();
|
||||||
|
if (!result.isInitialized()) {
|
||||||
|
throw newUninitializedMessageException(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment buildPartial() {
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment result = new org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment(this);
|
||||||
|
int from_bitField0_ = bitField0_;
|
||||||
|
int to_bitField0_ = 0;
|
||||||
|
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||||
|
to_bitField0_ |= 0x00000001;
|
||||||
|
}
|
||||||
|
result.strings_ = strings_;
|
||||||
|
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||||
|
to_bitField0_ |= 0x00000002;
|
||||||
|
}
|
||||||
|
result.qualifiedNames_ = qualifiedNames_;
|
||||||
|
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||||
|
to_bitField0_ |= 0x00000004;
|
||||||
|
}
|
||||||
|
result.package_ = package_;
|
||||||
|
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||||
|
class__ = java.util.Collections.unmodifiableList(class__);
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000008);
|
||||||
|
}
|
||||||
|
result.class__ = class__;
|
||||||
|
result.bitField0_ = to_bitField0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment other) {
|
||||||
|
if (other == org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment.getDefaultInstance()) return this;
|
||||||
|
if (other.hasStrings()) {
|
||||||
|
mergeStrings(other.getStrings());
|
||||||
|
}
|
||||||
|
if (other.hasQualifiedNames()) {
|
||||||
|
mergeQualifiedNames(other.getQualifiedNames());
|
||||||
|
}
|
||||||
|
if (other.hasPackage()) {
|
||||||
|
mergePackage(other.getPackage());
|
||||||
|
}
|
||||||
|
if (!other.class__.isEmpty()) {
|
||||||
|
if (class__.isEmpty()) {
|
||||||
|
class__ = other.class__;
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000008);
|
||||||
|
} else {
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.addAll(other.class__);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
this.mergeExtensionFields(other);
|
||||||
|
setUnknownFields(
|
||||||
|
getUnknownFields().concat(other.unknownFields));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
if (hasQualifiedNames()) {
|
||||||
|
if (!getQualifiedNames().isInitialized()) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasPackage()) {
|
||||||
|
if (!getPackage().isInitialized()) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < getClass_Count(); i++) {
|
||||||
|
if (!getClass_(i).isInitialized()) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!extensionsAreInitialized()) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(
|
||||||
|
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||||
|
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment parsedMessage = null;
|
||||||
|
try {
|
||||||
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||||
|
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
parsedMessage = (org.jetbrains.kotlin.serialization.ProtoBuf.PackageFragment) e.getUnfinishedMessage();
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
|
if (parsedMessage != null) {
|
||||||
|
mergeFrom(parsedMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
private int bitField0_;
|
||||||
|
|
||||||
|
private org.jetbrains.kotlin.serialization.ProtoBuf.StringTable strings_ = org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.getDefaultInstance();
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public boolean hasStrings() {
|
||||||
|
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.StringTable getStrings() {
|
||||||
|
return strings_;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public Builder setStrings(org.jetbrains.kotlin.serialization.ProtoBuf.StringTable value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
strings_ = value;
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public Builder setStrings(
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.Builder builderForValue) {
|
||||||
|
strings_ = builderForValue.build();
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public Builder mergeStrings(org.jetbrains.kotlin.serialization.ProtoBuf.StringTable value) {
|
||||||
|
if (((bitField0_ & 0x00000001) == 0x00000001) &&
|
||||||
|
strings_ != org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.getDefaultInstance()) {
|
||||||
|
strings_ =
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.newBuilder(strings_).mergeFrom(value).buildPartial();
|
||||||
|
} else {
|
||||||
|
strings_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000001;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.StringTable strings = 1;</code>
|
||||||
|
*/
|
||||||
|
public Builder clearStrings() {
|
||||||
|
strings_ = org.jetbrains.kotlin.serialization.ProtoBuf.StringTable.getDefaultInstance();
|
||||||
|
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000001);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable qualifiedNames_ = org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.getDefaultInstance();
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public boolean hasQualifiedNames() {
|
||||||
|
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable getQualifiedNames() {
|
||||||
|
return qualifiedNames_;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public Builder setQualifiedNames(org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
qualifiedNames_ = value;
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public Builder setQualifiedNames(
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.Builder builderForValue) {
|
||||||
|
qualifiedNames_ = builderForValue.build();
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public Builder mergeQualifiedNames(org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable value) {
|
||||||
|
if (((bitField0_ & 0x00000002) == 0x00000002) &&
|
||||||
|
qualifiedNames_ != org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.getDefaultInstance()) {
|
||||||
|
qualifiedNames_ =
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.newBuilder(qualifiedNames_).mergeFrom(value).buildPartial();
|
||||||
|
} else {
|
||||||
|
qualifiedNames_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000002;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.QualifiedNameTable qualified_names = 2;</code>
|
||||||
|
*/
|
||||||
|
public Builder clearQualifiedNames() {
|
||||||
|
qualifiedNames_ = org.jetbrains.kotlin.serialization.ProtoBuf.QualifiedNameTable.getDefaultInstance();
|
||||||
|
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000002);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private org.jetbrains.kotlin.serialization.ProtoBuf.Package package_ = org.jetbrains.kotlin.serialization.ProtoBuf.Package.getDefaultInstance();
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public boolean hasPackage() {
|
||||||
|
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.Package getPackage() {
|
||||||
|
return package_;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public Builder setPackage(org.jetbrains.kotlin.serialization.ProtoBuf.Package value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
package_ = value;
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000004;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public Builder setPackage(
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.Package.Builder builderForValue) {
|
||||||
|
package_ = builderForValue.build();
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000004;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public Builder mergePackage(org.jetbrains.kotlin.serialization.ProtoBuf.Package value) {
|
||||||
|
if (((bitField0_ & 0x00000004) == 0x00000004) &&
|
||||||
|
package_ != org.jetbrains.kotlin.serialization.ProtoBuf.Package.getDefaultInstance()) {
|
||||||
|
package_ =
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.Package.newBuilder(package_).mergeFrom(value).buildPartial();
|
||||||
|
} else {
|
||||||
|
package_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bitField0_ |= 0x00000004;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>optional .org.jetbrains.kotlin.serialization.Package package = 3;</code>
|
||||||
|
*/
|
||||||
|
public Builder clearPackage() {
|
||||||
|
package_ = org.jetbrains.kotlin.serialization.ProtoBuf.Package.getDefaultInstance();
|
||||||
|
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000004);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private java.util.List<org.jetbrains.kotlin.serialization.ProtoBuf.Class> class__ =
|
||||||
|
java.util.Collections.emptyList();
|
||||||
|
private void ensureClass_IsMutable() {
|
||||||
|
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||||
|
class__ = new java.util.ArrayList<org.jetbrains.kotlin.serialization.ProtoBuf.Class>(class__);
|
||||||
|
bitField0_ |= 0x00000008;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public java.util.List<org.jetbrains.kotlin.serialization.ProtoBuf.Class> getClass_List() {
|
||||||
|
return java.util.Collections.unmodifiableList(class__);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public int getClass_Count() {
|
||||||
|
return class__.size();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public org.jetbrains.kotlin.serialization.ProtoBuf.Class getClass_(int index) {
|
||||||
|
return class__.get(index);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder setClass_(
|
||||||
|
int index, org.jetbrains.kotlin.serialization.ProtoBuf.Class value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.set(index, value);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder setClass_(
|
||||||
|
int index, org.jetbrains.kotlin.serialization.ProtoBuf.Class.Builder builderForValue) {
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.set(index, builderForValue.build());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder addClass_(org.jetbrains.kotlin.serialization.ProtoBuf.Class value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.add(value);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder addClass_(
|
||||||
|
int index, org.jetbrains.kotlin.serialization.ProtoBuf.Class value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.add(index, value);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder addClass_(
|
||||||
|
org.jetbrains.kotlin.serialization.ProtoBuf.Class.Builder builderForValue) {
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.add(builderForValue.build());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder addClass_(
|
||||||
|
int index, org.jetbrains.kotlin.serialization.ProtoBuf.Class.Builder builderForValue) {
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.add(index, builderForValue.build());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder addAllClass_(
|
||||||
|
java.lang.Iterable<? extends org.jetbrains.kotlin.serialization.ProtoBuf.Class> values) {
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
|
||||||
|
values, class__);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder clearClass_() {
|
||||||
|
class__ = java.util.Collections.emptyList();
|
||||||
|
bitField0_ = (bitField0_ & ~0x00000008);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>repeated .org.jetbrains.kotlin.serialization.Class class = 4;</code>
|
||||||
|
*/
|
||||||
|
public Builder removeClass_(int index) {
|
||||||
|
ensureClass_IsMutable();
|
||||||
|
class__.remove(index);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.PackageFragment)
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
defaultInstance = new PackageFragment(true);
|
||||||
|
defaultInstance.initFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.PackageFragment)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -27,17 +27,17 @@ import org.jetbrains.kotlin.incremental.components.LookupTracker
|
|||||||
import org.jetbrains.kotlin.js.resolve.JsPlatform
|
import org.jetbrains.kotlin.js.resolve.JsPlatform
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.resolve.TargetPlatform
|
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||||
|
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.*
|
import org.jetbrains.kotlin.serialization.deserialization.*
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPackageMemberScope
|
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPackageMemberScope
|
||||||
import org.jetbrains.kotlin.serialization.js.DynamicTypeDeserializer
|
import org.jetbrains.kotlin.serialization.js.DynamicTypeDeserializer
|
||||||
import org.jetbrains.kotlin.serialization.js.JsProtoBuf
|
|
||||||
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
|
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
|
||||||
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptClassDataFinder
|
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptClassDataFinder
|
||||||
|
|
||||||
// TODO: deduplicate with KotlinBuiltInDeserializerForDecompiler
|
// TODO: deduplicate with KotlinBuiltInDeserializerForDecompiler
|
||||||
class KotlinJavaScriptDeserializerForDecompiler(
|
class KotlinJavaScriptDeserializerForDecompiler(
|
||||||
packageFqName: FqName,
|
packageFqName: FqName,
|
||||||
private val proto: JsProtoBuf.Library.Part,
|
private val proto: ProtoBuf.PackageFragment,
|
||||||
private val nameResolver: NameResolver
|
private val nameResolver: NameResolver
|
||||||
) : DeserializerForDecompilerBase(packageFqName) {
|
) : DeserializerForDecompilerBase(packageFqName) {
|
||||||
override val targetPlatform: TargetPlatform get() = JsPlatform
|
override val targetPlatform: TargetPlatform get() = JsPlatform
|
||||||
|
|||||||
+4
-4
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.idea.decompiler.textBuilder.buildDecompiledText
|
|||||||
import org.jetbrains.kotlin.idea.decompiler.textBuilder.defaultDecompilerRendererOptions
|
import org.jetbrains.kotlin.idea.decompiler.textBuilder.defaultDecompilerRendererOptions
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||||
|
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolverImpl
|
import org.jetbrains.kotlin.serialization.deserialization.NameResolverImpl
|
||||||
import org.jetbrains.kotlin.serialization.js.JsProtoBuf
|
import org.jetbrains.kotlin.serialization.js.JsProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
|
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
|
||||||
@@ -88,7 +89,7 @@ fun buildDecompiledTextFromJsMetadata(kjsmFile: VirtualFile): DecompiledText {
|
|||||||
sealed class KjsmFile {
|
sealed class KjsmFile {
|
||||||
class Incompatible(val version: JsMetadataVersion) : KjsmFile()
|
class Incompatible(val version: JsMetadataVersion) : KjsmFile()
|
||||||
|
|
||||||
class Compatible(val header: JsProtoBuf.Header, val proto: JsProtoBuf.Library.Part) : KjsmFile() {
|
class Compatible(val header: JsProtoBuf.Header, val proto: ProtoBuf.PackageFragment) : KjsmFile() {
|
||||||
val packageFqName = FqName(header.packageFqName)
|
val packageFqName = FqName(header.packageFqName)
|
||||||
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
|
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
|
||||||
|
|
||||||
@@ -106,10 +107,9 @@ sealed class KjsmFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val header = JsProtoBuf.Header.parseDelimitedFrom(stream)
|
val header = JsProtoBuf.Header.parseDelimitedFrom(stream)
|
||||||
val proto = JsProtoBuf.Library.Part.parseFrom(stream, JsSerializerProtocol.extensionRegistry)
|
val proto = ProtoBuf.PackageFragment.parseFrom(stream, JsSerializerProtocol.extensionRegistry)
|
||||||
val result = Compatible(header, proto)
|
|
||||||
|
|
||||||
return result
|
return Compatible(header, proto)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun readFileContentsSafely(file: VirtualFile): ByteArray? {
|
private fun readFileContentsSafely(file: VirtualFile): ByteArray? {
|
||||||
|
|||||||
@@ -84,6 +84,10 @@ extend TypeParameter {
|
|||||||
repeated Annotation type_parameter_annotation = 130;
|
repeated Annotation type_parameter_annotation = 130;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extend PackageFragment {
|
||||||
|
optional Files package_fragment_files = 130;
|
||||||
|
}
|
||||||
|
|
||||||
message Classes {
|
message Classes {
|
||||||
// id in StringTable
|
// id in StringTable
|
||||||
repeated int32 class_name = 1 [packed = true];
|
repeated int32 class_name = 1 [packed = true];
|
||||||
@@ -97,22 +101,9 @@ message Library {
|
|||||||
UMD = 4;
|
UMD = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a copy of BuiltIns in builtins.proto
|
|
||||||
// TODO: combine the two
|
|
||||||
message Part {
|
|
||||||
optional StringTable strings = 1;
|
|
||||||
optional QualifiedNameTable qualified_names = 2;
|
|
||||||
|
|
||||||
optional Package package = 3;
|
|
||||||
|
|
||||||
repeated Class class = 4;
|
|
||||||
|
|
||||||
optional Files files = 130;
|
|
||||||
}
|
|
||||||
|
|
||||||
optional Kind kind = 1 [default = PLAIN];
|
optional Kind kind = 1 [default = PLAIN];
|
||||||
|
|
||||||
repeated Part part = 2;
|
repeated PackageFragment package_fragment = 2;
|
||||||
|
|
||||||
repeated string imported_module = 3;
|
repeated string imported_module = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -20,11 +20,12 @@ import org.jetbrains.kotlin.descriptors.SourceElement
|
|||||||
import org.jetbrains.kotlin.name.ClassId
|
import org.jetbrains.kotlin.name.ClassId
|
||||||
import org.jetbrains.kotlin.serialization.ClassData
|
import org.jetbrains.kotlin.serialization.ClassData
|
||||||
import org.jetbrains.kotlin.serialization.ClassDataWithSource
|
import org.jetbrains.kotlin.serialization.ClassDataWithSource
|
||||||
|
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.ClassDataFinder
|
import org.jetbrains.kotlin.serialization.deserialization.ClassDataFinder
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||||
|
|
||||||
class KotlinJavascriptClassDataFinder(
|
class KotlinJavascriptClassDataFinder(
|
||||||
proto: JsProtoBuf.Library.Part,
|
proto: ProtoBuf.PackageFragment,
|
||||||
private val nameResolver: NameResolver
|
private val nameResolver: NameResolver
|
||||||
) : ClassDataFinder {
|
) : ClassDataFinder {
|
||||||
private val classIdToProto =
|
private val classIdToProto =
|
||||||
|
|||||||
+2
-2
@@ -38,11 +38,11 @@ class KotlinJavascriptPackageFragment(
|
|||||||
fqName: FqName,
|
fqName: FqName,
|
||||||
storageManager: StorageManager,
|
storageManager: StorageManager,
|
||||||
module: ModuleDescriptor,
|
module: ModuleDescriptor,
|
||||||
private val proto: JsProtoBuf.Library.Part,
|
private val proto: ProtoBuf.PackageFragment,
|
||||||
private val nameResolver: NameResolver
|
private val nameResolver: NameResolver
|
||||||
) : DeserializedPackageFragment(fqName, storageManager, module) {
|
) : DeserializedPackageFragment(fqName, storageManager, module) {
|
||||||
private val fileMap: Map<Int, FileHolder> by storageManager.createLazyValue {
|
private val fileMap: Map<Int, FileHolder> by storageManager.createLazyValue {
|
||||||
proto.files.fileList.withIndex().associate { (index, file) ->
|
proto.getExtension(JsProtoBuf.packageFragmentFiles).fileList.withIndex().associate { (index, file) ->
|
||||||
(if (file.hasId()) file.id else index) to FileHolder(file.annotationList)
|
(if (file.hasId()) file.id else index) to FileHolder(file.annotationList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-11
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
|||||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||||
import org.jetbrains.kotlin.serialization.AnnotationSerializer
|
import org.jetbrains.kotlin.serialization.AnnotationSerializer
|
||||||
import org.jetbrains.kotlin.serialization.DescriptorSerializer
|
import org.jetbrains.kotlin.serialization.DescriptorSerializer
|
||||||
|
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration
|
import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration
|
||||||
import org.jetbrains.kotlin.storage.StorageManager
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
import org.jetbrains.kotlin.utils.JsMetadataVersion
|
import org.jetbrains.kotlin.utils.JsMetadataVersion
|
||||||
@@ -46,7 +47,7 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
return jsModule.copy(createKotlinJavascriptPackageFragmentProvider(storageManager, module, jsModule.data, configuration))
|
return jsModule.copy(createKotlinJavascriptPackageFragmentProvider(storageManager, module, jsModule.data, configuration))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun serializeMetadata(
|
private fun serializeMetadata(
|
||||||
bindingContext: BindingContext,
|
bindingContext: BindingContext,
|
||||||
module: ModuleDescriptor,
|
module: ModuleDescriptor,
|
||||||
moduleKind: ModuleKind,
|
moduleKind: ModuleKind,
|
||||||
@@ -67,9 +68,9 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
importedModules.forEach { builder.addImportedModule(it) }
|
importedModules.forEach { builder.addImportedModule(it) }
|
||||||
|
|
||||||
for (fqName in getPackagesFqNames(module)) {
|
for (fqName in getPackagesFqNames(module)) {
|
||||||
val part = serializePackage(bindingContext, module, fqName)
|
val fragment = serializePackageFragment(bindingContext, module, fqName)
|
||||||
if (part.hasPackage() || part.class_Count > 0) {
|
if (fragment.hasPackage() || fragment.class_Count > 0) {
|
||||||
builder.addPart(part)
|
builder.addPackageFragment(fragment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,8 +80,8 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
fun metadataAsString(bindingContext: BindingContext, jsDescriptor: JsModuleDescriptor<ModuleDescriptor>): String =
|
fun metadataAsString(bindingContext: BindingContext, jsDescriptor: JsModuleDescriptor<ModuleDescriptor>): String =
|
||||||
KotlinJavascriptMetadataUtils.formatMetadataAsString(jsDescriptor.name, jsDescriptor.serializeToBinaryMetadata(bindingContext))
|
KotlinJavascriptMetadataUtils.formatMetadataAsString(jsDescriptor.name, jsDescriptor.serializeToBinaryMetadata(bindingContext))
|
||||||
|
|
||||||
fun serializePackage(bindingContext: BindingContext, module: ModuleDescriptor, fqName: FqName): JsProtoBuf.Library.Part {
|
private fun serializePackageFragment(bindingContext: BindingContext, module: ModuleDescriptor, fqName: FqName): ProtoBuf.PackageFragment {
|
||||||
val builder = JsProtoBuf.Library.Part.newBuilder()
|
val builder = ProtoBuf.PackageFragment.newBuilder()
|
||||||
|
|
||||||
val packageView = module.getPackage(fqName)
|
val packageView = module.getPackage(fqName)
|
||||||
|
|
||||||
@@ -122,7 +123,10 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
setExtension(JsProtoBuf.packageFqName, stringTable.getPackageFqNameIndex(fqName))
|
setExtension(JsProtoBuf.packageFqName, stringTable.getPackageFqNameIndex(fqName))
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
builder.files = serializeFiles(fileRegistry, bindingContext, AnnotationSerializer(stringTable))
|
builder.setExtension(
|
||||||
|
JsProtoBuf.packageFragmentFiles,
|
||||||
|
serializeFiles(fileRegistry, bindingContext, AnnotationSerializer(stringTable))
|
||||||
|
)
|
||||||
|
|
||||||
val (strings, qualifiedNames) = stringTable.buildProto()
|
val (strings, qualifiedNames) = stringTable.buildProto()
|
||||||
builder.strings = strings
|
builder.strings = strings
|
||||||
@@ -155,7 +159,7 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
val contentMap = hashMapOf<String, ByteArray>()
|
val contentMap = hashMapOf<String, ByteArray>()
|
||||||
|
|
||||||
for (fqName in getPackagesFqNames(module)) {
|
for (fqName in getPackagesFqNames(module)) {
|
||||||
val part = serializePackage(bindingContext, module, fqName)
|
val part = serializePackageFragment(bindingContext, module, fqName)
|
||||||
if (part.class_Count == 0 && part.`package`.let { packageProto ->
|
if (part.class_Count == 0 && part.`package`.let { packageProto ->
|
||||||
packageProto.functionCount == 0 && packageProto.propertyCount == 0 && packageProto.typeAliasCount == 0
|
packageProto.functionCount == 0 && packageProto.propertyCount == 0 && packageProto.typeAliasCount == 0
|
||||||
}) continue
|
}) continue
|
||||||
@@ -176,7 +180,7 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
return contentMap
|
return contentMap
|
||||||
}
|
}
|
||||||
|
|
||||||
fun serializeHeader(packageFqName: FqName?): JsProtoBuf.Header {
|
private fun serializeHeader(packageFqName: FqName?): JsProtoBuf.Header {
|
||||||
val header = JsProtoBuf.Header.newBuilder()
|
val header = JsProtoBuf.Header.newBuilder()
|
||||||
|
|
||||||
if (packageFqName != null) {
|
if (packageFqName != null) {
|
||||||
@@ -218,7 +222,7 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
}.toByteArray()
|
}.toByteArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun ByteArray.deserializeToLibraryParts(name: String): JsModuleDescriptor<List<JsProtoBuf.Library.Part>> {
|
private fun ByteArray.deserializeToLibraryParts(name: String): JsModuleDescriptor<List<ProtoBuf.PackageFragment>> {
|
||||||
val content = GZIPInputStream(ByteArrayInputStream(this)).use { stream ->
|
val content = GZIPInputStream(ByteArrayInputStream(this)).use { stream ->
|
||||||
JsProtoBuf.Header.parseDelimitedFrom(stream, JsSerializerProtocol.extensionRegistry)
|
JsProtoBuf.Header.parseDelimitedFrom(stream, JsSerializerProtocol.extensionRegistry)
|
||||||
JsProtoBuf.Library.parseFrom(stream, JsSerializerProtocol.extensionRegistry)
|
JsProtoBuf.Library.parseFrom(stream, JsSerializerProtocol.extensionRegistry)
|
||||||
@@ -226,7 +230,7 @@ object KotlinJavascriptSerializationUtil {
|
|||||||
|
|
||||||
return JsModuleDescriptor(
|
return JsModuleDescriptor(
|
||||||
name = name,
|
name = name,
|
||||||
data = content.partList,
|
data = content.packageFragmentList,
|
||||||
kind = when (content.kind) {
|
kind = when (content.kind) {
|
||||||
null, JsProtoBuf.Library.Kind.PLAIN -> ModuleKind.PLAIN
|
null, JsProtoBuf.Library.Kind.PLAIN -> ModuleKind.PLAIN
|
||||||
JsProtoBuf.Library.Kind.AMD -> ModuleKind.AMD
|
JsProtoBuf.Library.Kind.AMD -> ModuleKind.AMD
|
||||||
|
|||||||
+7
-6
@@ -20,23 +20,24 @@ import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
|||||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider
|
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider
|
||||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProviderImpl
|
import org.jetbrains.kotlin.descriptors.PackageFragmentProviderImpl
|
||||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||||
|
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.*
|
import org.jetbrains.kotlin.serialization.deserialization.*
|
||||||
import org.jetbrains.kotlin.storage.StorageManager
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
|
|
||||||
fun createKotlinJavascriptPackageFragmentProvider(
|
fun createKotlinJavascriptPackageFragmentProvider(
|
||||||
storageManager: StorageManager,
|
storageManager: StorageManager,
|
||||||
module: ModuleDescriptor,
|
module: ModuleDescriptor,
|
||||||
libraryParts: List<JsProtoBuf.Library.Part>,
|
packageFragmentProtos: List<ProtoBuf.PackageFragment>,
|
||||||
configuration: DeserializationConfiguration
|
configuration: DeserializationConfiguration
|
||||||
): PackageFragmentProvider {
|
): PackageFragmentProvider {
|
||||||
val packageFragments = libraryParts.map { part ->
|
val packageFragments = packageFragmentProtos.map { proto ->
|
||||||
val nameResolver = NameResolverImpl(part.strings, part.qualifiedNames)
|
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
|
||||||
val fqName = when {
|
val fqName = when {
|
||||||
part.hasPackage() -> nameResolver.getPackageFqName(part.`package`.getExtension(JsProtoBuf.packageFqName))
|
proto.hasPackage() -> nameResolver.getPackageFqName(proto.`package`.getExtension(JsProtoBuf.packageFqName))
|
||||||
part.class_Count > 0 -> nameResolver.getClassId(part.class_OrBuilderList.first().fqName).packageFqName
|
proto.class_Count > 0 -> nameResolver.getClassId(proto.class_OrBuilderList.first().fqName).packageFqName
|
||||||
else -> throw IllegalStateException("Invalid library part: either a Package or a Class must be present")
|
else -> throw IllegalStateException("Invalid library part: either a Package or a Class must be present")
|
||||||
}
|
}
|
||||||
KotlinJavascriptPackageFragment(fqName, storageManager, module, part, nameResolver)
|
KotlinJavascriptPackageFragment(fqName, storageManager, module, proto, nameResolver)
|
||||||
}
|
}
|
||||||
|
|
||||||
val provider = PackageFragmentProviderImpl(packageFragments)
|
val provider = PackageFragmentProviderImpl(packageFragments)
|
||||||
|
|||||||
Reference in New Issue
Block a user