Drop external annotations support in build tools

External annotations will only be considered in the IDE for additional
inspections based on more precise types in Java libraries
This commit is contained in:
Alexander Udalov
2015-04-24 19:22:37 +03:00
committed by Dmitry Jemerov
parent f2efd30a5d
commit 13c54a2678
105 changed files with 39 additions and 1148 deletions
@@ -28,10 +28,6 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
@ValueDescription("<path>")
public String classpath;
@Argument(value = "annotations", description = "Paths to external annotations")
@ValueDescription("<path>")
public String annotations;
@Argument(value = "include-runtime", description = "Include Kotlin runtime in to resulting .jar")
public boolean includeRuntime;
@@ -41,9 +37,6 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
@Argument(value = "no-stdlib", description = "Don't include Kotlin runtime into classpath")
public boolean noStdlib;
@Argument(value = "no-jdk-annotations", description = "Don't include JDK external annotations into classpath")
public boolean noJdkAnnotations;
@Argument(value = "module", description = "Path to the module file to compile")
@ValueDescription("<path>")
public String module;
@@ -51,7 +44,7 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
@Argument(value = "script", description = "Evaluate the script file")
public boolean script;
@Argument(value = "kotlin-home", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery")
@Argument(value = "kotlin-home", description = "Path to Kotlin compiler home directory, used for runtime libraries discovery")
@ValueDescription("<path>")
public String kotlinHome;
@@ -27,7 +27,6 @@ public class ModuleBuilder(
private val sourceFiles = ArrayList<String>()
private val classpathRoots = ArrayList<String>()
private val javaSourceRoots = ArrayList<String>()
private val annotationsRoots = ArrayList<String>()
public fun addSourceFiles(pattern: String) {
sourceFiles.add(pattern)
@@ -37,10 +36,6 @@ public class ModuleBuilder(
classpathRoots.add(name)
}
public fun addAnnotationsPathEntry(name: String) {
annotationsRoots.add(name)
}
public fun addJavaSourceRoot(name: String) {
javaSourceRoots.add(name)
}
@@ -49,7 +44,6 @@ public class ModuleBuilder(
override fun getJavaSourceRoots(): List<String> = javaSourceRoots
override fun getSourceFiles(): List<String> = sourceFiles
override fun getClasspathRoots(): List<String> = classpathRoots
override fun getAnnotationsRoots(): List<String> = annotationsRoots
override fun getModuleName(): String = name
override fun getModuleType(): String = type
}
@@ -49,7 +49,6 @@ public class ModuleXmlParser {
public static final String JAVA_SOURCE_ROOTS = "javaSourceRoots";
public static final String PATH = "path";
public static final String CLASSPATH = "classpath";
public static final String EXTERNAL_ANNOTATIONS = "externalAnnotations";
@NotNull
public static ModuleScriptData parseModuleScript(
@@ -58,8 +57,8 @@ public class ModuleXmlParser {
) {
FileInputStream stream = null;
try {
stream = new FileInputStream(xmlFile);
//noinspection IOResourceOpenedButNotSafelyClosed
stream = new FileInputStream(xmlFile);
return new ModuleXmlParser(messageCollector).parse(new BufferedInputStream(stream));
}
catch (FileNotFoundException e) {
@@ -164,10 +163,6 @@ public class ModuleXmlParser {
String path = getAttribute(attributes, PATH, qName);
moduleBuilder.addClasspathEntry(path);
}
else if (EXTERNAL_ANNOTATIONS.equalsIgnoreCase(qName)) {
String path = getAttribute(attributes, PATH, qName);
moduleBuilder.addAnnotationsPathEntry(path);
}
else if (JAVA_SOURCE_ROOTS.equalsIgnoreCase(qName)) {
String path = getAttribute(attributes, PATH, qName);
moduleBuilder.addJavaSourceRoot(path);
@@ -190,10 +190,6 @@ public class KotlinToJVMBytecodeCompiler {
}
for (Module module : chunk) {
for (String annotationsRoot : module.getAnnotationsRoots()) {
configuration.add(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY, new File(annotationsRoot));
}
configuration.add(JVMConfigurationKeys.MODULES, module);
}
@@ -29,7 +29,8 @@ public class JVMConfigurationKeys {
private JVMConfigurationKeys() {
}
public static final CompilerConfigurationKey<List<File>> ANNOTATIONS_PATH_KEY = CompilerConfigurationKey.create("annotations path");
public static final CompilerConfigurationKey<List<File>> ANNOTATIONS_PATH_KEY =
CompilerConfigurationKey.create("external annotations path");
public static final CompilerConfigurationKey<List<AnalyzerScriptParameter>> SCRIPT_PARAMETERS =
CompilerConfigurationKey.create("script");