Move testable IS_PRE_RELEASE flag to KotlinCompilerVersion

It'll be used in the JS back-end as well soon, so
DeserializedDescriptorResolver is not the best place for it
This commit is contained in:
Alexander Udalov
2017-02-06 20:50:42 +03:00
parent 3efda0e45a
commit 4c9afb9d20
6 changed files with 23 additions and 25 deletions
@@ -24,7 +24,18 @@ public class KotlinCompilerVersion {
// True if this compiler is of a non-stable (EAP or Beta) version.
// Binaries produced by this compiler can not be loaded by release versions of the compiler.
// Change this value before and after every major release
public static final boolean IS_PRE_RELEASE = false;
private static final boolean IS_PRE_RELEASE = false;
public static final String TEST_IS_PRE_RELEASE_SYSTEM_PROPERTY = "kotlin.test.is.pre.release";
public static boolean isPreRelease() {
String overridden = System.getProperty(TEST_IS_PRE_RELEASE_SYSTEM_PROPERTY);
if (overridden != null) {
return Boolean.parseBoolean(overridden);
}
return IS_PRE_RELEASE;
}
static {
if (!VERSION.equals("@snapshot@") && !VERSION.contains("-") && IS_PRE_RELEASE) {