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
@@ -35,6 +35,13 @@ public final class ErrorInConstructorParameter {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.util.List<ABC> c = null;
|
||||
|
||||
public ErrorInConstructorParameter(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a, @org.jetbrains.annotations.NotNull()
|
||||
ABC b, @org.jetbrains.annotations.NotNull()
|
||||
java.util.List<? extends ABC> c) {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getA() {
|
||||
return null;
|
||||
@@ -49,13 +56,6 @@ public final class ErrorInConstructorParameter {
|
||||
public final java.util.List<ABC> getC() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ErrorInConstructorParameter(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a, @org.jetbrains.annotations.NotNull()
|
||||
ABC b, @org.jetbrains.annotations.NotNull()
|
||||
java.util.List<? extends ABC> c) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
@@ -69,39 +69,8 @@ public final class ErrorInDeclarations {
|
||||
public ABC p2;
|
||||
public BCD<java.lang.String> p3;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getP1() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void setP1(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String p0) {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final ABC getP2() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void setP2(@org.jetbrains.annotations.NotNull()
|
||||
ABC p0) {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final BCD<java.lang.String> getP3() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void setP3(@org.jetbrains.annotations.NotNull()
|
||||
BCD<java.lang.String> p0) {
|
||||
}
|
||||
|
||||
public final void overloads(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a) {
|
||||
}
|
||||
|
||||
public final void overloads(@org.jetbrains.annotations.NotNull()
|
||||
ABC a) {
|
||||
public ErrorInDeclarations() {
|
||||
super();
|
||||
}
|
||||
|
||||
public final void f1(@org.jetbrains.annotations.NotNull()
|
||||
@@ -120,8 +89,39 @@ public final class ErrorInDeclarations {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ErrorInDeclarations() {
|
||||
super();
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getP1() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final ABC getP2() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final BCD<java.lang.String> getP3() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void overloads(@org.jetbrains.annotations.NotNull()
|
||||
ABC a) {
|
||||
}
|
||||
|
||||
public final void overloads(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String a) {
|
||||
}
|
||||
|
||||
public final void setP1(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String p0) {
|
||||
}
|
||||
|
||||
public final void setP2(@org.jetbrains.annotations.NotNull()
|
||||
ABC p0) {
|
||||
}
|
||||
|
||||
public final void setP3(@org.jetbrains.annotations.NotNull()
|
||||
BCD<java.lang.String> p0) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user