frontend.android renamed to android-compiler-plugin

This commit is contained in:
Andrey Breslav
2014-09-23 18:11:03 +04:00
committed by Yan Zhulanow
parent 35028227a0
commit 565ce5a781
19 changed files with 35 additions and 17 deletions
+1 -1
View File
@@ -38,8 +38,8 @@
<element id="module-output" name="idea-analysis" /> <element id="module-output" name="idea-analysis" />
<element id="module-output" name="ide-common" /> <element id="module-output" name="ide-common" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" /> <element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
<element id="module-output" name="frontend.android" />
<element id="module-output" name="kotlin-android-plugin" /> <element id="module-output" name="kotlin-android-plugin" />
<element id="module-output" name="android-compiler-plugin" />
</element> </element>
<element id="library" level="project" name="javax.inject" /> <element id="library" level="project" name="javax.inject" />
<element id="directory" name="jps"> <element id="directory" name="jps">
-1
View File
@@ -18,7 +18,6 @@
<module fileurl="file://$PROJECT_DIR$/core/descriptors/descriptors.iml" filepath="$PROJECT_DIR$/core/descriptors/descriptors.iml" group="core" /> <module fileurl="file://$PROJECT_DIR$/core/descriptors/descriptors.iml" filepath="$PROJECT_DIR$/core/descriptors/descriptors.iml" group="core" />
<module fileurl="file://$PROJECT_DIR$/eval4j/eval4j.iml" filepath="$PROJECT_DIR$/eval4j/eval4j.iml" group="ide" /> <module fileurl="file://$PROJECT_DIR$/eval4j/eval4j.iml" filepath="$PROJECT_DIR$/eval4j/eval4j.iml" group="ide" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend/frontend.iml" filepath="$PROJECT_DIR$/compiler/frontend/frontend.iml" group="compiler" /> <module fileurl="file://$PROJECT_DIR$/compiler/frontend/frontend.iml" filepath="$PROJECT_DIR$/compiler/frontend/frontend.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.android/frontend.android.iml" filepath="$PROJECT_DIR$/compiler/frontend.android/frontend.android.iml" group="compiler" />
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" filepath="$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" group="compiler/java" /> <module fileurl="file://$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" filepath="$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" group="compiler/java" />
<module fileurl="file://$PROJECT_DIR$/generators/generators.iml" filepath="$PROJECT_DIR$/generators/generators.iml" group="infrastructure" /> <module fileurl="file://$PROJECT_DIR$/generators/generators.iml" filepath="$PROJECT_DIR$/generators/generators.iml" group="infrastructure" />
<module fileurl="file://$PROJECT_DIR$/grammar/grammar.iml" filepath="$PROJECT_DIR$/grammar/grammar.iml" group="compiler" /> <module fileurl="file://$PROJECT_DIR$/grammar/grammar.iml" filepath="$PROJECT_DIR$/grammar/grammar.iml" group="compiler" />
+1
View File
@@ -15,5 +15,6 @@
<orderEntry type="module" module-name="serialization.jvm" /> <orderEntry type="module" module-name="serialization.jvm" />
<orderEntry type="module" module-name="backend-common" exported="" /> <orderEntry type="module" module-name="backend-common" exported="" />
<orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="android-compiler-plugin" />
</component> </component>
</module> </module>
+1 -1
View File
@@ -19,6 +19,6 @@
<orderEntry type="module" module-name="serialization" /> <orderEntry type="module" module-name="serialization" />
<orderEntry type="module" module-name="serialization.jvm" /> <orderEntry type="module" module-name="serialization.jvm" />
<orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="frontend.android" /> <orderEntry type="module" module-name="android-compiler-plugin" />
</component> </component>
</module> </module>
+1 -1
View File
@@ -14,6 +14,6 @@
<orderEntry type="module" module-name="serialization.jvm" /> <orderEntry type="module" module-name="serialization.jvm" />
<orderEntry type="module" module-name="descriptor.loader.java" exported="" /> <orderEntry type="module" module-name="descriptor.loader.java" exported="" />
<orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="frontend.android" /> <orderEntry type="module" module-name="android-compiler-plugin" />
</component> </component>
</module> </module>
+1
View File
@@ -22,5 +22,6 @@
<orderEntry type="module" module-name="preloader" /> <orderEntry type="module" module-name="preloader" />
<orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="frontend.android" scope="TEST" /> <orderEntry type="module" module-name="frontend.android" scope="TEST" />
<orderEntry type="module" module-name="android-compiler-plugin" />
</component> </component>
</module> </module>
+1
View File
@@ -24,5 +24,6 @@
<orderEntry type="module" module-name="js.dart-ast" scope="TEST" /> <orderEntry type="module" module-name="js.dart-ast" scope="TEST" />
<orderEntry type="module" module-name="js.frontend" scope="TEST" /> <orderEntry type="module" module-name="js.frontend" scope="TEST" />
<orderEntry type="module" module-name="util" scope="TEST" /> <orderEntry type="module" module-name="util" scope="TEST" />
<orderEntry type="module" module-name="android-compiler-plugin" scope="TEST" />
</component> </component>
</module> </module>
+2 -1
View File
@@ -38,12 +38,13 @@
<orderEntry type="module" module-name="serialization.jvm" /> <orderEntry type="module" module-name="serialization.jvm" />
<orderEntry type="library" scope="PROVIDED" name="maven" level="project" /> <orderEntry type="library" scope="PROVIDED" name="maven" level="project" />
<orderEntry type="module" module-name="eval4j" /> <orderEntry type="module" module-name="eval4j" />
<orderEntry type="module" module-name="frontend.android" />
<orderEntry type="library" name="android" level="project" /> <orderEntry type="library" name="android" level="project" />
<orderEntry type="module" module-name="idea-analysis" exported="" /> <orderEntry type="module" module-name="idea-analysis" exported="" />
<orderEntry type="module" module-name="kotlin-android-plugin" /> <orderEntry type="module" module-name="kotlin-android-plugin" />
<orderEntry type="module" module-name="js.frontend" /> <orderEntry type="module" module-name="js.frontend" />
<orderEntry type="library" scope="PROVIDED" name="coverage-plugin" level="project" /> <orderEntry type="library" scope="PROVIDED" name="coverage-plugin" level="project" />
<orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="util" />
<orderEntry type="library" name="android_tests" level="project" />
<orderEntry type="module" module-name="android-compiler-plugin" />
</component> </component>
</module> </module>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="plugin-api" exported="" />
<orderEntry type="module" module-name="frontend" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="module" module-name="cli" />
</component>
</module>
@@ -50,7 +50,7 @@ import org.jetbrains.jet.lang.resolve.android.AndroidConst.*
public abstract class AndroidUIXmlProcessor(protected val project: Project) { public abstract class AndroidUIXmlProcessor(protected val project: Project) {
class NoAndroidManifestFound : Exception("No android manifest file found in project root") public class NoAndroidManifestFound : Exception("No android manifest file found in project root")
private enum class CacheAction { HIT; MISS } private enum class CacheAction { HIT; MISS }
@@ -45,7 +45,7 @@ class AndroidWidget(val id: String, val className: String) : AndroidResource
class AndroidManifest(val _package: String) : AndroidResource class AndroidManifest(val _package: String) : AndroidResource
fun isAndroidSyntheticFile(f: PsiFile?): Boolean { fun isAndroidSyntheticFile(f: PsiFile?): Boolean {
return f?.getUserData(AndroidConst.ANDROID_USER_PACKAGE) != null return f?.getUserData(org.jetbrains.jet.lang.resolve.android.AndroidConst.ANDROID_USER_PACKAGE) != null
} }
public fun isAndroidSyntheticElement(element: PsiElement?): Boolean { public fun isAndroidSyntheticElement(element: PsiElement?): Boolean {
@@ -21,11 +21,10 @@ import java.io.File
import java.io.FileInputStream import java.io.FileInputStream
import org.xml.sax.helpers.DefaultHandler import org.xml.sax.helpers.DefaultHandler
import org.xml.sax.Attributes import org.xml.sax.Attributes
import org.jetbrains.jet.lang.resolve.android.AndroidUIXmlProcessor.NoAndroidManifestFound
import javax.xml.parsers.SAXParser import javax.xml.parsers.SAXParser
import javax.xml.parsers.SAXParserFactory import javax.xml.parsers.SAXParserFactory
public class CliAndroidResourceManager(project: Project, searchPath: String?, private val manifestPath: String?) : AndroidResourceManagerBase(project, searchPath) { public class CliAndroidResourceManager(project: Project, searchPath: String?, private val manifestPath: String?) : org.jetbrains.jet.lang.resolve.android.AndroidResourceManagerBase(project, searchPath) {
val saxParser: SAXParser = initSAX() val saxParser: SAXParser = initSAX()
@@ -34,7 +33,7 @@ public class CliAndroidResourceManager(project: Project, searchPath: String?, pr
saxFactory?.setNamespaceAware(true) saxFactory?.setNamespaceAware(true)
return saxFactory!!.newSAXParser() return saxFactory!!.newSAXParser()
} }
override fun readManifest(): AndroidManifest { override fun readManifest(): org.jetbrains.jet.lang.resolve.android.AndroidManifest {
try { try {
val manifestXml = File(manifestPath!!) val manifestXml = File(manifestPath!!)
var _package: String = "" var _package: String = ""
@@ -49,10 +48,10 @@ public class CliAndroidResourceManager(project: Project, searchPath: String?, pr
catch (e: Exception) { catch (e: Exception) {
throw e throw e
} }
return AndroidManifest(_package) return org.jetbrains.jet.lang.resolve.android.AndroidManifest(_package)
} }
catch (e: Exception) { catch (e: Exception) {
throw NoAndroidManifestFound() throw org.jetbrains.jet.lang.resolve.android.AndroidUIXmlProcessor.NoAndroidManifestFound()
} }
} }
} }
@@ -20,16 +20,16 @@ import java.util.ArrayList
import com.intellij.openapi.project.Project import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile import com.intellij.psi.PsiFile
class CliAndroidUIXmlProcessor(project: Project, override val searchPath: String?, val manifestPath: String?) : AndroidUIXmlProcessor(project) { public class CliAndroidUIXmlProcessor(project: Project, override val searchPath: String?, val manifestPath: String?) : org.jetbrains.jet.lang.resolve.android.AndroidUIXmlProcessor(project) {
override var androidAppPackage: String = "" override var androidAppPackage: String = ""
get() = resourceManager.readManifest()._package get() = resourceManager.readManifest()._package
override val resourceManager = CliAndroidResourceManager(project, searchPath, manifestPath) override val resourceManager = org.jetbrains.jet.lang.resolve.android.CliAndroidResourceManager(project, searchPath, manifestPath)
override fun parseSingleFileImpl(file: PsiFile): String { override fun parseSingleFileImpl(file: PsiFile): String {
val ids: MutableCollection<AndroidWidget> = ArrayList() val ids: MutableCollection<AndroidWidget> = ArrayList()
val handler = AndroidXmlHandler(resourceManager, { id, wClass -> ids.add(AndroidWidget(id, wClass)) }) val handler = org.jetbrains.jet.lang.resolve.android.AndroidXmlHandler(resourceManager, { id, wClass -> ids.add(AndroidWidget(id, wClass)) })
try { try {
resourceManager.saxParser.parse(file.getVirtualFile()?.getInputStream()!!, handler) resourceManager.saxParser.parse(file.getVirtualFile()?.getInputStream()!!, handler)
return produceKotlinProperties(KotlinStringWriter(), ids).toString() return produceKotlinProperties(KotlinStringWriter(), ids).toString()
@@ -22,7 +22,7 @@ trait KotlinWriter {
class KotlinStringWriter : KotlinWriter { class KotlinStringWriter : KotlinWriter {
private val ctx = Context() private val ctx = org.jetbrains.jet.lang.resolve.android.Context()
private val imports = ctx.fork() private val imports = ctx.fork()
private val body = ctx.fork() private val body = ctx.fork()