Introduce "-api-version" CLI option

The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed
This commit is contained in:
Alexander Udalov
2016-09-26 19:56:22 +03:00
parent e3df8ed2fe
commit 167ab1f860
59 changed files with 1758 additions and 57 deletions
@@ -37,6 +37,30 @@ public class CliTestGenerated extends AbstractCliTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/cli/jvm"), Pattern.compile("^(.+)\\.args$"), false);
}
@TestMetadata("apiVersion.args")
public void testApiVersion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/apiVersion.args");
doJvmTest(fileName);
}
@TestMetadata("apiVersionGreaterThanLanguage.args")
public void testApiVersionGreaterThanLanguage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/apiVersionGreaterThanLanguage.args");
doJvmTest(fileName);
}
@TestMetadata("apiVersionInvalid.args")
public void testApiVersionInvalid() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/apiVersionInvalid.args");
doJvmTest(fileName);
}
@TestMetadata("apiVersionLessThanLanguage.args")
public void testApiVersionLessThanLanguage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/apiVersionLessThanLanguage.args");
doJvmTest(fileName);
}
@TestMetadata("classAndFileClassClash.args")
public void testClassAndFileClassClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/classAndFileClassClash.args");