[Gradle] Ide Dependency Resolution: Provide attributes for binary coordinates
^KT-60053 Verification Pending
This commit is contained in:
committed by
Space Team
parent
6140854fa6
commit
3032d02ce9
+684
@@ -0,0 +1,684 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: proto_tcs.proto
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.proto.generated.tcs;
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto}
|
||||
*/
|
||||
public final class IdeaKotlinBinaryAttributesProto extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)
|
||||
IdeaKotlinBinaryAttributesProtoOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use IdeaKotlinBinaryAttributesProto.newBuilder() to construct.
|
||||
private IdeaKotlinBinaryAttributesProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private IdeaKotlinBinaryAttributesProto() {
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new IdeaKotlinBinaryAttributesProto();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ProtoTcs.internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.MapField internalGetMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return internalGetAttributes();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ProtoTcs.internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.class, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder.class);
|
||||
}
|
||||
|
||||
public static final int ATTRIBUTES_FIELD_NUMBER = 1;
|
||||
private static final class AttributesDefaultEntryHolder {
|
||||
static final com.google.protobuf.MapEntry<
|
||||
java.lang.String, java.lang.String> defaultEntry =
|
||||
com.google.protobuf.MapEntry
|
||||
.<java.lang.String, java.lang.String>newDefaultInstance(
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ProtoTcs.internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_AttributesEntry_descriptor,
|
||||
com.google.protobuf.WireFormat.FieldType.STRING,
|
||||
"",
|
||||
com.google.protobuf.WireFormat.FieldType.STRING,
|
||||
"");
|
||||
}
|
||||
private com.google.protobuf.MapField<
|
||||
java.lang.String, java.lang.String> attributes_;
|
||||
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
|
||||
internalGetAttributes() {
|
||||
if (attributes_ == null) {
|
||||
return com.google.protobuf.MapField.emptyMapField(
|
||||
AttributesDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
return attributes_;
|
||||
}
|
||||
|
||||
public int getAttributesCount() {
|
||||
return internalGetAttributes().getMap().size();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
|
||||
@java.lang.Override
|
||||
public boolean containsAttributes(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
return internalGetAttributes().getMap().containsKey(key);
|
||||
}
|
||||
/**
|
||||
* Use {@link #getAttributesMap()} instead.
|
||||
*/
|
||||
@java.lang.Override
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAttributes() {
|
||||
return getAttributesMap();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() {
|
||||
return internalGetAttributes().getMap();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
|
||||
public java.lang.String getAttributesOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAttributes().getMap();
|
||||
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
|
||||
public java.lang.String getAttributesOrThrow(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAttributes().getMap();
|
||||
if (!map.containsKey(key)) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
com.google.protobuf.GeneratedMessageV3
|
||||
.serializeStringMapTo(
|
||||
output,
|
||||
internalGetAttributes(),
|
||||
AttributesDefaultEntryHolder.defaultEntry,
|
||||
1);
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
|
||||
: internalGetAttributes().getMap().entrySet()) {
|
||||
com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
|
||||
attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType()
|
||||
.setKey(entry.getKey())
|
||||
.setValue(entry.getValue())
|
||||
.build();
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, attributes__);
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto other = (org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto) obj;
|
||||
|
||||
if (!internalGetAttributes().equals(
|
||||
other.internalGetAttributes())) return false;
|
||||
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
if (!internalGetAttributes().getMap().isEmpty()) {
|
||||
hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
|
||||
hash = (53 * hash) + internalGetAttributes().hashCode();
|
||||
}
|
||||
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ProtoTcs.internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected com.google.protobuf.MapField internalGetMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return internalGetAttributes();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected com.google.protobuf.MapField internalGetMutableMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return internalGetMutableAttributes();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ProtoTcs.internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.class, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.newBuilder()
|
||||
private Builder() {
|
||||
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
internalGetMutableAttributes().clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ProtoTcs.internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto getDefaultInstanceForType() {
|
||||
return org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto build() {
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto buildPartial() {
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto result = new org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
result.attributes_ = internalGetAttributes();
|
||||
result.attributes_.makeImmutable();
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto) {
|
||||
return mergeFrom((org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto other) {
|
||||
if (other == org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance()) return this;
|
||||
internalGetMutableAttributes().mergeFrom(
|
||||
other.internalGetAttributes());
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 10: {
|
||||
com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
|
||||
attributes__ = input.readMessage(
|
||||
AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
|
||||
internalGetMutableAttributes().getMutableMap().put(
|
||||
attributes__.getKey(), attributes__.getValue());
|
||||
break;
|
||||
} // case 10
|
||||
default: {
|
||||
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||
done = true; // was an endgroup tag
|
||||
}
|
||||
break;
|
||||
} // default:
|
||||
} // switch (tag)
|
||||
} // while (!done)
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
onChanged();
|
||||
} // finally
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private com.google.protobuf.MapField<
|
||||
java.lang.String, java.lang.String> attributes_;
|
||||
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
|
||||
internalGetAttributes() {
|
||||
if (attributes_ == null) {
|
||||
return com.google.protobuf.MapField.emptyMapField(
|
||||
AttributesDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
return attributes_;
|
||||
}
|
||||
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
|
||||
internalGetMutableAttributes() {
|
||||
onChanged();;
|
||||
if (attributes_ == null) {
|
||||
attributes_ = com.google.protobuf.MapField.newMapField(
|
||||
AttributesDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
if (!attributes_.isMutable()) {
|
||||
attributes_ = attributes_.copy();
|
||||
}
|
||||
return attributes_;
|
||||
}
|
||||
|
||||
public int getAttributesCount() {
|
||||
return internalGetAttributes().getMap().size();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
|
||||
@java.lang.Override
|
||||
public boolean containsAttributes(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
return internalGetAttributes().getMap().containsKey(key);
|
||||
}
|
||||
/**
|
||||
* Use {@link #getAttributesMap()} instead.
|
||||
*/
|
||||
@java.lang.Override
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAttributes() {
|
||||
return getAttributesMap();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
|
||||
public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() {
|
||||
return internalGetAttributes().getMap();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
|
||||
public java.lang.String getAttributesOrDefault(
|
||||
java.lang.String key,
|
||||
java.lang.String defaultValue) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAttributes().getMap();
|
||||
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
|
||||
public java.lang.String getAttributesOrThrow(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
java.util.Map<java.lang.String, java.lang.String> map =
|
||||
internalGetAttributes().getMap();
|
||||
if (!map.containsKey(key)) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public Builder clearAttributes() {
|
||||
internalGetMutableAttributes().getMutableMap()
|
||||
.clear();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
|
||||
public Builder removeAttributes(
|
||||
java.lang.String key) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
internalGetMutableAttributes().getMutableMap()
|
||||
.remove(key);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Use alternate mutation accessors instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.String, java.lang.String>
|
||||
getMutableAttributes() {
|
||||
return internalGetMutableAttributes().getMutableMap();
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
public Builder putAttributes(
|
||||
java.lang.String key,
|
||||
java.lang.String value) {
|
||||
if (key == null) { throw new NullPointerException("map key"); }
|
||||
if (value == null) {
|
||||
throw new NullPointerException("map value");
|
||||
}
|
||||
|
||||
internalGetMutableAttributes().getMutableMap()
|
||||
.put(key, value);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
|
||||
public Builder putAllAttributes(
|
||||
java.util.Map<java.lang.String, java.lang.String> values) {
|
||||
internalGetMutableAttributes().getMutableMap()
|
||||
.putAll(values);
|
||||
return this;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)
|
||||
private static final org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto();
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<IdeaKotlinBinaryAttributesProto>
|
||||
PARSER = new com.google.protobuf.AbstractParser<IdeaKotlinBinaryAttributesProto>() {
|
||||
@java.lang.Override
|
||||
public IdeaKotlinBinaryAttributesProto parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
Builder builder = newBuilder();
|
||||
try {
|
||||
builder.mergeFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(builder.buildPartial());
|
||||
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(e)
|
||||
.setUnfinishedMessage(builder.buildPartial());
|
||||
}
|
||||
return builder.buildPartial();
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<IdeaKotlinBinaryAttributesProto> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<IdeaKotlinBinaryAttributesProto> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: proto_tcs.proto
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.proto.generated.tcs;
|
||||
|
||||
public interface IdeaKotlinBinaryAttributesProtoOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
int getAttributesCount();
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
boolean containsAttributes(
|
||||
java.lang.String key);
|
||||
/**
|
||||
* Use {@link #getAttributesMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getAttributes();
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.String, java.lang.String>
|
||||
getAttributesMap();
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
|
||||
/* nullable */
|
||||
java.lang.String getAttributesOrDefault(
|
||||
java.lang.String key,
|
||||
/* nullable */
|
||||
java.lang.String defaultValue);
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
|
||||
java.lang.String getAttributesOrThrow(
|
||||
java.lang.String key);
|
||||
}
|
||||
+195
-2
@@ -273,6 +273,32 @@ private static final long serialVersionUID = 0L;
|
||||
return capabilities_.get(index);
|
||||
}
|
||||
|
||||
public static final int ATTRIBUTES_FIELD_NUMBER = 6;
|
||||
private org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes_;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return Whether the attributes field is set.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public boolean hasAttributes() {
|
||||
return ((bitField0_ & 0x00000010) != 0);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return The attributes.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto getAttributes() {
|
||||
return attributes_ == null ? org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance() : attributes_;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder getAttributesOrBuilder() {
|
||||
return attributes_ == null ? org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance() : attributes_;
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
@@ -302,6 +328,9 @@ private static final long serialVersionUID = 0L;
|
||||
for (int i = 0; i < capabilities_.size(); i++) {
|
||||
output.writeMessage(5, capabilities_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) != 0)) {
|
||||
output.writeMessage(6, getAttributes());
|
||||
}
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
@@ -327,6 +356,10 @@ private static final long serialVersionUID = 0L;
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(5, capabilities_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) != 0)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(6, getAttributes());
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
@@ -364,6 +397,11 @@ private static final long serialVersionUID = 0L;
|
||||
}
|
||||
if (!getCapabilitiesList()
|
||||
.equals(other.getCapabilitiesList())) return false;
|
||||
if (hasAttributes() != other.hasAttributes()) return false;
|
||||
if (hasAttributes()) {
|
||||
if (!getAttributes()
|
||||
.equals(other.getAttributes())) return false;
|
||||
}
|
||||
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
|
||||
return true;
|
||||
}
|
||||
@@ -395,6 +433,10 @@ private static final long serialVersionUID = 0L;
|
||||
hash = (37 * hash) + CAPABILITIES_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getCapabilitiesList().hashCode();
|
||||
}
|
||||
if (hasAttributes()) {
|
||||
hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getAttributes().hashCode();
|
||||
}
|
||||
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
@@ -512,13 +554,20 @@ private static final long serialVersionUID = 0L;
|
||||
|
||||
// Construct using org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProto.newBuilder()
|
||||
private Builder() {
|
||||
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
getCapabilitiesFieldBuilder();
|
||||
getAttributesFieldBuilder();
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
@@ -538,6 +587,12 @@ private static final long serialVersionUID = 0L;
|
||||
capabilitiesBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
if (attributesBuilder_ == null) {
|
||||
attributes_ = null;
|
||||
} else {
|
||||
attributesBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -591,6 +646,14 @@ private static final long serialVersionUID = 0L;
|
||||
} else {
|
||||
result.capabilities_ = capabilitiesBuilder_.build();
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000020) != 0)) {
|
||||
if (attributesBuilder_ == null) {
|
||||
result.attributes_ = attributes_;
|
||||
} else {
|
||||
result.attributes_ = attributesBuilder_.build();
|
||||
}
|
||||
to_bitField0_ |= 0x00000010;
|
||||
}
|
||||
result.bitField0_ = to_bitField0_;
|
||||
onBuilt();
|
||||
return result;
|
||||
@@ -686,6 +749,9 @@ private static final long serialVersionUID = 0L;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (other.hasAttributes()) {
|
||||
mergeAttributes(other.getAttributes());
|
||||
}
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
onChanged();
|
||||
return this;
|
||||
@@ -745,6 +811,13 @@ private static final long serialVersionUID = 0L;
|
||||
}
|
||||
break;
|
||||
} // case 42
|
||||
case 50: {
|
||||
input.readMessage(
|
||||
getAttributesFieldBuilder().getBuilder(),
|
||||
extensionRegistry);
|
||||
bitField0_ |= 0x00000020;
|
||||
break;
|
||||
} // case 50
|
||||
default: {
|
||||
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||
done = true; // was an endgroup tag
|
||||
@@ -1333,6 +1406,126 @@ private static final long serialVersionUID = 0L;
|
||||
}
|
||||
return capabilitiesBuilder_;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes_;
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder> attributesBuilder_;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return Whether the attributes field is set.
|
||||
*/
|
||||
public boolean hasAttributes() {
|
||||
return ((bitField0_ & 0x00000020) != 0);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return The attributes.
|
||||
*/
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto getAttributes() {
|
||||
if (attributesBuilder_ == null) {
|
||||
return attributes_ == null ? org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance() : attributes_;
|
||||
} else {
|
||||
return attributesBuilder_.getMessage();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
public Builder setAttributes(org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto value) {
|
||||
if (attributesBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
attributes_ = value;
|
||||
onChanged();
|
||||
} else {
|
||||
attributesBuilder_.setMessage(value);
|
||||
}
|
||||
bitField0_ |= 0x00000020;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
public Builder setAttributes(
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder builderForValue) {
|
||||
if (attributesBuilder_ == null) {
|
||||
attributes_ = builderForValue.build();
|
||||
onChanged();
|
||||
} else {
|
||||
attributesBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
bitField0_ |= 0x00000020;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
public Builder mergeAttributes(org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto value) {
|
||||
if (attributesBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00000020) != 0) &&
|
||||
attributes_ != null &&
|
||||
attributes_ != org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance()) {
|
||||
attributes_ =
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.newBuilder(attributes_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
attributes_ = value;
|
||||
}
|
||||
onChanged();
|
||||
} else {
|
||||
attributesBuilder_.mergeFrom(value);
|
||||
}
|
||||
bitField0_ |= 0x00000020;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
public Builder clearAttributes() {
|
||||
if (attributesBuilder_ == null) {
|
||||
attributes_ = null;
|
||||
onChanged();
|
||||
} else {
|
||||
attributesBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder getAttributesBuilder() {
|
||||
bitField0_ |= 0x00000020;
|
||||
onChanged();
|
||||
return getAttributesFieldBuilder().getBuilder();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder getAttributesOrBuilder() {
|
||||
if (attributesBuilder_ != null) {
|
||||
return attributesBuilder_.getMessageOrBuilder();
|
||||
} else {
|
||||
return attributes_ == null ?
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.getDefaultInstance() : attributes_;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
private com.google.protobuf.SingleFieldBuilderV3<
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder>
|
||||
getAttributesFieldBuilder() {
|
||||
if (attributesBuilder_ == null) {
|
||||
attributesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder, org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder>(
|
||||
getAttributes(),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
attributes_ = null;
|
||||
}
|
||||
return attributesBuilder_;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
|
||||
+15
@@ -98,4 +98,19 @@ public interface IdeaKotlinBinaryCoordinatesProtoOrBuilder extends
|
||||
*/
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCapabilityProtoOrBuilder getCapabilitiesOrBuilder(
|
||||
int index);
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return Whether the attributes field is set.
|
||||
*/
|
||||
boolean hasAttributes();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return The attributes.
|
||||
*/
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto getAttributes();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoOrBuilder getAttributesOrBuilder();
|
||||
}
|
||||
|
||||
+45
-14
@@ -59,6 +59,16 @@ public final class ProtoTcs {
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCapabilityProto_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_AttributesEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_AttributesEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinSourceCoordinatesProto_descriptor;
|
||||
static final
|
||||
@@ -133,23 +143,32 @@ public final class ProtoTcs {
|
||||
"tlinProjectCoordinatesProto\022\025\n\010build_id\030" +
|
||||
"\001 \001(\tH\000\210\001\001\022\031\n\014project_path\030\002 \001(\tH\001\210\001\001\022\031\n" +
|
||||
"\014project_name\030\003 \001(\tH\002\210\001\001B\013\n\t_build_idB\017\n" +
|
||||
"\r_project_pathB\017\n\r_project_name\"\241\002\n Idea" +
|
||||
"\r_project_pathB\017\n\r_project_name\"\240\003\n Idea" +
|
||||
"KotlinBinaryCoordinatesProto\022\022\n\005group\030\001 " +
|
||||
"\001(\tH\000\210\001\001\022\023\n\006module\030\002 \001(\tH\001\210\001\001\022\024\n\007version" +
|
||||
"\030\003 \001(\tH\002\210\001\001\022\034\n\017source_set_name\030\004 \001(\tH\003\210\001" +
|
||||
"\001\022k\n\014capabilities\030\005 \003(\0132U.org.jetbrains." +
|
||||
"kotlin.gradle.idea.proto.generated.tcs.I" +
|
||||
"deaKotlinBinaryCapabilityProtoB\010\n\006_group" +
|
||||
"B\t\n\007_moduleB\n\n\010_versionB\022\n\020_source_set_n" +
|
||||
"ame\"}\n\037IdeaKotlinBinaryCapabilityProto\022\022" +
|
||||
"\n\005group\030\001 \001(\tH\000\210\001\001\022\021\n\004name\030\002 \001(\tH\001\210\001\001\022\024\n" +
|
||||
"\007version\030\003 \001(\tH\002\210\001\001B\010\n\006_groupB\007\n\005_nameB\n" +
|
||||
"\n\010_version\"\317\001\n IdeaKotlinSourceCoordinat" +
|
||||
"esProto\022m\n\007project\030\001 \001(\0132W.org.jetbrains" +
|
||||
".kotlin.gradle.idea.proto.generated.tcs." +
|
||||
"IdeaKotlinProjectCoordinatesProtoH\000\210\001\001\022\034" +
|
||||
"\n\017source_set_name\030\002 \001(\tH\001\210\001\001B\n\n\010_project" +
|
||||
"B\022\n\020_source_set_nameB\002P\001b\006proto3"
|
||||
"deaKotlinBinaryCapabilityProto\022n\n\nattrib" +
|
||||
"utes\030\006 \001(\0132U.org.jetbrains.kotlin.gradle" +
|
||||
".idea.proto.generated.tcs.IdeaKotlinBina" +
|
||||
"ryAttributesProtoH\004\210\001\001B\010\n\006_groupB\t\n\007_mod" +
|
||||
"uleB\n\n\010_versionB\022\n\020_source_set_nameB\r\n\013_" +
|
||||
"attributes\"}\n\037IdeaKotlinBinaryCapability" +
|
||||
"Proto\022\022\n\005group\030\001 \001(\tH\000\210\001\001\022\021\n\004name\030\002 \001(\tH" +
|
||||
"\001\210\001\001\022\024\n\007version\030\003 \001(\tH\002\210\001\001B\010\n\006_groupB\007\n\005" +
|
||||
"_nameB\n\n\010_version\"\317\001\n\037IdeaKotlinBinaryAt" +
|
||||
"tributesProto\022y\n\nattributes\030\001 \003(\0132e.org." +
|
||||
"jetbrains.kotlin.gradle.idea.proto.gener" +
|
||||
"ated.tcs.IdeaKotlinBinaryAttributesProto" +
|
||||
".AttributesEntry\0321\n\017AttributesEntry\022\013\n\003k" +
|
||||
"ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\317\001\n IdeaKotl" +
|
||||
"inSourceCoordinatesProto\022m\n\007project\030\001 \001(" +
|
||||
"\0132W.org.jetbrains.kotlin.gradle.idea.pro" +
|
||||
"to.generated.tcs.IdeaKotlinProjectCoordi" +
|
||||
"natesProtoH\000\210\001\001\022\034\n\017source_set_name\030\002 \001(\t" +
|
||||
"H\001\210\001\001B\n\n\010_projectB\022\n\020_source_set_nameB\002P" +
|
||||
"\001b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
@@ -203,15 +222,27 @@ public final class ProtoTcs {
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCoordinatesProto_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCoordinatesProto_descriptor,
|
||||
new java.lang.String[] { "Group", "Module", "Version", "SourceSetName", "Capabilities", "Group", "Module", "Version", "SourceSetName", });
|
||||
new java.lang.String[] { "Group", "Module", "Version", "SourceSetName", "Capabilities", "Attributes", "Group", "Module", "Version", "SourceSetName", "Attributes", });
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCapabilityProto_descriptor =
|
||||
getDescriptor().getMessageTypes().get(8);
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCapabilityProto_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCapabilityProto_descriptor,
|
||||
new java.lang.String[] { "Group", "Name", "Version", "Group", "Name", "Version", });
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinSourceCoordinatesProto_descriptor =
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor =
|
||||
getDescriptor().getMessageTypes().get(9);
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor,
|
||||
new java.lang.String[] { "Attributes", });
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_AttributesEntry_descriptor =
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_descriptor.getNestedTypes().get(0);
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_AttributesEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryAttributesProto_AttributesEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinSourceCoordinatesProto_descriptor =
|
||||
getDescriptor().getMessageTypes().get(10);
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinSourceCoordinatesProto_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinSourceCoordinatesProto_descriptor,
|
||||
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
//Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: proto_tcs.proto
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.proto.generated.tcs;
|
||||
|
||||
@kotlin.jvm.JvmName("-initializeideaKotlinBinaryAttributesProto")
|
||||
inline fun ideaKotlinBinaryAttributesProto(block: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoKt.Dsl.() -> kotlin.Unit): org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto =
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoKt.Dsl._create(org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.newBuilder()).apply { block() }._build()
|
||||
object IdeaKotlinBinaryAttributesProtoKt {
|
||||
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
|
||||
@com.google.protobuf.kotlin.ProtoDslMarker
|
||||
class Dsl private constructor(
|
||||
private val _builder: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder
|
||||
) {
|
||||
companion object {
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@kotlin.PublishedApi
|
||||
internal fun _create(builder: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.Builder): Dsl = Dsl(builder)
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@kotlin.PublishedApi
|
||||
internal fun _build(): org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto = _builder.build()
|
||||
|
||||
/**
|
||||
* An uninstantiable, behaviorless type to represent the field in
|
||||
* generics.
|
||||
*/
|
||||
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
|
||||
class AttributesProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
val attributes: com.google.protobuf.kotlin.DslMap<kotlin.String, kotlin.String, AttributesProxy>
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@JvmName("getAttributesMap")
|
||||
get() = com.google.protobuf.kotlin.DslMap(
|
||||
_builder.getAttributesMap()
|
||||
)
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@JvmName("putAttributes")
|
||||
fun com.google.protobuf.kotlin.DslMap<kotlin.String, kotlin.String, AttributesProxy>
|
||||
.put(key: kotlin.String, value: kotlin.String) {
|
||||
_builder.putAttributes(key, value)
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@JvmName("setAttributes")
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline operator fun com.google.protobuf.kotlin.DslMap<kotlin.String, kotlin.String, AttributesProxy>
|
||||
.set(key: kotlin.String, value: kotlin.String) {
|
||||
put(key, value)
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@JvmName("removeAttributes")
|
||||
fun com.google.protobuf.kotlin.DslMap<kotlin.String, kotlin.String, AttributesProxy>
|
||||
.remove(key: kotlin.String) {
|
||||
_builder.removeAttributes(key)
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@JvmName("putAllAttributes")
|
||||
fun com.google.protobuf.kotlin.DslMap<kotlin.String, kotlin.String, AttributesProxy>
|
||||
.putAll(map: kotlin.collections.Map<kotlin.String, kotlin.String>) {
|
||||
_builder.putAllAttributes(map)
|
||||
}
|
||||
/**
|
||||
* <code>map<string, string> attributes = 1;</code>
|
||||
*/
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
@JvmName("clearAttributes")
|
||||
fun com.google.protobuf.kotlin.DslMap<kotlin.String, kotlin.String, AttributesProxy>
|
||||
.clear() {
|
||||
_builder.clearAttributes()
|
||||
}
|
||||
}
|
||||
}
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
inline fun org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto.copy(block: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoKt.Dsl.() -> kotlin.Unit): org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto =
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProtoKt.Dsl._create(this.toBuilder()).apply { block() }._build()
|
||||
|
||||
+29
@@ -189,9 +189,38 @@ object IdeaKotlinBinaryCoordinatesProtoKt {
|
||||
_builder.clearCapabilities()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
var attributes: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto
|
||||
@JvmName("getAttributes")
|
||||
get() = _builder.getAttributes()
|
||||
@JvmName("setAttributes")
|
||||
set(value) {
|
||||
_builder.setAttributes(value)
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
*/
|
||||
fun clearAttributes() {
|
||||
_builder.clearAttributes()
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto attributes = 6;</code>
|
||||
* @return Whether the attributes field is set.
|
||||
*/
|
||||
fun hasAttributes(): kotlin.Boolean {
|
||||
return _builder.hasAttributes()
|
||||
}
|
||||
val IdeaKotlinBinaryCoordinatesProtoKt.Dsl.attributesOrNull: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto?
|
||||
get() = _builder.attributesOrNull
|
||||
}
|
||||
}
|
||||
@kotlin.jvm.JvmSynthetic
|
||||
inline fun org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProto.copy(block: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProtoKt.Dsl.() -> kotlin.Unit): org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProto =
|
||||
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProtoKt.Dsl._create(this.toBuilder()).apply { block() }._build()
|
||||
|
||||
val org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProtoOrBuilder.attributesOrNull: org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto?
|
||||
get() = if (hasAttributes()) getAttributes() else null
|
||||
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.proto.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto
|
||||
import org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.ideaKotlinBinaryAttributesProto
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryAttributes
|
||||
|
||||
internal fun IdeaKotlinBinaryAttributesProto(
|
||||
attributes: IdeaKotlinBinaryAttributes,
|
||||
): IdeaKotlinBinaryAttributesProto {
|
||||
return ideaKotlinBinaryAttributesProto {
|
||||
this.attributes.putAll(attributes)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun IdeaKotlinBinaryAttributes(proto: IdeaKotlinBinaryAttributesProto): IdeaKotlinBinaryAttributes {
|
||||
return IdeaKotlinBinaryAttributes(proto.attributesMap)
|
||||
}
|
||||
+3
-1
@@ -20,6 +20,7 @@ internal fun IdeaKotlinBinaryCoordinatesProto(
|
||||
coordinates.capabilities.forEach { capability ->
|
||||
this.capabilities.add(IdeaKotlinBinaryCapabilityProto(capability))
|
||||
}
|
||||
this.attributes = IdeaKotlinBinaryAttributesProto(coordinates.attributes)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +30,7 @@ internal fun IdeaKotlinBinaryCoordinates(proto: IdeaKotlinBinaryCoordinatesProto
|
||||
module = proto.module,
|
||||
version = if (proto.hasVersion()) proto.version else null,
|
||||
sourceSetName = if (proto.hasSourceSetName()) proto.sourceSetName else null,
|
||||
capabilities = proto.capabilitiesList.map(::IdeaKotlinBinaryCapability).toSet()
|
||||
capabilities = proto.capabilitiesList.map(::IdeaKotlinBinaryCapability).toSet(),
|
||||
attributes = IdeaKotlinBinaryAttributes(proto.attributes)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ message IdeaKotlinBinaryCoordinatesProto {
|
||||
optional string version = 3;
|
||||
optional string source_set_name = 4;
|
||||
repeated IdeaKotlinBinaryCapabilityProto capabilities = 5;
|
||||
optional IdeaKotlinBinaryAttributesProto attributes = 6;
|
||||
}
|
||||
|
||||
message IdeaKotlinBinaryCapabilityProto {
|
||||
@@ -68,6 +69,10 @@ message IdeaKotlinBinaryCapabilityProto {
|
||||
optional string version = 3;
|
||||
}
|
||||
|
||||
message IdeaKotlinBinaryAttributesProto {
|
||||
map<string, string> attributes = 1;
|
||||
}
|
||||
|
||||
message IdeaKotlinSourceCoordinatesProto {
|
||||
optional IdeaKotlinProjectCoordinatesProto project = 1;
|
||||
optional string source_set_name = 2;
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.proto.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.proto.AbstractSerializationTest
|
||||
import org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryAttributesProto
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryAttributes
|
||||
import org.junit.Test
|
||||
|
||||
class IdeaKotlinBinaryAttributesSerializationTest : AbstractSerializationTest<IdeaKotlinBinaryAttributes>() {
|
||||
override fun serialize(value: IdeaKotlinBinaryAttributes): ByteArray = IdeaKotlinBinaryAttributesProto(value).toByteArray()
|
||||
|
||||
override fun deserialize(data: ByteArray): IdeaKotlinBinaryAttributes =
|
||||
IdeaKotlinBinaryAttributes(IdeaKotlinBinaryAttributesProto.parseFrom(data))
|
||||
|
||||
@Test
|
||||
fun `sample 0`() = testSerialization(
|
||||
IdeaKotlinBinaryAttributes(emptyMap())
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `sample 1`() = testSerialization(
|
||||
IdeaKotlinBinaryAttributes(mapOf("a" to "valueA", "b" to "valueB"))
|
||||
)
|
||||
}
|
||||
+18
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.gradle.idea.proto.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.proto.AbstractSerializationTest
|
||||
import org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinBinaryCoordinatesProto
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryAttributes
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCapability
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCoordinates
|
||||
import org.junit.Test
|
||||
@@ -60,4 +61,21 @@ class IdeaKotlinBinaryCoordinatesSerializationTest : AbstractSerializationTest<I
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `sample 4`() = testSerialization(
|
||||
IdeaKotlinBinaryCoordinates(
|
||||
group = "myGroup",
|
||||
module = "myModule",
|
||||
version = "myVersion",
|
||||
sourceSetName = null,
|
||||
capabilities = setOf(
|
||||
IdeaKotlinBinaryCapability("my", "capability", "1.0.0"),
|
||||
IdeaKotlinBinaryCapability("my", "other-capability", "1.0.0")
|
||||
),
|
||||
attributes = IdeaKotlinBinaryAttributes(
|
||||
mapOf("a" to "valueA", "b" to "valueB")
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -298,34 +298,45 @@ public final class org/jetbrains/kotlin/gradle/idea/serialize/IdeaKotlinStringEx
|
||||
public fun serialize (Lorg/jetbrains/kotlin/gradle/idea/serialize/IdeaKotlinSerializationContext;Ljava/lang/String;)[B
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability : java/io/Serializable {
|
||||
public static final field serialVersionUID J
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
||||
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability;
|
||||
public abstract interface class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes : java/io/Serializable, java/util/Map, kotlin/jvm/internal/markers/KMappedMarker {
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributesKt {
|
||||
public static final fun IdeaKotlinBinaryAttributes ()Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;
|
||||
public static final fun IdeaKotlinBinaryAttributes (Ljava/util/Map;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability : java/io/Serializable {
|
||||
public abstract fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability;
|
||||
public abstract fun getGroup ()Ljava/lang/String;
|
||||
public abstract fun getName ()Ljava/lang/String;
|
||||
public abstract fun getVersion ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability$DefaultImpls {
|
||||
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getGroup ()Ljava/lang/String;
|
||||
public final fun getName ()Ljava/lang/String;
|
||||
public final fun getVersion ()Ljava/lang/String;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapabilityKt {
|
||||
public static final fun IdeaKotlinBinaryCapability (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCapability;
|
||||
}
|
||||
|
||||
public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates : org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinDependencyCoordinates {
|
||||
public static final field serialVersionUID J
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
||||
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;)V
|
||||
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;)V
|
||||
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Ljava/lang/String;
|
||||
public final fun component2 ()Ljava/lang/String;
|
||||
public final fun component3 ()Ljava/lang/String;
|
||||
public final fun component4 ()Ljava/lang/String;
|
||||
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;
|
||||
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;
|
||||
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;
|
||||
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;
|
||||
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;
|
||||
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Set;Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryCoordinates;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAttributes ()Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinBinaryAttributes;
|
||||
public final fun getCapabilities ()Ljava/util/Set;
|
||||
public final fun getDisplayString ()Ljava/lang/String;
|
||||
public final fun getGroup ()Ljava/lang/String;
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.utils.stringInterner
|
||||
import org.jetbrains.kotlin.tooling.core.WeakInterner
|
||||
import java.io.Serializable
|
||||
|
||||
fun IdeaKotlinBinaryAttributes(attributes: Map<String, String>): IdeaKotlinBinaryAttributes {
|
||||
return IdeaKotlinBinaryAttributesImpl.createAndIntern(attributes)
|
||||
}
|
||||
|
||||
fun IdeaKotlinBinaryAttributes(): IdeaKotlinBinaryAttributes {
|
||||
return IdeaKotlinBinaryAttributesImpl.createAndIntern(emptyMap())
|
||||
}
|
||||
|
||||
/**
|
||||
* Representing the 'Gradle attributes' associated with a given binary.
|
||||
* This can be used to identify binaries further than just their maven coordinates.
|
||||
*/
|
||||
@IdeaKotlinModel
|
||||
sealed interface IdeaKotlinBinaryAttributes : Map<String, String>, Serializable
|
||||
|
||||
private class IdeaKotlinBinaryAttributesImpl private constructor(
|
||||
private val attributes: Map<String, String>,
|
||||
) : IdeaKotlinBinaryAttributes, Map<String, String> by attributes {
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other === this) return true
|
||||
if (other !is IdeaKotlinBinaryAttributesImpl) return false
|
||||
return this.attributes == other.attributes
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return attributes.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return attributes.toString()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val serialVersionUID = 0L
|
||||
|
||||
private val interner = WeakInterner()
|
||||
|
||||
internal fun createAndIntern(attributes: Map<String, String>): IdeaKotlinBinaryAttributes {
|
||||
val internedMap = attributes.map { (key, value) -> stringInterner.getOrPut(key) to stringInterner.getOrPut(value) }.toMap()
|
||||
return interner.getOrPut(IdeaKotlinBinaryAttributesImpl(internedMap))
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
-10
@@ -5,8 +5,17 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.utils.stringInterner
|
||||
import java.io.Serializable
|
||||
|
||||
fun IdeaKotlinBinaryCapability(group: String, name: String, version: String?): IdeaKotlinBinaryCapability {
|
||||
return IdeaKotlinBinaryCapabilityImpl(
|
||||
group = stringInterner.getOrPut(group),
|
||||
name = stringInterner.getOrPut(name),
|
||||
version = if (version != null) stringInterner.getOrPut(version) else null
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Several variants can be published under a given set of maven coordinates (group, module, version),
|
||||
* Capabilities can classify those variants in a way that e.g. two variants with the same maven coordinates
|
||||
@@ -21,12 +30,24 @@ import java.io.Serializable
|
||||
* @since 1.9.20
|
||||
*/
|
||||
@IdeaKotlinModel
|
||||
class IdeaKotlinBinaryCapability(
|
||||
val group: String,
|
||||
val name: String,
|
||||
val version: String?,
|
||||
) : Serializable {
|
||||
internal companion object {
|
||||
sealed interface IdeaKotlinBinaryCapability : Serializable {
|
||||
val group: String
|
||||
val name: String
|
||||
val version: String?
|
||||
|
||||
fun copy(
|
||||
group: String = this.group,
|
||||
name: String = this.name,
|
||||
version: String? = this.version,
|
||||
): IdeaKotlinBinaryCapability
|
||||
}
|
||||
|
||||
private class IdeaKotlinBinaryCapabilityImpl(
|
||||
override val group: String,
|
||||
override val name: String,
|
||||
override val version: String?,
|
||||
) : IdeaKotlinBinaryCapability {
|
||||
companion object {
|
||||
const val serialVersionUID = 0L
|
||||
}
|
||||
|
||||
@@ -37,10 +58,10 @@ class IdeaKotlinBinaryCapability(
|
||||
}
|
||||
}
|
||||
|
||||
fun copy(
|
||||
group: String = this.group,
|
||||
name: String = this.name,
|
||||
version: String? = this.version,
|
||||
override fun copy(
|
||||
group: String,
|
||||
name: String,
|
||||
version: String?,
|
||||
): IdeaKotlinBinaryCapability {
|
||||
return IdeaKotlinBinaryCapability(group = group, name = name, version = version)
|
||||
}
|
||||
|
||||
+23
-6
@@ -23,6 +23,12 @@ class IdeaKotlinBinaryCoordinates(
|
||||
* @since 1.9.20
|
||||
*/
|
||||
val capabilities: Set<IdeaKotlinBinaryCapability> = emptySet(),
|
||||
|
||||
/**
|
||||
* @see IdeaKotlinBinaryAttributes
|
||||
* @since 1.9.20
|
||||
*/
|
||||
val attributes: IdeaKotlinBinaryAttributes = IdeaKotlinBinaryAttributes(),
|
||||
) : IdeaKotlinDependencyCoordinates {
|
||||
|
||||
constructor(
|
||||
@@ -55,6 +61,9 @@ class IdeaKotlinBinaryCoordinates(
|
||||
if (capabilities.isNotEmpty()) {
|
||||
append(capabilities.joinToString(", ", "(", ")"))
|
||||
}
|
||||
if (attributes.isNotEmpty()) {
|
||||
append("+attributes(${attributes.hashCode()})")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +128,7 @@ class IdeaKotlinBinaryCoordinates(
|
||||
if (version != other.version) return false
|
||||
if (sourceSetName != other.sourceSetName) return false
|
||||
if (capabilities != other.capabilities) return false
|
||||
|
||||
if (attributes != other.attributes) return false
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -129,6 +138,7 @@ class IdeaKotlinBinaryCoordinates(
|
||||
result = 31 * result + (version?.hashCode() ?: 0)
|
||||
result = 31 * result + (sourceSetName?.hashCode() ?: 0)
|
||||
result = 31 * result + capabilities.hashCode()
|
||||
result = 31 * result + attributes.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -146,7 +156,8 @@ class IdeaKotlinBinaryCoordinates(
|
||||
module = module,
|
||||
version = version,
|
||||
sourceSetName = sourceSetName,
|
||||
capabilities = capabilities
|
||||
capabilities = capabilities,
|
||||
attributes = attributes,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -156,13 +167,15 @@ class IdeaKotlinBinaryCoordinates(
|
||||
version: String? = this.version,
|
||||
sourceSetName: String? = this.sourceSetName,
|
||||
capabilities: Set<IdeaKotlinBinaryCapability> = this.capabilities,
|
||||
attributes: IdeaKotlinBinaryAttributes = this.attributes,
|
||||
): IdeaKotlinBinaryCoordinates {
|
||||
return IdeaKotlinBinaryCoordinates(
|
||||
group = group,
|
||||
module = module,
|
||||
version = version,
|
||||
sourceSetName = sourceSetName,
|
||||
capabilities = capabilities
|
||||
capabilities = capabilities,
|
||||
attributes = attributes
|
||||
)
|
||||
}
|
||||
|
||||
@@ -184,10 +197,14 @@ class IdeaKotlinBinaryCoordinates(
|
||||
* will be 'null'. In this case we use the 'copy' function to provide an instance that will have an emptySet instead.
|
||||
*/
|
||||
private fun readResolve(): Any {
|
||||
@Suppress("SENSELESS_COMPARISON")
|
||||
if (capabilities == null) {
|
||||
return copy(capabilities = emptySet())
|
||||
@Suppress("SENSELESS_COMPARISON", "USELESS_ELVIS")
|
||||
if (capabilities == null || attributes == null) {
|
||||
return copy(
|
||||
capabilities = capabilities ?: emptySet(),
|
||||
attributes = attributes ?: IdeaKotlinBinaryAttributes()
|
||||
)
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.utils
|
||||
|
||||
import org.jetbrains.kotlin.tooling.core.WeakInterner
|
||||
|
||||
/**
|
||||
* Can be used for all entities in this module to intern strings
|
||||
*/
|
||||
internal val stringInterner = WeakInterner()
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.test.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryAttributes
|
||||
import kotlin.test.*
|
||||
|
||||
class IdeaKotlinBinaryAttributesTest {
|
||||
@Test
|
||||
fun `test - empty instance is same`() {
|
||||
val instance1 = IdeaKotlinBinaryAttributes()
|
||||
val instance2 = IdeaKotlinBinaryAttributes()
|
||||
assertSame(instance1, instance2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test - equal instances are same`() {
|
||||
val instance1 = IdeaKotlinBinaryAttributes(
|
||||
mapOf("a" to "valueA", "b" to "valueB")
|
||||
)
|
||||
|
||||
val instance2 = IdeaKotlinBinaryAttributes(
|
||||
mapOf("a" to "valueA", "b" to "valueB")
|
||||
)
|
||||
|
||||
assertSame(instance1, instance2)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test - instances string values are same`() {
|
||||
val instance1 = IdeaKotlinBinaryAttributes(
|
||||
mapOf("a" to "valueA", "b" to "valueB", "c" to "xxx")
|
||||
)
|
||||
|
||||
val instance2 = IdeaKotlinBinaryAttributes(
|
||||
mapOf("a" to "valueA", "b" to "valueB", "c" to "yyy")
|
||||
)
|
||||
|
||||
assertNotSame(instance1, instance2)
|
||||
assertNotEquals(instance1, instance2)
|
||||
|
||||
instance1.keys.toList().forEachIndexed { index, key ->
|
||||
assertSame(key, instance2.keys.toList()[index])
|
||||
}
|
||||
|
||||
assertSame(instance1["a"], instance2["a"])
|
||||
assertSame(instance1["b"], instance2["b"])
|
||||
assertEquals("valueA", instance1["a"])
|
||||
assertEquals("valueB", instance1["b"])
|
||||
assertEquals("xxx", instance1["c"])
|
||||
assertEquals("yyy", instance2["c"])
|
||||
}
|
||||
}
|
||||
+43
-3
@@ -5,10 +5,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.idea.test.tcs
|
||||
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryAttributes
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCapability
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCoordinates
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotEquals
|
||||
import kotlin.test.assertNotSame
|
||||
|
||||
class IdeaKotlinBinaryCoordinatesTest {
|
||||
|
||||
@@ -108,7 +111,7 @@ class IdeaKotlinBinaryCoordinatesTest {
|
||||
assertEquals("myGroup:myModule-foo:1.0.0:commonMain", coordinates.displayString)
|
||||
|
||||
assertEquals(
|
||||
"myGroup:myModule:1.0.0:commonMain(myGroup:myModule-foo:1.0.0, notMyGroup:myModule-foo:1.0.0, notMyGroupEither:myModule-foo)",
|
||||
"myGroup:myModule:commonMain:1.0.0(myGroup:myModule-foo:1.0.0, notMyGroup:myModule-foo:1.0.0, notMyGroupEither:myModule-foo)",
|
||||
coordinates.identityString
|
||||
)
|
||||
}
|
||||
@@ -123,11 +126,48 @@ class IdeaKotlinBinaryCoordinatesTest {
|
||||
IdeaKotlinBinaryCapability("notMyGroup", "myModule-foo", null),
|
||||
)
|
||||
)
|
||||
assertEquals("myGroup:myModule-(foo, bar):1.0.0:commonMain", coordinates.displayString)
|
||||
assertEquals("myGroup:myModule-(foo, bar):commonMain:1.0.0", coordinates.displayString)
|
||||
|
||||
assertEquals(
|
||||
"myGroup:myModule:1.0.0:commonMain(myGroup:myModule-foo:1.0.0, myGroup:myModule-bar:1.0.0, notMyGroup:myModule-foo)",
|
||||
"myGroup:myModule:commonMain:1.0.0(myGroup:myModule-foo:1.0.0, myGroup:myModule-bar:1.0.0, notMyGroup:myModule-foo)",
|
||||
coordinates.identityString
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test - displayString & identityString - sample 9`() {
|
||||
val coordinates = IdeaKotlinBinaryCoordinates(
|
||||
"myGroup", "myModule", "1.0.0", "commonMain",
|
||||
capabilities = setOf(
|
||||
IdeaKotlinBinaryCapability("myGroup", "myModule-foo", "1.0.0"),
|
||||
IdeaKotlinBinaryCapability("myGroup", "myModule-bar", "1.0.0"),
|
||||
IdeaKotlinBinaryCapability("notMyGroup", "myModule-foo", null),
|
||||
),
|
||||
attributes = IdeaKotlinBinaryAttributes(
|
||||
mapOf("a" to "valueA")
|
||||
)
|
||||
)
|
||||
assertEquals("myGroup:myModule-(foo, bar):commonMain:1.0.0", coordinates.displayString)
|
||||
|
||||
assertEquals(
|
||||
"myGroup:myModule:commonMain:1.0.0(myGroup:myModule-foo:1.0.0, myGroup:myModule-bar:1.0.0, notMyGroup:myModule-foo)+attributes(-823812975)",
|
||||
coordinates.identityString
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test - equals`() {
|
||||
val baseline = IdeaKotlinBinaryCoordinates(
|
||||
"a", "b", "c", "d",
|
||||
capabilities = setOf(IdeaKotlinBinaryCapability("x", "y", "z")),
|
||||
attributes = IdeaKotlinBinaryAttributes(mapOf("a" to "valueA"))
|
||||
)
|
||||
assertNotSame(baseline, baseline.copy())
|
||||
assertEquals(baseline, baseline.copy())
|
||||
assertEquals(baseline.hashCode(), baseline.copy().hashCode())
|
||||
assertEquals(baseline.identityString, baseline.copy().identityString)
|
||||
assertNotEquals(baseline, baseline.copy(sourceSetName = null))
|
||||
assertNotEquals(baseline, baseline.copy(capabilities = emptySet()))
|
||||
assertNotEquals(baseline, baseline.copy(attributes = IdeaKotlinBinaryAttributes()))
|
||||
}
|
||||
}
|
||||
|
||||
+4
-6
@@ -19,11 +19,8 @@ import org.jetbrains.kotlin.gradle.idea.tcs.extras.isIdeaProjectLevel
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeDependencyResolver
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeDependencyResolver.Companion.gradleArtifact
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeaKotlinBinaryCapability
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeaKotlinBinaryCoordinates
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeaKotlinProjectCoordinates
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers.IdeBinaryDependencyResolver.ArtifactResolutionStrategy
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationConfigurationsContainer
|
||||
@@ -153,7 +150,7 @@ class IdeBinaryDependencyResolver @JvmOverloads constructor(
|
||||
|
||||
is ModuleComponentIdentifier -> {
|
||||
IdeaKotlinResolvedBinaryDependency(
|
||||
coordinates = IdeaKotlinBinaryCoordinates(componentId, artifact.variant.capabilities),
|
||||
coordinates = IdeaKotlinBinaryCoordinates(componentId, artifact.variant.capabilities, artifact.variant.attributes),
|
||||
binaryType = binaryType,
|
||||
classpath = IdeaKotlinClasspath(artifact.file),
|
||||
)
|
||||
@@ -166,7 +163,8 @@ class IdeBinaryDependencyResolver @JvmOverloads constructor(
|
||||
module = componentId.libraryName,
|
||||
version = null,
|
||||
sourceSetName = null,
|
||||
capabilities = artifact.variant.capabilities.map(::IdeaKotlinBinaryCapability).toSet()
|
||||
capabilities = artifact.variant.capabilities.map(::IdeaKotlinBinaryCapability).toSet(),
|
||||
attributes = IdeaKotlinBinaryAttributes(artifact.variant.attributes)
|
||||
), classpath = IdeaKotlinClasspath(artifact.file)
|
||||
)
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ internal object IdeOriginalMetadataDependencyResolver : IdeDependencyResolver {
|
||||
IdeaKotlinResolvedBinaryDependency(
|
||||
binaryType = IdeaKotlinBinaryDependency.KOTLIN_COMPILE_BINARY_TYPE,
|
||||
classpath = IdeaKotlinClasspath(artifact.file),
|
||||
coordinates = IdeaKotlinBinaryCoordinates(moduleId)
|
||||
coordinates = IdeaKotlinBinaryCoordinates(moduleId, artifact.variant.capabilities, artifact.variant.attributes)
|
||||
)
|
||||
}.toSet()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-5
@@ -8,11 +8,9 @@ package org.jetbrains.kotlin.gradle.plugin.ide
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.component.ModuleComponentIdentifier
|
||||
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
|
||||
import org.gradle.api.attributes.AttributeContainer
|
||||
import org.gradle.api.capabilities.Capability
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCapability
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCoordinates
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinProjectCoordinates
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinSourceCoordinates
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.*
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.extras.KlibExtra
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.currentBuildId
|
||||
@@ -45,12 +43,14 @@ internal fun IdeaKotlinSourceCoordinates(sourceSet: KotlinSourceSet): IdeaKotlin
|
||||
internal fun IdeaKotlinBinaryCoordinates(
|
||||
identifier: ModuleComponentIdentifier,
|
||||
capabilities: List<Capability> = emptyList(),
|
||||
attributes: AttributeContainer,
|
||||
): IdeaKotlinBinaryCoordinates {
|
||||
return IdeaKotlinBinaryCoordinates(
|
||||
group = identifier.group,
|
||||
module = identifier.module,
|
||||
version = identifier.version,
|
||||
capabilities = capabilities.map(::IdeaKotlinBinaryCapability).toSet()
|
||||
capabilities = capabilities.map(::IdeaKotlinBinaryCapability).toSet(),
|
||||
attributes = IdeaKotlinBinaryAttributes(attributes)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -62,6 +62,12 @@ internal fun IdeaKotlinBinaryCapability(capability: Capability): IdeaKotlinBinar
|
||||
)
|
||||
}
|
||||
|
||||
internal fun IdeaKotlinBinaryAttributes(attributes: AttributeContainer): IdeaKotlinBinaryAttributes {
|
||||
return IdeaKotlinBinaryAttributes(
|
||||
attributes.keySet().associate { key -> key.name to attributes.getAttribute(key).toString() }
|
||||
)
|
||||
}
|
||||
|
||||
internal fun KlibExtra(library: KotlinLibrary): KlibExtra {
|
||||
return KlibExtra(
|
||||
builtInsPlatform = library.builtInsPlatform,
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("FunctionName")
|
||||
|
||||
package org.jetbrains.kotlin.gradle.unitTests
|
||||
|
||||
import org.gradle.api.attributes.Category
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeaKotlinBinaryAttributes
|
||||
import org.jetbrains.kotlin.gradle.util.buildProject
|
||||
import org.jetbrains.kotlin.gradle.utils.named
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class IdeaKotlinBinaryAttributesFactoryTest {
|
||||
|
||||
@Test
|
||||
fun `test - sample 0`() {
|
||||
val project = buildProject()
|
||||
|
||||
val dummyConfiguration = project.configurations.create("dummy")
|
||||
val container = dummyConfiguration.attributes
|
||||
container.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_API))
|
||||
container.attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.DOCUMENTATION))
|
||||
|
||||
assertEquals(
|
||||
mapOf(
|
||||
"org.gradle.usage" to "java-api",
|
||||
"org.gradle.category" to "documentation"
|
||||
), IdeaKotlinBinaryAttributes(container)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user