Revert "Add a temporary hack for migration "jet" -> "kotlin""
This reverts commit fb12c56d1a.
This commit is contained in:
@@ -42,7 +42,6 @@ import org.jetbrains.jet.lang.descriptors.ModuleDescriptor
|
|||||||
import org.jetbrains.jet.lang.resolve.name.FqName
|
import org.jetbrains.jet.lang.resolve.name.FqName
|
||||||
import com.intellij.util.containers.ContainerUtil
|
import com.intellij.util.containers.ContainerUtil
|
||||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns
|
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns
|
||||||
import org.jetbrains.jet.lang.types.lang.BuiltInsPackageMigration
|
|
||||||
import org.jetbrains.jet.utils.recursePostOrder
|
import org.jetbrains.jet.utils.recursePostOrder
|
||||||
|
|
||||||
public class BuiltInsSerializer(val out: PrintStream?) {
|
public class BuiltInsSerializer(val out: PrintStream?) {
|
||||||
@@ -84,24 +83,6 @@ public class BuiltInsSerializer(val out: PrintStream?) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (fqName in ContainerUtil.mapNotNull(files) { it?.getPackageName() }.toSet()) {
|
for (fqName in ContainerUtil.mapNotNull(files) { it?.getPackageName() }.toSet()) {
|
||||||
if (fqName == "kotlin") {
|
|
||||||
BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage = true
|
|
||||||
val provider = session.getDeclarationProviderFactory().getPackageMemberDeclarationProvider(FqName(fqName))!!
|
|
||||||
|
|
||||||
fun resolveClass(name: String): ClassDescriptor {
|
|
||||||
val classes = provider.getClassOrObjectDeclarations(Name.identifier(name))
|
|
||||||
assert(classes.size() == 1, "Class $name not found: " + classes)
|
|
||||||
return session.getClassDescriptor(classes.iterator().next())
|
|
||||||
}
|
|
||||||
BuiltInsPackageMigration.anyType = resolveClass("Any").getDefaultType()
|
|
||||||
BuiltInsPackageMigration.stringType = resolveClass("String").getDefaultType()
|
|
||||||
BuiltInsPackageMigration.annotationType = resolveClass("Annotation").getDefaultType()
|
|
||||||
BuiltInsPackageMigration.arrayClass = resolveClass("Array")
|
|
||||||
BuiltInsPackageMigration.enumClass = resolveClass("Enum")
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage = false
|
|
||||||
}
|
|
||||||
serializePackage(module, FqName(fqName), destDir)
|
serializePackage(module, FqName(fqName), destDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2014 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.jet.lang.types.lang;
|
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
|
||||||
|
|
||||||
// This is a temporary hack for migration of built-ins from package "jet" to "kotlin"
|
|
||||||
public class BuiltInsPackageMigration {
|
|
||||||
public static boolean isSerializingBuiltInsInKotlinPackage = false;
|
|
||||||
|
|
||||||
public static JetType anyType = null;
|
|
||||||
public static JetType stringType = null;
|
|
||||||
public static JetType annotationType = null;
|
|
||||||
public static ClassDescriptor arrayClass = null;
|
|
||||||
public static ClassDescriptor enumClass = null;
|
|
||||||
}
|
|
||||||
@@ -291,9 +291,6 @@ public class KotlinBuiltIns {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public ClassDescriptor getArray() {
|
public ClassDescriptor getArray() {
|
||||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
|
||||||
return BuiltInsPackageMigration.arrayClass;
|
|
||||||
}
|
|
||||||
return getBuiltInClassByName("Array");
|
return getBuiltInClassByName("Array");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,9 +385,6 @@ public class KotlinBuiltIns {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public ClassDescriptor getEnum() {
|
public ClassDescriptor getEnum() {
|
||||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
|
||||||
return BuiltInsPackageMigration.enumClass;
|
|
||||||
}
|
|
||||||
return getBuiltInClassByName("Enum");
|
return getBuiltInClassByName("Enum");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,9 +559,6 @@ public class KotlinBuiltIns {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public JetType getAnyType() {
|
public JetType getAnyType() {
|
||||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
|
||||||
return BuiltInsPackageMigration.anyType;
|
|
||||||
}
|
|
||||||
return getBuiltInTypeByClassName("Any");
|
return getBuiltInTypeByClassName("Any");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,9 +630,6 @@ public class KotlinBuiltIns {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public JetType getStringType() {
|
public JetType getStringType() {
|
||||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
|
||||||
return BuiltInsPackageMigration.stringType;
|
|
||||||
}
|
|
||||||
return getBuiltInTypeByClassName("String");
|
return getBuiltInTypeByClassName("String");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,9 +693,6 @@ public class KotlinBuiltIns {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public JetType getAnnotationType() {
|
public JetType getAnnotationType() {
|
||||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
|
||||||
return BuiltInsPackageMigration.annotationType;
|
|
||||||
}
|
|
||||||
return getBuiltInTypeByClassName("Annotation");
|
return getBuiltInTypeByClassName("Annotation");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user