[Gradle] IdeaKotlinProjectCoordinates: Replace 'buildId' with 'buildName' and 'buildPath'

^KT-58157 In Progress
This commit is contained in:
Sebastian Sellmair
2023-07-27 16:22:18 +02:00
committed by Space Team
parent fe3d5014ce
commit f5e946c0b2
13 changed files with 671 additions and 147 deletions
@@ -16,7 +16,8 @@ private static final long serialVersionUID = 0L;
super(builder);
}
private IdeaKotlinProjectCoordinatesProto() {
buildId_ = "";
buildName_ = "";
buildPath_ = "";
projectPath_ = "";
projectName_ = "";
}
@@ -47,46 +48,116 @@ private static final long serialVersionUID = 0L;
}
private int bitField0_;
public static final int BUILD_ID_FIELD_NUMBER = 1;
private volatile java.lang.Object buildId_;
public static final int BUILD_NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object buildName_;
/**
* <code>optional string build_id = 1;</code>
* @return Whether the buildId field is set.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return Whether the buildName field is set.
*/
@java.lang.Override
public boolean hasBuildId() {
public boolean hasBuildName() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>optional string build_id = 1;</code>
* @return The buildId.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return The buildName.
*/
@java.lang.Override
public java.lang.String getBuildId() {
java.lang.Object ref = buildId_;
public java.lang.String getBuildName() {
java.lang.Object ref = buildName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
buildId_ = s;
buildName_ = s;
return s;
}
}
/**
* <code>optional string build_id = 1;</code>
* @return The bytes for buildId.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return The bytes for buildName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getBuildIdBytes() {
java.lang.Object ref = buildId_;
getBuildNameBytes() {
java.lang.Object ref = buildName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
buildId_ = b;
buildName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BUILD_PATH_FIELD_NUMBER = 4;
private volatile java.lang.Object buildPath_;
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return Whether the buildPath field is set.
*/
@java.lang.Override
public boolean hasBuildPath() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return The buildPath.
*/
@java.lang.Override
public java.lang.String getBuildPath() {
java.lang.Object ref = buildPath_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
buildPath_ = s;
return s;
}
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return The bytes for buildPath.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getBuildPathBytes() {
java.lang.Object ref = buildPath_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
buildPath_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
@@ -101,7 +172,7 @@ private static final long serialVersionUID = 0L;
*/
@java.lang.Override
public boolean hasProjectPath() {
return ((bitField0_ & 0x00000002) != 0);
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>optional string project_path = 2;</code>
@@ -147,7 +218,7 @@ private static final long serialVersionUID = 0L;
*/
@java.lang.Override
public boolean hasProjectName() {
return ((bitField0_ & 0x00000004) != 0);
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <code>optional string project_name = 3;</code>
@@ -200,14 +271,17 @@ private static final long serialVersionUID = 0L;
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, buildId_);
}
if (((bitField0_ & 0x00000002) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectPath_);
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, buildName_);
}
if (((bitField0_ & 0x00000004) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectPath_);
}
if (((bitField0_ & 0x00000008) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, projectName_);
}
if (((bitField0_ & 0x00000002) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, buildPath_);
}
getUnknownFields().writeTo(output);
}
@@ -218,14 +292,17 @@ private static final long serialVersionUID = 0L;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, buildId_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectPath_);
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, buildName_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectPath_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, projectName_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, buildPath_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@@ -241,10 +318,15 @@ private static final long serialVersionUID = 0L;
}
org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinProjectCoordinatesProto other = (org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinProjectCoordinatesProto) obj;
if (hasBuildId() != other.hasBuildId()) return false;
if (hasBuildId()) {
if (!getBuildId()
.equals(other.getBuildId())) return false;
if (hasBuildName() != other.hasBuildName()) return false;
if (hasBuildName()) {
if (!getBuildName()
.equals(other.getBuildName())) return false;
}
if (hasBuildPath() != other.hasBuildPath()) return false;
if (hasBuildPath()) {
if (!getBuildPath()
.equals(other.getBuildPath())) return false;
}
if (hasProjectPath() != other.hasProjectPath()) return false;
if (hasProjectPath()) {
@@ -267,9 +349,13 @@ private static final long serialVersionUID = 0L;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasBuildId()) {
hash = (37 * hash) + BUILD_ID_FIELD_NUMBER;
hash = (53 * hash) + getBuildId().hashCode();
if (hasBuildName()) {
hash = (37 * hash) + BUILD_NAME_FIELD_NUMBER;
hash = (53 * hash) + getBuildName().hashCode();
}
if (hasBuildPath()) {
hash = (37 * hash) + BUILD_PATH_FIELD_NUMBER;
hash = (53 * hash) + getBuildPath().hashCode();
}
if (hasProjectPath()) {
hash = (37 * hash) + PROJECT_PATH_FIELD_NUMBER;
@@ -407,12 +493,14 @@ private static final long serialVersionUID = 0L;
@java.lang.Override
public Builder clear() {
super.clear();
buildId_ = "";
buildName_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
projectPath_ = "";
buildPath_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
projectName_ = "";
projectPath_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
projectName_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
@@ -444,14 +532,18 @@ private static final long serialVersionUID = 0L;
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.buildId_ = buildId_;
result.buildName_ = buildName_;
if (((from_bitField0_ & 0x00000002) != 0)) {
to_bitField0_ |= 0x00000002;
}
result.projectPath_ = projectPath_;
result.buildPath_ = buildPath_;
if (((from_bitField0_ & 0x00000004) != 0)) {
to_bitField0_ |= 0x00000004;
}
result.projectPath_ = projectPath_;
if (((from_bitField0_ & 0x00000008) != 0)) {
to_bitField0_ |= 0x00000008;
}
result.projectName_ = projectName_;
result.bitField0_ = to_bitField0_;
onBuilt();
@@ -502,18 +594,23 @@ private static final long serialVersionUID = 0L;
public Builder mergeFrom(org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinProjectCoordinatesProto other) {
if (other == org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinProjectCoordinatesProto.getDefaultInstance()) return this;
if (other.hasBuildId()) {
if (other.hasBuildName()) {
bitField0_ |= 0x00000001;
buildId_ = other.buildId_;
buildName_ = other.buildName_;
onChanged();
}
if (other.hasBuildPath()) {
bitField0_ |= 0x00000002;
buildPath_ = other.buildPath_;
onChanged();
}
if (other.hasProjectPath()) {
bitField0_ |= 0x00000002;
bitField0_ |= 0x00000004;
projectPath_ = other.projectPath_;
onChanged();
}
if (other.hasProjectName()) {
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
projectName_ = other.projectName_;
onChanged();
}
@@ -544,20 +641,25 @@ private static final long serialVersionUID = 0L;
done = true;
break;
case 10: {
buildId_ = input.readStringRequireUtf8();
buildName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
projectPath_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
bitField0_ |= 0x00000004;
break;
} // case 18
case 26: {
projectName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
break;
} // case 26
case 34: {
buildPath_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 34
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -575,85 +677,216 @@ private static final long serialVersionUID = 0L;
}
private int bitField0_;
private java.lang.Object buildId_ = "";
private java.lang.Object buildName_ = "";
/**
* <code>optional string build_id = 1;</code>
* @return Whether the buildId field is set.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return Whether the buildName field is set.
*/
public boolean hasBuildId() {
public boolean hasBuildName() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>optional string build_id = 1;</code>
* @return The buildId.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return The buildName.
*/
public java.lang.String getBuildId() {
java.lang.Object ref = buildId_;
public java.lang.String getBuildName() {
java.lang.Object ref = buildName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
buildId_ = s;
buildName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string build_id = 1;</code>
* @return The bytes for buildId.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return The bytes for buildName.
*/
public com.google.protobuf.ByteString
getBuildIdBytes() {
java.lang.Object ref = buildId_;
getBuildNameBytes() {
java.lang.Object ref = buildName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
buildId_ = b;
buildName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string build_id = 1;</code>
* @param value The buildId to set.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @param value The buildName to set.
* @return This builder for chaining.
*/
public Builder setBuildId(
public Builder setBuildName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
buildId_ = value;
buildName_ = value;
onChanged();
return this;
}
/**
* <code>optional string build_id = 1;</code>
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return This builder for chaining.
*/
public Builder clearBuildId() {
public Builder clearBuildName() {
bitField0_ = (bitField0_ & ~0x00000001);
buildId_ = getDefaultInstance().getBuildId();
buildName_ = getDefaultInstance().getBuildName();
onChanged();
return this;
}
/**
* <code>optional string build_id = 1;</code>
* @param value The bytes for buildId to set.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @param value The bytes for buildName to set.
* @return This builder for chaining.
*/
public Builder setBuildIdBytes(
public Builder setBuildNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000001;
buildId_ = value;
buildName_ = value;
onChanged();
return this;
}
private java.lang.Object buildPath_ = "";
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return Whether the buildPath field is set.
*/
public boolean hasBuildPath() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return The buildPath.
*/
public java.lang.String getBuildPath() {
java.lang.Object ref = buildPath_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
buildPath_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return The bytes for buildPath.
*/
public com.google.protobuf.ByteString
getBuildPathBytes() {
java.lang.Object ref = buildPath_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
buildPath_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @param value The buildPath to set.
* @return This builder for chaining.
*/
public Builder setBuildPath(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
buildPath_ = value;
onChanged();
return this;
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return This builder for chaining.
*/
public Builder clearBuildPath() {
bitField0_ = (bitField0_ & ~0x00000002);
buildPath_ = getDefaultInstance().getBuildPath();
onChanged();
return this;
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @param value The bytes for buildPath to set.
* @return This builder for chaining.
*/
public Builder setBuildPathBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000002;
buildPath_ = value;
onChanged();
return this;
}
@@ -664,7 +897,7 @@ private static final long serialVersionUID = 0L;
* @return Whether the projectPath field is set.
*/
public boolean hasProjectPath() {
return ((bitField0_ & 0x00000002) != 0);
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <code>optional string project_path = 2;</code>
@@ -709,7 +942,7 @@ private static final long serialVersionUID = 0L;
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
bitField0_ |= 0x00000004;
projectPath_ = value;
onChanged();
return this;
@@ -719,7 +952,7 @@ private static final long serialVersionUID = 0L;
* @return This builder for chaining.
*/
public Builder clearProjectPath() {
bitField0_ = (bitField0_ & ~0x00000002);
bitField0_ = (bitField0_ & ~0x00000004);
projectPath_ = getDefaultInstance().getProjectPath();
onChanged();
return this;
@@ -735,7 +968,7 @@ private static final long serialVersionUID = 0L;
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000002;
bitField0_ |= 0x00000004;
projectPath_ = value;
onChanged();
return this;
@@ -747,7 +980,7 @@ private static final long serialVersionUID = 0L;
* @return Whether the projectName field is set.
*/
public boolean hasProjectName() {
return ((bitField0_ & 0x00000004) != 0);
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <code>optional string project_name = 3;</code>
@@ -792,7 +1025,7 @@ private static final long serialVersionUID = 0L;
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
projectName_ = value;
onChanged();
return this;
@@ -802,7 +1035,7 @@ private static final long serialVersionUID = 0L;
* @return This builder for chaining.
*/
public Builder clearProjectName() {
bitField0_ = (bitField0_ & ~0x00000004);
bitField0_ = (bitField0_ & ~0x00000008);
projectName_ = getDefaultInstance().getProjectName();
onChanged();
return this;
@@ -818,7 +1051,7 @@ private static final long serialVersionUID = 0L;
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
projectName_ = value;
onChanged();
return this;
@@ -8,21 +8,62 @@ public interface IdeaKotlinProjectCoordinatesProtoOrBuilder extends
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional string build_id = 1;</code>
* @return Whether the buildId field is set.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return Whether the buildName field is set.
*/
boolean hasBuildId();
boolean hasBuildName();
/**
* <code>optional string build_id = 1;</code>
* @return The buildId.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return The buildName.
*/
java.lang.String getBuildId();
java.lang.String getBuildName();
/**
* <code>optional string build_id = 1;</code>
* @return The bytes for buildId.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return The bytes for buildName.
*/
com.google.protobuf.ByteString
getBuildIdBytes();
getBuildNameBytes();
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return Whether the buildPath field is set.
*/
boolean hasBuildPath();
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return The buildPath.
*/
java.lang.String getBuildPath();
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return The bytes for buildPath.
*/
com.google.protobuf.ByteString
getBuildPathBytes();
/**
* <code>optional string project_path = 2;</code>
@@ -139,36 +139,37 @@ public final class ProtoTcs {
"\n\013coordinates\030\003 \001(\0132W.org.jetbrains.kotl" +
"in.gradle.idea.proto.generated.tcs.IdeaK" +
"otlinProjectCoordinatesProtoH\002\210\001\001B\t\n\007_ex" +
"trasB\007\n\005_typeB\016\n\014_coordinates\"\237\001\n!IdeaKo" +
"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\"\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" +
"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"
"trasB\007\n\005_typeB\016\n\014_coordinates\"\313\001\n!IdeaKo" +
"tlinProjectCoordinatesProto\022\027\n\nbuild_nam" +
"e\030\001 \001(\tH\000\210\001\001\022\027\n\nbuild_path\030\004 \001(\tH\001\210\001\001\022\031\n" +
"\014project_path\030\002 \001(\tH\002\210\001\001\022\031\n\014project_name" +
"\030\003 \001(\tH\003\210\001\001B\r\n\013_build_nameB\r\n\013_build_pat" +
"hB\017\n\r_project_pathB\017\n\r_project_name\"\240\003\n " +
"IdeaKotlinBinaryCoordinatesProto\022\022\n\005grou" +
"p\030\001 \001(\tH\000\210\001\001\022\023\n\006module\030\002 \001(\tH\001\210\001\001\022\024\n\007ver" +
"sion\030\003 \001(\tH\002\210\001\001\022\034\n\017source_set_name\030\004 \001(\t" +
"H\003\210\001\001\022k\n\014capabilities\030\005 \003(\0132U.org.jetbra" +
"ins.kotlin.gradle.idea.proto.generated.t" +
"cs.IdeaKotlinBinaryCapabilityProto\022n\n\nat" +
"tributes\030\006 \001(\0132U.org.jetbrains.kotlin.gr" +
"adle.idea.proto.generated.tcs.IdeaKotlin" +
"BinaryAttributesProtoH\004\210\001\001B\010\n\006_groupB\t\n\007" +
"_moduleB\n\n\010_versionB\022\n\020_source_set_nameB" +
"\r\n\013_attributes\"}\n\037IdeaKotlinBinaryCapabi" +
"lityProto\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_group" +
"B\007\n\005_nameB\n\n\010_version\"\317\001\n\037IdeaKotlinBina" +
"ryAttributesProto\022y\n\nattributes\030\001 \003(\0132e." +
"org.jetbrains.kotlin.gradle.idea.proto.g" +
"enerated.tcs.IdeaKotlinBinaryAttributesP" +
"roto.AttributesEntry\0321\n\017AttributesEntry\022" +
"\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\317\001\n Idea" +
"KotlinSourceCoordinatesProto\022m\n\007project\030" +
"\001 \001(\0132W.org.jetbrains.kotlin.gradle.idea" +
".proto.generated.tcs.IdeaKotlinProjectCo" +
"ordinatesProtoH\000\210\001\001\022\034\n\017source_set_name\030\002" +
" \001(\tH\001\210\001\001B\n\n\010_projectB\022\n\020_source_set_nam" +
"eB\002P\001b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -216,7 +217,7 @@ public final class ProtoTcs {
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinProjectCoordinatesProto_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinProjectCoordinatesProto_descriptor,
new java.lang.String[] { "BuildId", "ProjectPath", "ProjectName", "BuildId", "ProjectPath", "ProjectName", });
new java.lang.String[] { "BuildName", "BuildPath", "ProjectPath", "ProjectName", "BuildName", "BuildPath", "ProjectPath", "ProjectName", });
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCoordinatesProto_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_org_jetbrains_kotlin_gradle_idea_proto_generated_tcs_IdeaKotlinBinaryCoordinatesProto_fieldAccessorTable = new
@@ -23,27 +23,75 @@ object IdeaKotlinProjectCoordinatesProtoKt {
internal fun _build(): org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinProjectCoordinatesProto = _builder.build()
/**
* <code>optional string build_id = 1;</code>
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
*/
var buildId: kotlin.String
@JvmName("getBuildId")
get() = _builder.getBuildId()
@JvmName("setBuildId")
var buildName: kotlin.String
@JvmName("getBuildName")
get() = _builder.getBuildName()
@JvmName("setBuildName")
set(value) {
_builder.setBuildId(value)
_builder.setBuildName(value)
}
/**
* <code>optional string build_id = 1;</code>
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
*/
fun clearBuildId() {
_builder.clearBuildId()
fun clearBuildName() {
_builder.clearBuildName()
}
/**
* <code>optional string build_id = 1;</code>
* @return Whether the buildId field is set.
* <pre>
* Renamed from 'build_id' to 'build_name' in 1.9.20
* </pre>
*
* <code>optional string build_name = 1;</code>
* @return Whether the buildName field is set.
*/
fun hasBuildId(): kotlin.Boolean {
return _builder.hasBuildId()
fun hasBuildName(): kotlin.Boolean {
return _builder.hasBuildName()
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
*/
var buildPath: kotlin.String
@JvmName("getBuildPath")
get() = _builder.getBuildPath()
@JvmName("setBuildPath")
set(value) {
_builder.setBuildPath(value)
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
*/
fun clearBuildPath() {
_builder.clearBuildPath()
}
/**
* <pre>
* Added in 1.9.20
* </pre>
*
* <code>optional string build_path = 4;</code>
* @return Whether the buildPath field is set.
*/
fun hasBuildPath(): kotlin.Boolean {
return _builder.hasBuildPath()
}
/**
@@ -11,15 +11,28 @@ import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinProjectCoordinates
internal fun IdeaKotlinProjectCoordinatesProto(coordinates: IdeaKotlinProjectCoordinates): IdeaKotlinProjectCoordinatesProto {
return ideaKotlinProjectCoordinatesProto {
this.buildId = coordinates.buildId
this.buildName = coordinates.buildName
this.buildPath = coordinates.buildPath
this.projectPath = coordinates.projectPath
this.projectName = coordinates.projectName
}
}
internal fun IdeaKotlinProjectCoordinates(proto: IdeaKotlinProjectCoordinatesProto): IdeaKotlinProjectCoordinates {
return IdeaKotlinProjectCoordinates(
buildId = proto.buildId,
return if (proto.hasBuildPath()) IdeaKotlinProjectCoordinates(
buildName = proto.buildName,
buildPath = proto.buildPath,
projectPath = proto.projectPath,
projectName = proto.projectName
)
/*
Coordinates were encoded w/o 'buildPath'.
This can happen if e.g. the data was produced by an older Kotlin Gradle Plugin (before 1.9.20),
or if the Kotlin Gradle Plugin was used with older Gradle versions (before 8.2), where this information was not present.
In this case, we will create the coordinates using the approximation used before 1.9.20: buildName is used as 'buildId'
*/
else @Suppress("DEPRECATION") IdeaKotlinProjectCoordinates(
buildId = proto.buildName,
projectPath = proto.projectPath,
projectName = proto.projectName
)
@@ -49,7 +49,8 @@ message IdeaKotlinProjectArtifactDependencyProto {
}
message IdeaKotlinProjectCoordinatesProto {
optional string build_id = 1;
optional string build_name = 1; // Renamed from 'build_id' to 'build_name' in 1.9.20
optional string build_path = 4; // Added in 1.9.20
optional string project_path = 2;
optional string project_name = 3;
}
@@ -7,10 +7,7 @@ package org.jetbrains.kotlin.gradle.idea.proto.tcs
import org.jetbrains.kotlin.gradle.idea.proto.classLoaderForBackwardsCompatibleClasses
import org.jetbrains.kotlin.gradle.idea.serialize.IdeaKotlinSerializationLogger
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinProjectArtifactDependency
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinResolvedBinaryDependency
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinSourceDependency
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinUnresolvedBinaryDependency
import org.jetbrains.kotlin.gradle.idea.tcs.*
import org.jetbrains.kotlin.gradle.idea.testFixtures.tcs.TestIdeaKotlinDependencySerializer
import org.jetbrains.kotlin.gradle.idea.testFixtures.tcs.TestIdeaKotlinInstances
import org.jetbrains.kotlin.gradle.idea.testFixtures.utils.copy
@@ -54,8 +51,16 @@ class IdeaKotlinDependencyBackwardsCompatibilityTest {
val deserializedCopied = deserialized.copy<IdeaKotlinSourceDependency>()
assertEquals(dependency.type, deserializedCopied.type)
assertEquals(dependency.coordinates, deserializedCopied.coordinates)
assertEquals(dependency.extras, deserializedCopied.extras)
/* Check if coordinates are equals: Note the old class does not contain buildPath and buildName in project coordinates */
run {
assertEquals(dependency.coordinates.sourceSetName, deserializedCopied.coordinates.sourceSetName)
assertProjectCoordinatesEquals(
dependency.coordinates.project,
deserialized.callMethod("getCoordinates").callMethod("getProject")
)
}
}
@Test
@@ -66,11 +71,24 @@ class IdeaKotlinDependencyBackwardsCompatibilityTest {
val deserializedCopied = deserialized.copy<IdeaKotlinProjectArtifactDependency>()
assertEquals(dependency.type, deserializedCopied.type)
assertEquals(dependency.coordinates, deserializedCopied.coordinates)
assertEquals(dependency.extras, deserializedCopied.extras)
assertProjectCoordinatesEquals(dependency.coordinates, deserialized.callMethod("getCoordinates"))
}
}
private fun assertProjectCoordinatesEquals(
expected: IdeaKotlinProjectCoordinates, deserialized: Any,
) {
val deserializedBuildId = deserialized.callMethod("getBuildId")
val deserializedProjectPath = deserialized.callMethod("getProjectPath")
val deserializedProjectName = deserialized.callMethod("getProjectName")
@Suppress("DEPRECATION")
assertEquals(expected.buildId, deserializedBuildId)
assertEquals(expected.buildName, deserializedBuildId)
assertEquals(expected.projectPath, deserializedProjectPath)
assertEquals(expected.projectName, deserializedProjectName)
}
private fun deserializeIdeaKotlinDependencyWithBackwardsCompatibleClasses(project: ByteArray): Any {
val classLoader = classLoaderForBackwardsCompatibleClasses()
val serializer = TestIdeaKotlinDependencySerializer(classLoader)
@@ -92,3 +110,5 @@ private fun deserializeIdeaKotlinDependencyWithBackwardsCompatibleClasses(projec
return deserialized
}
private fun Any.callMethod(name: String) = javaClass.getDeclaredMethod(name).invoke(this)
@@ -0,0 +1,41 @@
/*
* 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.AbstractSerializationTest
import org.jetbrains.kotlin.gradle.idea.proto.generated.tcs.IdeaKotlinProjectCoordinatesProto
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinProjectCoordinates
import kotlin.test.Test
class IdeaKotlinProjectCoordinatesSerializationTest : AbstractSerializationTest<IdeaKotlinProjectCoordinates>() {
override fun serialize(value: IdeaKotlinProjectCoordinates): ByteArray {
return IdeaKotlinProjectCoordinatesProto(value).toByteArray()
}
override fun deserialize(data: ByteArray): IdeaKotlinProjectCoordinates {
return IdeaKotlinProjectCoordinates(IdeaKotlinProjectCoordinatesProto.parseFrom(data))
}
@Test
fun `test - only buildId provided`() = testSerialization(
@Suppress("DEPRECATION")
IdeaKotlinProjectCoordinates(
buildId = "myBuildId",
projectPath = "myProjectPath",
projectName = "myProjetName"
)
)
@Test
fun `test - only buildPath and buildName provided`() = testSerialization(
IdeaKotlinProjectCoordinates(
buildPath = "myBuildId",
buildName = "myBuildName",
projectPath = "myProjectPath",
projectName = "myProjetName"
)
)
}
@@ -18,6 +18,7 @@ class IdeaKotlinSourceCoordinatesSerializationTest : AbstractSerializationTest<I
override fun deserialize(data: ByteArray): IdeaKotlinSourceCoordinates =
IdeaKotlinSourceCoordinates(IdeaKotlinSourceCoordinatesProto.parseFrom(data))
@Suppress("DEPRECATION")
@Test
fun `sample 0`() = testSerialization(
IdeaKotlinSourceCoordinates(
@@ -29,4 +30,17 @@ class IdeaKotlinSourceCoordinatesSerializationTest : AbstractSerializationTest<I
sourceSetName = "mySourceSetName"
)
)
@Test
fun `sample 1`() = testSerialization(
IdeaKotlinSourceCoordinates(
project = IdeaKotlinProjectCoordinates(
buildName = "myBuildId",
buildPath = ":myBuildPath",
projectPath = "myProjectPath",
projectName = "myProjectName"
),
sourceSetName = "mySourceSetName"
)
)
}
@@ -431,13 +431,18 @@ public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectArtifac
public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates : java/io/Serializable, 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;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)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 copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;
public fun equals (Ljava/lang/Object;)Z
public final fun getBuildId ()Ljava/lang/String;
public final fun getBuildName ()Ljava/lang/String;
public final fun getBuildPath ()Ljava/lang/String;
public final fun getProjectName ()Ljava/lang/String;
public final fun getProjectPath ()Ljava/lang/String;
public fun hashCode ()I
@@ -477,6 +482,8 @@ public final class org/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinSourceCoordina
public static synthetic fun copy$default (Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinSourceCoordinates;Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;Ljava/lang/String;ILjava/lang/Object;)Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinSourceCoordinates;
public fun equals (Ljava/lang/Object;)Z
public final fun getBuildId ()Ljava/lang/String;
public final fun getBuildName ()Ljava/lang/String;
public final fun getBuildPath ()Ljava/lang/String;
public final fun getProject ()Lorg/jetbrains/kotlin/gradle/idea/tcs/IdeaKotlinProjectCoordinates;
public final fun getProjectName ()Ljava/lang/String;
public final fun getProjectPath ()Ljava/lang/String;
@@ -213,13 +213,114 @@ class IdeaKotlinBinaryCoordinates(
}
}
data class IdeaKotlinProjectCoordinates(
val buildId: String,
class IdeaKotlinProjectCoordinates(
val buildName: String,
val buildPath: String,
val projectPath: String,
val projectName: String,
) : Serializable, IdeaKotlinDependencyCoordinates {
/**
* Keeping binary compatibility!
*/
@Deprecated("Use 'buildName' or 'buildPath' instead")
val buildId: String get() = buildName
/**
* Keeping binary compatibility!
*/
@Deprecated("Use constructor with 'buildName' and 'buildPath' instead")
constructor(
buildId: String,
projectPath: String,
projectName: String,
) : this(
buildName = buildId,
buildPath = if (buildId.startsWith(":")) buildId else ":$buildId",
projectPath = projectPath,
projectName = projectName
)
/**
* Keeping binary compatibility!
*/
@Suppress("DEPRECATION")
@Deprecated("Use copy method with 'buildName' and 'buildPath' instead", level = DeprecationLevel.ERROR)
fun copy(
buildId: String = this.buildId,
projectPath: String = this.projectPath,
projectName: String = this.projectName,
): IdeaKotlinProjectCoordinates {
return if (this.buildId != buildId) {
IdeaKotlinProjectCoordinates(
buildId = buildId,
projectPath = projectPath,
projectName = projectName
)
} else {
IdeaKotlinProjectCoordinates(
buildName = buildName,
buildPath = buildPath,
projectPath = projectPath,
projectName = projectName
)
}
}
/**
* Keeping binary compatibility!
*/
@Deprecated("Please reference the property directly!", level = DeprecationLevel.ERROR)
@Suppress("DEPRECATION")
operator fun component1() = buildId
/**
* Keeping binary compatibility!
*/
@Deprecated("Please reference the property directly!", level = DeprecationLevel.ERROR)
operator fun component2() = projectPath
/**
* Keeping binary compatibility!
*/
@Deprecated("Please reference the property directly!", level = DeprecationLevel.ERROR)
operator fun component3() = projectName
fun copy(
buildName: String = this.buildName,
buildPath: String = this.buildPath,
projectPath: String = this.projectPath,
projectName: String = this.projectName,
): IdeaKotlinProjectCoordinates {
return IdeaKotlinProjectCoordinates(
buildName = buildName,
buildPath = buildPath,
projectPath = projectPath,
projectName = projectName
)
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is IdeaKotlinProjectCoordinates) return false
if (other.buildName != this.buildName) return false
if (other.buildPath != this.buildPath) return false
if (other.projectPath != this.projectPath) return false
if (other.projectName != this.projectName) return false
return true
}
override fun hashCode(): Int {
var result = buildName.hashCode()
result = 31 * result + buildPath.hashCode()
result = 31 * result + projectPath.hashCode()
result = 31 * result + projectName.hashCode()
return result
}
override fun toString(): String {
return "${buildId.takeIf { it != ":" }?.plus(":").orEmpty()}$projectPath"
return "${projectPath.takeIf { it != ":" }?.plus(":").orEmpty()}$projectPath"
}
internal companion object {
@@ -232,7 +333,11 @@ data class IdeaKotlinSourceCoordinates(
val sourceSetName: String,
) : IdeaKotlinDependencyCoordinates {
@Deprecated("Use 'buildPath' instead")
@Suppress("DEPRECATION")
val buildId: String get() = project.buildId
val buildName: String get() = project.buildName
val buildPath: String get() = project.buildPath
val projectPath: String get() = project.projectPath
val projectName: String get() = project.projectName
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinSourceDependency
internal class IdeaKotlinSourceDependencyMatcher(
val type: IdeaKotlinSourceDependency.Type,
val buildId: String,
val buildName: String,
val projectPath: String,
val sourceSetName: String
) : IdeaKotlinDependencyMatcher {
@@ -20,9 +20,8 @@ internal class IdeaKotlinSourceDependencyMatcher(
override fun matches(dependency: IdeaKotlinDependency): Boolean {
if (dependency !is IdeaKotlinSourceDependency) return false
return dependency.type == type &&
dependency.coordinates.buildId == buildId &&
dependency.coordinates.buildName == buildName &&
dependency.coordinates.projectPath == projectPath &&
dependency.coordinates.sourceSetName == sourceSetName
}
}
@@ -19,6 +19,7 @@ object TestIdeaKotlinInstances {
extrasKeyOf<String>() withValue "Cash"
)
@Suppress("DEPRECATION")
val simpleProjectCoordinates = IdeaKotlinProjectCoordinates(
buildId = "myBuildId",
projectPath = "my:project:path",