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
@@ -3,6 +3,8 @@ import java.lang.System;
|
||||
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
|
||||
@kotlin.Metadata()
|
||||
public final class NonExistentType {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static final NonExistentType INSTANCE = null;
|
||||
@org.jetbrains.annotations.Nullable()
|
||||
private static final ABCDEF a = null;
|
||||
@org.jetbrains.annotations.Nullable()
|
||||
@@ -11,8 +13,23 @@ public final class NonExistentType {
|
||||
private static final Function1<ABCDEF, kotlin.Unit> c = null;
|
||||
@org.jetbrains.annotations.Nullable()
|
||||
private static final ABCDEF<java.lang.String, Function1<java.util.List<ABCDEF>, kotlin.Unit>> d = null;
|
||||
|
||||
private NonExistentType() {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static final NonExistentType INSTANCE = null;
|
||||
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
|
||||
ABCDEF a, @org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final ABCDEF b(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.Nullable()
|
||||
public final ABCDEF getA() {
|
||||
@@ -33,23 +50,6 @@ public final class NonExistentType {
|
||||
public final ABCDEF<java.lang.String, Function1<java.util.List<ABCDEF>, kotlin.Unit>> getD() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
|
||||
ABCDEF a, @org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final ABCDEF b(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private NonExistentType() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
Reference in New Issue
Block a user