added a little experimental kdoc module using the maven plugin for dogfooding
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
|
||||
<target name="compileStdlib" depends="jar">
|
||||
<mkdir dir="${output}/classes/stdlib"/>
|
||||
<mkdir dir="${output}/apidoc/stdlib"/>
|
||||
<java classname="org.jetbrains.jet.cli.KotlinCompiler">
|
||||
<classpath>
|
||||
<path refid="classpath"/>
|
||||
@@ -58,6 +59,8 @@
|
||||
<arg value="${basedir}/stdlib/ktSrc"/>
|
||||
<arg value="-output"/>
|
||||
<arg value="${output}/classes/stdlib"/>
|
||||
<arg value="-docOutput"/>
|
||||
<arg value="${output}/apidoc/stdlib"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
@@ -171,6 +174,9 @@
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="test" depends="dist,testlib" description="Creates the distribution and runs all the tests"/>
|
||||
|
||||
<target name="zip" depends="dist">
|
||||
<echo file="${kotlin-home}/build.txt" message="${build.number}"/>
|
||||
<zip destfile="${output}/${output.name}.zip">
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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/main/kotlin" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="stdlib" exported="" />
|
||||
<orderEntry type="module" module-name="frontend" exported="" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kdoc</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<kotlin-compiler.version>0.2.3.8</kotlin-compiler.version>
|
||||
<kotlin-maven-plugin.version>0.2.3.8-beta-6</kotlin-maven-plugin.version>
|
||||
<kotlin-sdk>${project.basedir}/../dist/kotlinc</kotlin-sdk>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>evgeny-goldin.org</id>
|
||||
<url>http://evgeny-goldin.org/artifactory/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>evgeny-goldin.org</id>
|
||||
<url>http://evgeny-goldin.org/artifactory/repo/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<dependencies>
|
||||
<!-- TODO a dirty hack until we have the artifacts in a mvn repo -->
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-compiler</artifactId>
|
||||
<version>${kotlin-compiler.version}</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${kotlin-sdk}/lib/kotlin-compiler.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>intellij-core.</artifactId>
|
||||
<version>${kotlin-compiler.version}</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${kotlin-sdk}/lib/intellij-core.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.goldin.plugins</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin-maven-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile-kotlin-sources</id>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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<Void, KModel> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.jetbrains.kotlin.doc
|
||||
|
||||
class KDocProcessor {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.jetbrains.kotlin.model
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user