Add KotlinVersion.IS_PRE_RELEASE and a flag to kotlin/Metadata

This commit is contained in:
Alexander Udalov
2016-12-05 12:04:10 +03:00
parent 3e69820907
commit 1342743001
10 changed files with 54 additions and 31 deletions
@@ -20,4 +20,18 @@ public class KotlinCompilerVersion {
// The value of this constant is generated by the build script
// DON'T MODIFY IT
public static final String VERSION = "@snapshot@";
// 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 = true;
static {
if (!VERSION.equals("@snapshot@") && !VERSION.contains("-") && IS_PRE_RELEASE) {
throw new IllegalStateException(
"IS_PRE_RELEASE cannot be false for a compiler without '-' in its version.\n" +
"Please change IS_PRE_RELEASE to false, commit and push this change to master"
);
}
}
}