Skip to content

Commit a63ef00

Browse files
committed
Add docs
1 parent 819ffd3 commit a63ef00

15 files changed

Lines changed: 7779 additions & 86 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches: [ main ]
4+
5+
jobs:
6+
publish-pages:
7+
runs-on: ubuntu-latest
8+
if: github.event.repository.fork == false
9+
10+
# Required for the `deploy-pages` action
11+
permissions:
12+
pages: write
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
17+
- run: |
18+
export JAVA_HOME=$JAVA_HOME_21_X64 # Remove when ubuntu-latest updates to Java 21
19+
./gradlew librarianStaticContent
20+
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1
21+
with:
22+
path: "build/static"
23+
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
.fleet
33
.gradle
44
*.bak
5+
.astro
6+
.vscode
7+
dist
8+
node_modules
59

610
# Build outputs
711
build

README.md

Lines changed: 13 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
<header>
2+
<div align="center">
3+
<img src="https://raw.githubusercontent.com/GradleUp/tapmoc/refs/heads/main/docs/public/tapmoc.svg" height="100" alt="Tapmoc Logo">
4+
</div>
5+
<div align="center">
6+
17
[![Maven Central](https://img.shields.io/maven-central/v/com.gradleup.tapmoc/tapmoc-gradle-plugin?style=flat-square)](https://central.sonatype.com/namespace/com.gradleup.tapmoc)
28
[![OSS Snapshots](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fcentral.sonatype.com%2Frepository%2Fmaven-snapshots%2Fcom%2Fgradleup%2Ftapmoc%2Ftapmoc-gradle-plugin%2Fmaven-metadata.xml&label=snapshots
39
)]([https://oss.sonatype.org/content/repositories/snapshots/com/gradleup/tapmoc/](https://central.sonatype.com/repository/maven-snapshots/com/gradleup/tapmoc/tapmoc-gradle-plugin/maven-metadata.xml))
10+
</div>
11+
</header>
12+
13+
---
414

515

616
# Tapmoc
@@ -14,93 +24,10 @@ tapmoc {
1424
}
1525
```
1626

17-
### Rationale
18-
19-
Configuring Java/Kotlin compatibility flags is a mundane task that comes with surprising amounts of questions:
20-
21-
* What is the difference between `sourceCompatibility` and `targetCompatibility`?
22-
* Should I use `release` instead?
23-
* What does `release` even mean on Android?
24-
* Why do I need to configure Java compatibility if I only do Kotlin?
25-
* How do I configure `release` with Kotlin?
26-
* Should I use `tasks.withType<KotlinCompile>` or `compilerOptions {}` or something else?
27-
* Is it "1.8" or "8" or `JavaVersion.VERSION_1_8`?
28-
* Is it `org.jetbrains.kotlin.gradle.dsl.KotlinVersion` or `kotlin.KotlinVersion`?
29-
* Is this working with KMP?
30-
* And more (watch the [KotlinConf 2025 talk](https://www.youtube.com/watch?v=2Vp2QeBZkfo))...
31-
32-
Tapmoc handles all of that with just two simple functions!
33-
34-
> [!NOTE]
35-
> The KMP ecosystem is a lot less mature than the JVM ecosystem and [non-JVM targets do not support apiVersion/languageVersion](https://youtrack.jetbrains.com/issue/KT-66755/). Compatibility flags only work for JVM targets.
36-
37-
### Usage
38-
39-
```kotlin
40-
plugins {
41-
// Add your Java/Kotlin/Android plugins here
42-
id("java")
43-
// or
44-
id("org.jetbrains.kotlin.jvm")
45-
// or
46-
id("org.jetbrains.kotlin.multiplatform")
47-
id("com.android.kotlin.multiplatform.library")
48-
// or
49-
id("com.android.library")
50-
// etc...
51-
// And add the Tapmoc plugin
52-
id("com.gradleup.tapmoc").version("0.4.0")
53-
}
54-
55-
/*
56-
* Configure all your Java/Kotlin targets with a single code block.
57-
* This code block works regardless of if you're using Kotlin/Android/KMP/etc...
58-
* You can copy/paste it
59-
*/
60-
tapmoc {
61-
// Java takes an int for simplicity
62-
java(17)
63-
// Kotlin takes a string so you have more control of the patch release of the stdlib.
64-
// languageVersion/apiVersion are configured with the minor version only.
65-
kotlin("2.1.0")
66-
67-
// Optional: fail the build if any api dependency exposes incompatible Kotlin metadata, Kotlin stdlib or Java bytecode version.
68-
checkDependencies()
69-
}
70-
```
71-
72-
If you have convention plugins, you can also use Tapmoc without all the plugin ceremony:
73-
74-
```kotlin
75-
import tapmoc.configureJavaCompatibility
76-
import tapmoc.configureKotlinCompatibility
77-
78-
class ConventionPlugin: Plugin<Project> {
79-
override fun apply(target: Project) {
80-
target.configureJavaCompatibility(17)
81-
target.configureKotlinCompatibility("2.1.0")
82-
}
83-
}
84-
```
85-
86-
That's it, you can now keep on with your life.
27+
## 📚 Documentation
8728

88-
### Checking transitive dependencies
89-
90-
Enforcing compiler flags works for your own code but doesn't check your dependencies. They may use incompatible APIs that will crash at runtime and/or produce incompatible metadata that will crash at build time.
91-
92-
You can have tapmoc fail in such cases with `checkDependencies`:
93-
94-
```kotlin
95-
tapmoc {
96-
// Fail the build if any api dependency exposes incompatible Kotlin metadata, Kotlin stdlib or Java bytecode version.
97-
checkDependencies()
98-
}
99-
```
29+
See the project website for documentation:<br/>
30+
[https://gradleup.github.io/tapmoc/](https://gradleup.github.io/tapmoc/)
10031

101-
### Requirements:
10232

103-
* Gradle 8.3+
104-
* For Kotlin: Kotlin Gradle Plugin 1.9.0+
105-
* For Android: Android Gradle Plugin 8.2.0+
10633

build.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,27 @@ plugins {
1111

1212
Librarian.root(project)
1313

14+
tasks.register("docsNpmInstall", Exec::class.java) {
15+
enabled = file("docs").exists()
16+
17+
commandLine("npm", "ci")
18+
workingDir("docs")
19+
}
20+
21+
tasks.register("docsNpmBuild", Exec::class.java) {
22+
dependsOn("docsNpmInstall")
23+
24+
enabled = file("docs").exists()
25+
26+
commandLine("npm", "run", "build")
27+
workingDir("docs")
28+
}
29+
30+
tasks.named("librarianStaticContent").configure {
31+
dependsOn("docsNpmBuild")
32+
33+
val from = file("docs/dist")
34+
doLast {
35+
from.copyRecursively(outputs.files.single(), overwrite = true)
36+
}
37+
}

docs/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight
7+
```
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
10+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
11+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
12+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)
13+
14+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
15+
16+
## 🚀 Project Structure
17+
18+
Inside of your Astro + Starlight project, you'll see the following folders and files:
19+
20+
```
21+
.
22+
├── public/
23+
├── src/
24+
│ ├── assets/
25+
│ ├── content/
26+
│ │ ├── docs/
27+
│ └── content.config.ts
28+
├── astro.config.mjs
29+
├── package.json
30+
└── tsconfig.json
31+
```
32+
33+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
34+
35+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
36+
37+
Static assets, like favicons, can be placed in the `public/` directory.
38+
39+
## 🧞 Commands
40+
41+
All commands are run from the root of the project, from a terminal:
42+
43+
| Command | Action |
44+
| :------------------------ | :----------------------------------------------- |
45+
| `npm install` | Installs dependencies |
46+
| `npm run dev` | Starts local dev server at `localhost:4321` |
47+
| `npm run build` | Build your production site to `./dist/` |
48+
| `npm run preview` | Preview your build locally, before deploying |
49+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
50+
| `npm run astro -- --help` | Get help using the Astro CLI |
51+
52+
## 👀 Want to learn more?
53+
54+
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

docs/astro.config.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
export default defineConfig({
6+
site: 'https://gradleup.com',
7+
base: '/tapmoc',
8+
integrations: [
9+
starlight({
10+
title: 'Tapmoc',
11+
editLink: {
12+
baseUrl: 'https://github.com/GradleUp/tapmoc/edit/main/docs/',
13+
},
14+
logo: {
15+
src: './src/assets/logo.svg'
16+
},
17+
social: {
18+
github: 'https://github.com/GradleUp/tapmoc',
19+
},
20+
sidebar: [
21+
{ label: 'Quickstart', link: '/', },
22+
{ label: 'Guidelines for library authors', link: '/guidelines' },
23+
],
24+
}),
25+
],
26+
});

0 commit comments

Comments
 (0)