Skip to content

Commit f23274a

Browse files
committed
Integrate knit tool into mvn site build, contributions guide
1 parent f106ff3 commit f23274a

File tree

8 files changed

+119
-34
lines changed

8 files changed

+119
-34
lines changed

integration/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@ Follow the following simple guidelines when contributing integration with your f
1616
a separate GitHub project to host this integration.
1717
* Follow the example of other modules.
1818
Cut-and-paste [kotlinx-coroutines-guava](kotlinx-coroutines-guava) module as a template.
19-
* Write tests and documentation, include top-level README.md with short overview and example.
20-
* Include it into the list of modules in this file and to the top-level [pom.xml](../pom.xml).
19+
* Write tests and documentation, include top-level `README.md` with short overview and example.
20+
* Reference the new module from all the places:
21+
* List of modules in this document.
22+
* List of modules in top-level [`pom.xml`](../pom.xml).
23+
* List of dependencies for documentation site in [`site/pom.xml`](../site/pom.xml).
24+
* List of directories for documentation site in [`site/build.xml`](../site/build.xml).
25+
* List of modules at the root of documentation site in [`site/docs/index.md`](../site/docs/index.md)
26+
* Update links to documentation website as explained [here](../knit/README.md#usage)

integration/kotlinx-coroutines-guava/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ Integration with Guava [ListenableFuture](https://github.com/google/guava/wiki/L
5555
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-guava -->
5656
<!--- DOCS_ROOT integration/kotlinx-coroutines-guava/target/dokka/kotlinx-coroutines-guava -->
5757
<!--- INDEX kotlinx.coroutines.experimental.guava -->
58+
[future]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-guava/kotlinx.coroutines.experimental.guava/future.html
59+
[com.google.common.util.concurrent.ListenableFuture]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-guava/kotlinx.coroutines.experimental.guava/com.google.common.util.concurrent.-listenable-future/index.html
60+
[com.google.common.util.concurrent.ListenableFuture.await]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-guava/kotlinx.coroutines.experimental.guava/com.google.common.util.concurrent.-listenable-future/await.html
61+
[kotlinx.coroutines.experimental.Deferred.asListenableFuture]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-guava/kotlinx.coroutines.experimental.guava/kotlinx.coroutines.experimental.-deferred/as-listenable-future.html
5862
<!--- END -->

knit/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
This is a very simple tool that produces Kotlin source example files from a markdown document that includes
44
snippets of Kotlin code in its body. It is used to produce examples for
5-
[coroutines guide](../coroutines-guide.md).
5+
[coroutines guide](../coroutines-guide.md) and other markdown documents.
6+
It also includes likes to the documentation web site into the documents.
67

7-
## Updating guide
8+
## Usage
89

910
* In project root directory do:
1011
* Run `mvn clean`
1112
* Run `mvn compile`
12-
* Run `mvn pre-site` (or `mvn site` if you have Jekyll)
13-
* Run `Knit coroutines-guide.md` (from IDEA, mark `knit/src` as source root first)
14-
* Commit updated `coroutines-guide.md` and examples
15-
13+
* Run `mvn site` (or `mvn site -DskipJekyll` if you have don't Jekyll installed or don't want to rebuild web site)
14+
* Commit updated documents and examples

knit/pom.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2016-2017 JetBrains s.r.o.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>org.jetbrains.kotlinx</groupId>
23+
<artifactId>kotlinx-coroutines</artifactId>
24+
<version>0.16-SNAPSHOT</version>
25+
</parent>
26+
27+
<artifactId>knit</artifactId>
28+
<packaging>jar</packaging>
29+
30+
<build>
31+
<sourceDirectory>src</sourceDirectory>
32+
<testSourceDirectory>test</testSourceDirectory>
33+
34+
<plugins>
35+
<!-- skip dokka for this module -->
36+
<plugin>
37+
<groupId>org.jetbrains.dokka</groupId>
38+
<artifactId>dokka-maven-plugin</artifactId>
39+
<version>${dokka.version}</version>
40+
<configuration>
41+
<skip>true</skip>
42+
</configuration>
43+
</plugin>
44+
<!-- do not deploy this module -->
45+
<plugin>
46+
<artifactId>maven-deploy-plugin</artifactId>
47+
<configuration>
48+
<skip>true</skip>
49+
</configuration>
50+
</plugin>
51+
</plugins>
52+
</build>
53+
</project>

pom.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797

9898
<modules>
9999
<module>kotlinx-coroutines-core</module>
100-
<module>integration/kotlinx-coroutines-jdk8</module>
101-
<module>integration/kotlinx-coroutines-nio</module>
102-
<module>integration/kotlinx-coroutines-guava</module>
100+
<module>benchmarks</module>
101+
<module>site</module>
102+
<module>knit</module>
103103
<module>reactive/kotlinx-coroutines-reactive</module>
104104
<module>reactive/kotlinx-coroutines-reactor</module>
105105
<module>reactive/kotlinx-coroutines-rx1</module>
@@ -108,8 +108,9 @@
108108
<module>ui/kotlinx-coroutines-swing</module>
109109
<module>ui/kotlinx-coroutines-javafx</module>
110110
<module>ui/kotlinx-coroutines-android</module>
111-
<module>site</module>
112-
<module>benchmarks</module>
111+
<module>integration/kotlinx-coroutines-jdk8</module>
112+
<module>integration/kotlinx-coroutines-nio</module>
113+
<module>integration/kotlinx-coroutines-guava</module>
113114
</modules>
114115

115116
<dependencies>

site/build.xml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,35 @@
1515
-->
1616

1717
<project name="site" default="site">
18-
<target name="site">
18+
<target name="knit" description="Run knit tool for all markdown files">
19+
<fileset dir=".." id="markdownFileSet">
20+
<include name="**/*.md"/>
21+
<exclude name="**/target/**"/>
22+
</fileset>
23+
<pathconvert property="markdownFiles" refid="markdownFileSet" pathsep=" " />
24+
<java classname="KnitKt" fork="true" dir="..">
25+
<classpath>
26+
<pathelement location="${kotlin.stdlib}/"/>
27+
<pathelement location="../knit/target/classes/"/>
28+
</classpath>
29+
<arg line="${markdownFiles}"/>
30+
</java>
31+
</target>
32+
33+
<target name="site" depends="knit">
1934
<copy todir="target">
2035
<fileset dir="docs"/>
2136
<fileset dir="../kotlinx-coroutines-core/target/dokka" includes="**/*.md"/>
22-
<fileset dir="../integration/kotlinx-coroutines-jdk8/target/dokka" includes="**/*.md"/>
23-
<fileset dir="../integration/kotlinx-coroutines-nio/target/dokka" includes="**/*.md"/>
2437
<fileset dir="../reactive/kotlinx-coroutines-reactive/target/dokka" includes="**/*.md"/>
38+
<fileset dir="../reactive/kotlinx-coroutines-reactor/target/dokka" includes="**/*.md"/>
2539
<fileset dir="../reactive/kotlinx-coroutines-rx1/target/dokka" includes="**/*.md"/>
2640
<fileset dir="../reactive/kotlinx-coroutines-rx2/target/dokka" includes="**/*.md"/>
2741
<fileset dir="../ui/kotlinx-coroutines-android/target/dokka" includes="**/*.md"/>
2842
<fileset dir="../ui/kotlinx-coroutines-javafx/target/dokka" includes="**/*.md"/>
2943
<fileset dir="../ui/kotlinx-coroutines-swing/target/dokka" includes="**/*.md"/>
44+
<fileset dir="../integration/kotlinx-coroutines-jdk8/target/dokka" includes="**/*.md"/>
45+
<fileset dir="../integration/kotlinx-coroutines-nio/target/dokka" includes="**/*.md"/>
46+
<fileset dir="../integration/kotlinx-coroutines-guava/target/dokka" includes="**/*.md"/>
3047
</copy>
3148
<antcall target="jekyll"/>
3249
</target>
@@ -40,15 +57,15 @@
4057
</condition>
4158
</target>
4259

43-
<target name="jekyll" depends="checkos, jekyll.windows, jekyll.unix"/>
60+
<target name="jekyll" depends="checkos, jekyll.windows, jekyll.unix" unless="skipJekyll"/>
4461

45-
<target name="jekyll.windows" if="isWindows">
62+
<target name="jekyll.windows" if="isWindows" unless="skipJekyll">
4663
<exec executable="jekyll.bat" dir="target">
4764
<arg line="build"/>
4865
</exec>
4966
</target>
5067

51-
<target name="jekyll.unix" if="isUnix">
68+
<target name="jekyll.unix" if="isUnix" unless="skipJekyll">
5269
<exec executable="jekyll" dir="target">
5370
<arg line="build"/>
5471
</exec>

site/docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ Library support for Kotlin coroutines. This reference is a companion to
1212

1313
[kotlinx-coroutines-core](kotlinx-coroutines-core) | Core primitives to work with coroutines
1414
[kotlinx-coroutines-reactive](kotlinx-coroutines-reactive) | Utilities for [Reactive Streams](http://www.reactive-streams.org)
15+
[kotlinx-coroutines-reactor](kotlinx-coroutines-reactor) | Utilities for [Reactor](https://projectreactor.io)
1516
[kotlinx-coroutines-rx1](kotlinx-coroutines-rx1) | Utilities for [RxJava 1.x](https://github.com/ReactiveX/RxJava/tree/1.x)
1617
[kotlinx-coroutines-rx2](kotlinx-coroutines-rx2) | Utilities for [RxJava 2.x](https://github.com/ReactiveX/RxJava)
1718
[kotlinx-coroutines-android](kotlinx-coroutines-android) | `UI` context for Android applications
1819
[kotlinx-coroutines-javafx](kotlinx-coroutines-javafx) | `JavaFx` context for JavaFX UI applications
1920
[kotlinx-coroutines-swing](kotlinx-coroutines-swing) | `Swing` context for Swing UI applications
2021
[kotlinx-coroutines-jdk8](kotlinx-coroutines-jdk8) | Extensions for JDK8 `CompletableFuture` (Android API level 24)
2122
[kotlinx-coroutines-nio](kotlinx-coroutines-nio) | Extensions for asynchronous IO on JDK7+ (Android O Preview)
23+
[kotlinx-coroutines-guava](kotlinx-coroutines-guava) | Integration with Guava [ListenableFuture](https://github.com/google/guava/wiki/ListenableFutureExplained)

site/pom.xml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,49 +33,51 @@
3333
<groupId>org.jetbrains.kotlinx</groupId>
3434
<artifactId>kotlinx-coroutines-core</artifactId>
3535
<version>${project.version}</version>
36-
<scope>compile</scope>
3736
</dependency>
3837
<dependency>
3938
<groupId>org.jetbrains.kotlinx</groupId>
40-
<artifactId>kotlinx-coroutines-jdk8</artifactId>
39+
<artifactId>kotlinx-coroutines-swing</artifactId>
4140
<version>${project.version}</version>
42-
<scope>compile</scope>
4341
</dependency>
4442
<dependency>
4543
<groupId>org.jetbrains.kotlinx</groupId>
46-
<artifactId>kotlinx-coroutines-nio</artifactId>
44+
<artifactId>kotlinx-coroutines-javafx</artifactId>
4745
<version>${project.version}</version>
48-
<scope>compile</scope>
4946
</dependency>
5047
<dependency>
5148
<groupId>org.jetbrains.kotlinx</groupId>
52-
<artifactId>kotlinx-coroutines-swing</artifactId>
49+
<artifactId>kotlinx-coroutines-reactive</artifactId>
5350
<version>${project.version}</version>
54-
<scope>compile</scope>
5551
</dependency>
5652
<dependency>
5753
<groupId>org.jetbrains.kotlinx</groupId>
58-
<artifactId>kotlinx-coroutines-javafx</artifactId>
54+
<artifactId>kotlinx-coroutines-reactor</artifactId>
5955
<version>${project.version}</version>
60-
<scope>compile</scope>
6156
</dependency>
6257
<dependency>
6358
<groupId>org.jetbrains.kotlinx</groupId>
64-
<artifactId>kotlinx-coroutines-reactive</artifactId>
59+
<artifactId>kotlinx-coroutines-rx1</artifactId>
6560
<version>${project.version}</version>
66-
<scope>compile</scope>
6761
</dependency>
6862
<dependency>
6963
<groupId>org.jetbrains.kotlinx</groupId>
70-
<artifactId>kotlinx-coroutines-rx1</artifactId>
64+
<artifactId>kotlinx-coroutines-rx2</artifactId>
7165
<version>${project.version}</version>
72-
<scope>compile</scope>
7366
</dependency>
7467
<dependency>
7568
<groupId>org.jetbrains.kotlinx</groupId>
76-
<artifactId>kotlinx-coroutines-rx2</artifactId>
69+
<artifactId>kotlinx-coroutines-jdk8</artifactId>
70+
<version>${project.version}</version>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.jetbrains.kotlinx</groupId>
74+
<artifactId>kotlinx-coroutines-nio</artifactId>
75+
<version>${project.version}</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.jetbrains.kotlinx</groupId>
79+
<artifactId>kotlinx-coroutines-guava</artifactId>
7780
<version>${project.version}</version>
78-
<scope>compile</scope>
7981
</dependency>
8082
</dependencies>
8183

@@ -88,6 +90,7 @@
8890
<phase>site</phase>
8991
<configuration>
9092
<tasks>
93+
<property name="kotlin.stdlib" value="${maven.dependency.org.jetbrains.kotlin.kotlin-stdlib.jar.path}"/>
9194
<ant target="site"/>
9295
</tasks>
9396
</configuration>

0 commit comments

Comments
 (0)