Skip to content

Commit bfa8800

Browse files
committed
Build website and generate API docs.
1 parent d063926 commit bfa8800

File tree

21 files changed

+273
-1
lines changed

21 files changed

+273
-1
lines changed

.buildscript/deploy_website.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
REPO="[email protected]:ReactiveCircus/FlowBinding.git"
6+
REMOTE_NAME="origin"
7+
DIR=temp-clone
8+
9+
if [ -n "${CI}" ]; then
10+
REPO="https://github.com/${GITHUB_REPOSITORY}.git"
11+
fi
12+
13+
# Clone project into a temp directory
14+
rm -rf $DIR
15+
git clone "$REPO" $DIR
16+
cd $DIR
17+
18+
# Generate API docs
19+
./gradlew dokka
20+
21+
# Copy *.md files into docs directory
22+
cp README.md docs/index.md
23+
mkdir -p docs/flowbinding-android && cp flowbinding-android/README.md docs/flowbinding-android/index.md
24+
mkdir -p docs/flowbinding-activity && cp flowbinding-activity/README.md docs/flowbinding-activity/index.md
25+
mkdir -p docs/flowbinding-appcompat && cp flowbinding-appcompat/README.md docs/flowbinding-appcompat/index.md
26+
mkdir -p docs/flowbinding-core && cp flowbinding-core/README.md docs/flowbinding-core/index.md
27+
mkdir -p docs/flowbinding-drawerlayout && cp flowbinding-drawerlayout/README.md docs/flowbinding-drawerlayout/index.md
28+
mkdir -p docs/flowbinding-lifecycle && cp flowbinding-lifecycle/README.md docs/flowbinding-lifecycle/index.md
29+
mkdir -p docs/flowbinding-material && cp flowbinding-material/README.md docs/flowbinding-material/index.md
30+
mkdir -p docs/flowbinding-navigation && cp flowbinding-navigation/README.md docs/flowbinding-navigation/index.md
31+
mkdir -p docs/flowbinding-preference && cp flowbinding-preference/README.md docs/flowbinding-preference/index.md
32+
mkdir -p docs/flowbinding-recyclerview && cp flowbinding-recyclerview/README.md docs/flowbinding-recyclerview/index.md
33+
mkdir -p docs/flowbinding-swiperefreshlayout && cp flowbinding-swiperefreshlayout/README.md docs/flowbinding-swiperefreshlayout/index.md
34+
mkdir -p docs/flowbinding-viewpager2 && cp flowbinding-viewpager2/README.md docs/flowbinding-viewpager2/index.md
35+
cp CHANGELOG.md docs/changelog.md
36+
37+
# If on CI, configure git remote with access token
38+
if [ -n "${CI}" ]; then
39+
REMOTE_NAME="https://x-access-token:${DEPLOY_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
40+
git config --global user.name "${GITHUB_ACTOR}"
41+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
42+
git remote add deploy "$REMOTE_NAME"
43+
git fetch deploy && git fetch deploy gh-pages:gh-pages
44+
fi
45+
46+
# Build the website and deploy to GitHub Pages
47+
mkdocs gh-deploy --remote-name "$REMOTE_NAME"
48+
49+
# Delete temp directory
50+
cd ..
51+
rm -rf $DIR

.github/workflows/deploy-website.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- '**.md'
9+
- 'mkdocs.yml'
10+
11+
jobs:
12+
deploy-website:
13+
name: Generate API docs and deploy website
14+
runs-on: macOS-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: gradle/wrapper-validation-action@v1
18+
- uses: actions/cache@v1
19+
with:
20+
path: ~/.gradle/caches
21+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
22+
restore-keys: ${{ runner.os }}-gradle-
23+
- run: |
24+
pip3 install mkdocs mkdocs-material mkdocs-minify-plugin pymdown-extensions
25+
.buildscript/deploy_website.sh
26+
env:
27+
CI: true
28+
JAVA_TOOL_OPTIONS: -Xmx3g
29+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process
30+
DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ captures/
2929

3030
# External native build folder generated in Android Studio 2.2 and later
3131
.externalNativeBuild
32+
33+
# Docs
34+
site
35+
docs/api

_config.yml

-1
This file was deleted.

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ buildscript {
1313
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${versions.detekt}"
1414
classpath "com.vanniktech:gradle-maven-publish-plugin:${versions.mavenPublishPlugin}"
1515
classpath "io.github.reactivecircus.firestorm:firestorm-gradle-plugin:${versions.firestormGradlePlugin}"
16+
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}")
1617
}
1718
}
1819

buildSrc/dependencies.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rootProject.ext.versions = [
33
androidLint : '27.0.0-alpha09',
44
mavenPublishPlugin : '0.9.0',
55
firestormGradlePlugin: '0.1.1',
6+
dokka : '0.10.1',
67
kotlin : '1.3.61',
78
detekt : '1.5.1',
89
kotlinx : [

docs/images/reactive_cirrus_logo.png

8.6 KB
Loading

flowbinding-activity/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-android/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-appcompat/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-common/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-core/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-drawerlayout/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-lifecycle/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-material/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-navigation/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-preference/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-recyclerview/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-swiperefreshlayout/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

flowbinding-viewpager2/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ plugins {
44
id 'kotlin-android'
55
id 'com.vanniktech.maven.publish'
66
id 'io.github.reactivecircus.firestorm'
7+
id 'org.jetbrains.dokka'
8+
}
9+
10+
afterEvaluate { project ->
11+
project.tasks.dokka {
12+
outputDirectory = "$rootDir/docs/api"
13+
outputFormat = 'gfm'
14+
}
715
}
816

917
android {

mkdocs.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
site_name: 'FlowBinding'
2+
site_description: "Kotlin Coroutines Flow binding APIs for Android's platform and unbundled UI widgets, inspired by RxBinding."
3+
site_author: 'Yang Chen'
4+
site_url: 'https://reactivecircus.github.io/FlowBinding'
5+
remote_branch: gh-pages
6+
7+
repo_name: 'FlowBinding'
8+
repo_url: 'https://github.com/ReactiveCircus/FlowBinding'
9+
10+
copyright: 'Copyright © 2019 Yang Chen'
11+
12+
theme:
13+
name: 'material'
14+
language: 'en'
15+
favicon: 'images/reactive_cirrus_logo.png'
16+
logo: 'images/reactive_cirrus_logo.png'
17+
palette:
18+
primary: 'white'
19+
accent: 'white'
20+
font:
21+
text: 'Fira Sans'
22+
code: 'Fira Code'
23+
24+
extra:
25+
social:
26+
- type: 'github'
27+
link: 'https://github.com/ReactiveCircus/FlowBinding'
28+
29+
nav:
30+
- 'Overview': index.md
31+
- 'Platform Bindings': flowbinding-android/index.md
32+
- 'AndroidX Activity Bindings': flowbinding-activity/index.md
33+
- 'AndroidX AppCompat Bindings': flowbinding-appcompat/index.md
34+
- 'AndroidX Core Bindings': flowbinding-core/index.md
35+
- 'AndroidX DrawerLayout Bindings': flowbinding-drawerlayout/index.md
36+
- 'AndroidX Lifecycle Bindings': flowbinding-lifecycle/index.md
37+
- 'AndroidX Navigation Component Bindings': flowbinding-navigation/index.md
38+
- 'AndroidX Preference Bindings': flowbinding-preference/index.md
39+
- 'AndroidX RecyclerView Bindings': flowbinding-recyclerview/index.md
40+
- 'AndroidX SwipeRefreshLayout Bindings': flowbinding-swiperefreshlayout/index.md
41+
- 'AndroidX ViewPager2 Bindings': flowbinding-viewpager2/index.md
42+
- 'Material Components Bindings': flowbinding-material/index.md
43+
- 'Change Log': changelog.md
44+
- 'API':
45+
- 'flowbinding-activity': api/flowbinding-activity/index.md
46+
- 'flowbinding-android': api/flowbinding-android/index.md
47+
- 'flowbinding-appcompat': api/flowbinding-appcompat/index.md
48+
- 'flowbinding-common': api/flowbinding-common/index.md
49+
- 'flowbinding-core': api/flowbinding-core/index.md
50+
- 'flowbinding-drawerlayout': api/flowbinding-drawerlayout/index.md
51+
- 'flowbinding-lifecycle': api/flowbinding-lifecycle/index.md
52+
- 'flowbinding-material': api/flowbinding-material/index.md
53+
- 'flowbinding-navigation': api/flowbinding-navigation/index.md
54+
- 'flowbinding-preference': api/flowbinding-preference/index.md
55+
- 'flowbinding-recyclerview': api/flowbinding-recyclerview/index.md
56+
- 'flowbinding-swiperefreshlayout': api/flowbinding-swiperefreshlayout/index.md
57+
- 'flowbinding-viewpager2': api/flowbinding-viewpager2/index.md
58+
59+
markdown_extensions:
60+
- admonition
61+
- smarty
62+
- codehilite:
63+
guess_lang: false
64+
linenums: True
65+
- footnotes
66+
- meta
67+
- toc:
68+
permalink: true
69+
- pymdownx.betterem:
70+
smart_enable: all
71+
- pymdownx.caret
72+
- pymdownx.details
73+
- pymdownx.inlinehilite
74+
- pymdownx.magiclink
75+
- pymdownx.smartsymbols
76+
- pymdownx.superfences
77+
- tables
78+
79+
plugins:
80+
- search
81+
- minify:
82+
minify_html: true

0 commit comments

Comments
 (0)