You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
-
importtapmoc.configureJavaCompatibility
76
-
importtapmoc.configureKotlinCompatibility
77
-
78
-
classConventionPlugin: Plugin<Project> {
79
-
overridefunapply(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
87
28
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.
[](https://starlight.astro.build)
4
+
5
+
```
6
+
npm create astro@latest -- --template starlight
7
+
```
8
+
9
+
[](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
10
+
[](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
11
+
[](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
12
+
[](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:
|`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).
0 commit comments