diff --git a/build.xml b/build.xml
index 0b4d78d21b8..3c206ea66ab 100644
--- a/build.xml
+++ b/build.xml
@@ -49,6 +49,7 @@
+
@@ -58,6 +59,8 @@
+
+
@@ -171,6 +174,9 @@
+
+
+
diff --git a/kdoc/kdoc.iml b/kdoc/kdoc.iml
new file mode 100644
index 00000000000..172f564d709
--- /dev/null
+++ b/kdoc/kdoc.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kdoc/pom.xml b/kdoc/pom.xml
new file mode 100644
index 00000000000..6c6ab8c7a3a
--- /dev/null
+++ b/kdoc/pom.xml
@@ -0,0 +1,79 @@
+
+
+
+ 4.0.0
+
+ org.jetbrains.kotlin
+ kdoc
+ 1.0-SNAPSHOT
+
+
+ 4.8.1
+ 0.2.3.8
+ 0.2.3.8-beta-6
+ ${project.basedir}/../dist/kotlinc
+
+
+
+
+ evgeny-goldin.org
+ http://evgeny-goldin.org/artifactory/repo/
+
+
+
+
+
+ evgeny-goldin.org
+ http://evgeny-goldin.org/artifactory/repo/
+
+
+
+
+
+
+ org.jetbrains.kotlin
+ kotlin-compiler
+ ${kotlin-compiler.version}
+ system
+ ${kotlin-sdk}/lib/kotlin-compiler.jar
+
+
+ org.jetbrains.kotlin
+ intellij-core.
+ ${kotlin-compiler.version}
+ system
+ ${kotlin-sdk}/lib/intellij-core.jar
+
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ ${project.basedir}/src/main/kotlin
+ ${project.basedir}/src/test/kotlin
+
+
+ com.goldin.plugins
+ kotlin-maven-plugin
+ ${kotlin-maven-plugin.version}
+
+
+ compile-kotlin-sources
+
+ compile
+ testCompile
+
+
+
+
+
+
+
+
diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/model/KModelHack.java b/kdoc/src/main/kotlin/org/jetbrains/kotlin/model/KModelHack.java
new file mode 100644
index 00000000000..832796c56d5
--- /dev/null
+++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/model/KModelHack.java
@@ -0,0 +1,24 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.kotlin.model;
+
+/**
+ * Hack around the issue of
+ */
+public class KModelHack {
+}
diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/model/KModelVisitor.java b/kdoc/src/main/kotlin/org/jetbrains/kotlin/model/KModelVisitor.java
new file mode 100644
index 00000000000..1fedcaf85e4
--- /dev/null
+++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/model/KModelVisitor.java
@@ -0,0 +1,27 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.kotlin.model;
+
+import org.jetbrains.jet.lang.psi.JetVisitor;
+
+/**
+ */
+public class KModelVisitor { // extends JetVisitor {
+
+
+}
diff --git a/kdoc/src/org/jetbrains/kotlin/doc/KDoc.kt b/kdoc/src/org/jetbrains/kotlin/doc/KDoc.kt
new file mode 100644
index 00000000000..f7afceddace
--- /dev/null
+++ b/kdoc/src/org/jetbrains/kotlin/doc/KDoc.kt
@@ -0,0 +1,4 @@
+package org.jetbrains.kotlin.doc
+
+class KDocProcessor {
+}
diff --git a/kdoc/src/org/jetbrains/kotlin/model/KotlinModel.kt b/kdoc/src/org/jetbrains/kotlin/model/KotlinModel.kt
new file mode 100644
index 00000000000..e5265792a4d
--- /dev/null
+++ b/kdoc/src/org/jetbrains/kotlin/model/KotlinModel.kt
@@ -0,0 +1,5 @@
+package org.jetbrains.kotlin.model
+
+/**
+ */
+
diff --git a/kdoc/src/test/kotlin/org/jetbrains/kotlin/doc/ModelTest.kt b/kdoc/src/test/kotlin/org/jetbrains/kotlin/doc/ModelTest.kt
new file mode 100644
index 00000000000..fd7ca3de3b8
--- /dev/null
+++ b/kdoc/src/test/kotlin/org/jetbrains/kotlin/doc/ModelTest.kt
@@ -0,0 +1,52 @@
+package test.model
+
+import std.*
+import std.util.*
+
+import org.jetbrains.kotlin.model.*
+
+import junit.framework.TestCase
+import junit.framework.Assert
+import junit.framework.Assert.assertEquals
+
+class ModelTest : TestCase() {
+ val model = KModel()
+
+ fun testGetClassViaPackage() {
+ val p = model.getPackage("foo.bar")
+ val c = p.getClass("Cheese")
+
+ println("Got class: $c")
+
+ // TODO should use the ktest library really for nicer asserts
+ Assert.assertEquals("foo.bar.Cheese", c.name)
+ Assert.assertEquals("foo.bar", c.packageName)
+ Assert.assertEquals("Cheese", c.simpleName)
+ }
+
+ fun testGetClassViaQualifiedName() {
+ val c = model.getClass("something.else.Foo")
+
+ println("Got class: $c")
+
+ // TODO should use the ktest library really for nicer asserts
+ Assert.assertEquals("something.else.Foo", c.name)
+ Assert.assertEquals("something.else", c.packageName)
+ Assert.assertEquals("Foo", c.simpleName)
+ }
+
+ fun testModelWalk() {
+ model.getClass("something.else.Aaa")
+ model.getClass("something.else.Zzz")
+
+ // now lets iterate through the model
+ println("Walking the model...")
+ for (p in model.packages) {
+ println("Package ${p.name}")
+ for (c in p.classes) {
+ println(" ${c.simpleName}")
+ }
+ println()
+ }
+ }
+}