Sort class members to ensure deterministic builds
Class methods and fields are currently sorted at serialization (see
DescriptorSerializer.sort) and at deserialization (see
DeserializedMemberScope.OptimizedImplementation#addMembers). Therefore,
the contents of the generated stub files are sorted in incremental
builds but not in clean builds.
The consequence is that the contents of the generated stub files may not
be consistent across a clean build and an incremental build, making the
build non-deterministic and dependent tasks run unnecessarily (see
KT-40882).
To work around that, this commit sorts class methods and fields when
outputting stub files.
Bug: KT-40882 (there are actually 2 issues in here; this commit fixes
the first one)
Test: New DeterministicBuildIT + Updated existing test expectation files
This commit is contained in:
committed by
nataliya.valtman
parent
07a797cc3a
commit
4bf63a9539
@@ -9,13 +9,13 @@ public final class Cl {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String a = null;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getA() {
|
||||
return null;
|
||||
@java.lang.Override()
|
||||
public boolean equals(java.lang.Object p0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public java.lang.String toString() {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getA() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public final class Cl {
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public boolean equals(java.lang.Object p0) {
|
||||
return false;
|
||||
public java.lang.String toString() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user