Skip to content

Commit e055109

Browse files
committed
release 0.3.0
1 parent 05b9bd7 commit e055109

File tree

3 files changed

+51
-17
lines changed

3 files changed

+51
-17
lines changed

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Copyright 2022 Hannah Kolbeck
2+
Copyright 2024 Romain Delamare
23

34
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
45
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
@@ -12,4 +13,3 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1213
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1314
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1415
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15-

README.md

+49-15
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,57 @@ A Java implementation of a parser for the [KDL Document Language](https://github
44

55
## Status
66

7-
![Gradle CI](https://github.com/hkolbeck/kdl4j/workflows/Gradle%20CI/badge.svg)
8-
9-
This project is beta-quality. It's been extensively tested, but the spec it implements is still in flux.
7+
This branch contains the code for version 0.x of KDL4j that supports KDL 1.0. We recommend that you switch to KDL 2.0
8+
and use KDL4j 2.0 or up.
109

1110
## Usage
1211

12+
## Dependency
13+
14+
Releases are published on [GitHub Packages](https://docs.github.com/en/packages). You need to authenticate with GitHub
15+
using a token with `read:packages` permission. See the official documentation for more information on how to
16+
authenticate on GitHub Packages for
17+
[Maven](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry)
18+
or for
19+
[Gradle](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry).
20+
21+
Then you can add the KDL4j dependency. Maven:
22+
23+
```xml
24+
25+
<dependencies>
26+
<dependency>
27+
<groupId>kdl</groupId>
28+
<artifactId>kdl4j</artifactId>
29+
<version>0.3.0</version>
30+
</dependency>
31+
</dependencies>
32+
```
33+
34+
Gradle:
35+
36+
```groovy
37+
dependencies {
38+
implementation 'kdl:kdl4j:0.3.0'
39+
}
40+
```
41+
42+
Alternatively, you can use the packages [hosted by JitPack](https://jitpack.io/#kdl-org/kdl4j). In this case, make sure
43+
you use the `com.github.kdl-org` groupId.
44+
1345
### Parsing
1446

1547
```java
1648
final KDLParser parser = new KDLParser();
1749

18-
final KDLDocument documentFromString = parser.parse("node_name \"arg\"")
50+
final KDLDocument documentFromString = parser.parse("node_name \"arg\"");
1951
// OR
20-
final KDLDocument documentFromReader = parser.parse(new FileReader("some/file.kdl"))
52+
final KDLDocument documentFromReader = parser.parse(new FileReader("some/file.kdl"));
2153
```
2254

23-
`KDLDocument` objects, and all descendants of `KDLObject`, are immutable and threadsafe, though that is not true of their
24-
`Builder` objects. If you need to make changes to a `KDLDocument`, use the `filter()` and `mutate()` functions explained below.
55+
`KDLDocument` objects, and all descendants of `KDLObject`, are immutable and threadsafe, though that is not true of
56+
their `Builder` objects. If you need to make changes to a `KDLDocument`, use the `filter()` and `mutate()` functions
57+
explained below.
2558

2659
### Searching and Mutating Documents
2760

@@ -35,19 +68,20 @@ the document differs. There are three search types:
3568
Each provides four methods for searching or mutating documents:
3669

3770
* `anyMatch(document)` - Returns true if any node matches the search, false otherwise
38-
* `filter(document, trim)` - Removes all nodes from the tree not on a branch that matches the predicates of the search. if
39-
`trim` is set, removes all their non-matching children
71+
* `filter(document, trim)` - Removes all nodes from the tree not on a branch that matches the predicates of the search.
72+
if `trim` is set, removes all their non-matching children
4073
* `list(document, trim)` - Produces a new document with all matching nodes at the root. If `trim` is set, removes all
4174
their non-matching children
4275
* `mutate(document, mutation)` - Applies a provided `Mutation` to every matching node in the tree, depth first.
4376

44-
There are 3 types of `Mutations` provided, and users may provide custom mutations. Provided are `AddMutation`,
45-
`SubtractMutation`, and `SetMutation`. Each performs functions hinted at by the name. See individual javadocs for details.
77+
There are 3 types of `Mutations` provided, and users may provide custom mutations. Provided are `AddMutation`,
78+
`SubtractMutation`, and `SetMutation`. Each performs functions hinted at by the name. See individual javadocs for
79+
details.
4680

4781
### Printing
4882

4983
By default, calling `document.toKDL()` or `document.writeKDL(writer)` will print the structure with:
50-
84+
5185
* 4 space indents
5286
* No semicolons
5387
* Printable ASCII characters which can be escaped, escaped
@@ -62,6 +96,6 @@ on PrintConfig for more information.
6296

6397
Please read the Code of Conduct before opening any issues or pull requests.
6498

65-
Besides code fixes, the easiest way to contribute is by generating test cases. Check out
66-
[the test cases directory](https://github.com/hkolbeck/kdl4j/tree/trunk/src/test/resources/test_cases) to see the existing ones.
67-
See the README there for more details.
99+
Besides code fixes, the easiest way to contribute is by generating test cases. Check out
100+
[the test cases directory](https://github.com/hkolbeck/kdl4j/tree/trunk/src/test/resources/test_cases) to see the
101+
existing ones. See the README there for more details.

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.3.0-RC2
1+
version=0.3.0

0 commit comments

Comments
 (0)