Skip to content

Commit af5ae62

Browse files
authored
Add configuration for devcontainers (#79)
Resolves #69
1 parent 61e36f2 commit af5ae62

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "KMP json schema validator",
3+
"image": "mcr.microsoft.com/devcontainers/java:1.0-11",
4+
"features": {
5+
"ghcr.io/devcontainers/features/java:1" : {
6+
"version": "11",
7+
"installGradle": true,
8+
"gradleVersion": "8.1"
9+
},
10+
"ghcr.io/devcontainers/features/python:1": {
11+
"version": "3.10",
12+
"installTools": false
13+
},
14+
"ghcr.io/rocker-org/devcontainer-features/apt-packages" : {
15+
"packages": "tig"
16+
},
17+
"ghcr.io/devcontainers/features/sshd:1": {
18+
"version": "latest"
19+
}
20+
},
21+
// Download all required dependencies
22+
"postCreateCommand": {
23+
"install-dependencies": "./gradlew dependencies > /dev/null",
24+
"init-submodules": "git submodule init && git submodule update",
25+
"git-completion": "echo \"source /usr/share/bash-completion/completions/git\" >> ~/.bashrc"
26+
},
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
"fwcd.kotlin",
31+
"redhat.java",
32+
"github.vscode-github-actions",
33+
"vscjava.vscode-gradle"
34+
]
35+
}
36+
}
37+
}

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "schema-test-suite"]
22
path = test-suites/schema-test-suite
3-
url = git@github.com:json-schema-org/JSON-Schema-Test-Suite.git
3+
url = https://github.com/json-schema-org/JSON-Schema-Test-Suite.git

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ This multiplatform library is an implementation of JSON schema that can validate
1313
[JsonElement](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/json/commonMain/src/kotlinx/serialization/json/JsonElement.kt)
1414
from [kotlinx.serialization-json](https://github.com/Kotlin/kotlinx.serialization/tree/master/formats/json) library.
1515

16+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/OptimumCode/json-schema-validator)
17+
[![Open in DevPod!](https://devpod.sh/assets/open-in-devpod.svg)](https://devpod.sh/open#https://github.com/OptimumCode/json-schema-validator)
18+
1619
## Usage
1720

1821
### Supported targets
@@ -133,7 +136,7 @@ val valid = schema.validate(elementToValidate, errors::add)
133136
- [Draft 7](https://json-schema.org/specification-links.html#draft-7)
134137
<details>
135138
<summary>Supported keywords</summary>
136-
139+
137140
- Core
138141

139142
| Keyword | Status |
@@ -340,9 +343,20 @@ You can see the results in the latest workflow execution.
340343

341344
## Developer notes
342345

346+
### Build process
347+
343348
The update to Kotlin 1.9.22 came with an issue for JS incremental compilation.
344349
In case you see an error about main function that already bind please execute `clean` task.
345350

351+
### Devcontainer
352+
353+
Devcontainers is a cool feature. However, by default in Codespaces and DevPod you will use [VS Code](https://code.visualstudio.com/).
354+
This is a good IDE but not for Kotlin, unfortunately.
355+
The extension that is available for VS Code to support Kotlin works quite slow (when workspace is just started)
356+
and sometimes does not work correctly with multiplatform definitions.
357+
Because of that I higly recoment using JetBrains Gateway
358+
(but it looks like the GitHub Codespace provider is not currently compatible with latest Gateway version).
359+
346360
## Future plans
347361

348362
- [x] Add `$schema` property validation (if not set the latest supported will be used)

0 commit comments

Comments
 (0)