4bf63a9539
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
176 lines
3.4 KiB
Plaintext
Vendored
176 lines
3.4 KiB
Plaintext
Vendored
import java.lang.System;
|
|
|
|
@kotlin.Metadata()
|
|
public final class Test {
|
|
@org.jetbrains.annotations.NotNull()
|
|
public static final Test.Companion Companion = null;
|
|
private final Test.Companion.Example foo;
|
|
|
|
public Test() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static enum Example {
|
|
/*public static final*/ FOO /* = new Example() */;
|
|
|
|
Example() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
////////////////////
|
|
|
|
|
|
import java.lang.System;
|
|
|
|
@kotlin.Metadata()
|
|
public final class Test2 {
|
|
@org.jetbrains.annotations.NotNull()
|
|
public static final Test2.Amigo Amigo = null;
|
|
private final Test2.Amigo.Example foo;
|
|
|
|
public Test2() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Amigo {
|
|
|
|
private Amigo() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static enum Example {
|
|
/*public static final*/ FOO /* = new Example() */;
|
|
|
|
Example() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
////////////////////
|
|
|
|
|
|
import java.lang.System;
|
|
|
|
@kotlin.Metadata()
|
|
public final class Test3 {
|
|
private final Test3.Amigo.Example foo = Test3.Amigo.Example.FOO;
|
|
|
|
public Test3() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Amigo {
|
|
@org.jetbrains.annotations.NotNull()
|
|
public static final Test3.Amigo INSTANCE = null;
|
|
|
|
private Amigo() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static enum Example {
|
|
/*public static final*/ FOO /* = new Example() */;
|
|
|
|
Example() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
////////////////////
|
|
|
|
|
|
import java.lang.System;
|
|
|
|
@kotlin.Metadata()
|
|
public final class Test4 {
|
|
@org.jetbrains.annotations.NotNull()
|
|
public static final Test4.Companion Companion = null;
|
|
private final int foo = 1;
|
|
|
|
public Test4() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Foo {
|
|
@org.jetbrains.annotations.NotNull()
|
|
public static final Test4.Companion.Foo INSTANCE = null;
|
|
public static final int constProperty = 1;
|
|
|
|
private Foo() {
|
|
super();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
////////////////////
|
|
|
|
|
|
import java.lang.System;
|
|
|
|
@kotlin.Metadata()
|
|
public final class Test5 {
|
|
private final Test5.Amigos.Companion.Goo.Example foo;
|
|
|
|
public Test5() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Amigos {
|
|
@org.jetbrains.annotations.NotNull()
|
|
public static final Test5.Amigos.Companion Companion = null;
|
|
|
|
public Amigos() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static final class Goo {
|
|
|
|
public Goo() {
|
|
super();
|
|
}
|
|
|
|
@kotlin.Metadata()
|
|
public static enum Example {
|
|
/*public static final*/ FOO /* = new Example() */;
|
|
|
|
Example() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|