Skip to content

Commit 5c30873

Browse files
committed
Update README.md
Signed-off-by: peefy <[email protected]>
1 parent 0c126c1 commit 5c30873

File tree

3 files changed

+3
-208
lines changed

3 files changed

+3
-208
lines changed

README.md

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repo mainly includes the binding of the low-level API and spec of the [KCL
55
## Rust
66

77
```shell
8-
cargo add --git https://github.com/kcl-lang/lib --branch main
8+
cargo add --git https://github.com/kcl-lang/lib kcl-lang
99
```
1010

1111
Write the Code
@@ -50,83 +50,7 @@ func main() {
5050

5151
## Java
5252

53-
### Maven
54-
55-
Generally, you can first add the `os-maven-plugin` to automatically detect the classifier based on your platform:
56-
57-
```xml
58-
<build>
59-
<extensions>
60-
<extension>
61-
<groupId>kr.motd.maven</groupId>
62-
<artifactId>os-maven-plugin</artifactId>
63-
<version>1.7.0</version>
64-
</extension>
65-
</extensions>
66-
</build>
67-
```
68-
69-
Then add the dependency to `kcl-lib` as follows:
70-
71-
```xml
72-
<dependencies>
73-
<dependency>
74-
<groupId>com.kcl</groupId>
75-
<artifactId>kcl-lib</artifactId>
76-
<version>${kcl_lib.version}</version>
77-
</dependency>
78-
<dependency>
79-
<groupId>com.kcl</groupId>
80-
<artifactId>kcl-lib</artifactId>
81-
<version>${kcl_lib.version}</version>
82-
<classifier>${os.detected.classifier}</classifier>
83-
</dependency>
84-
</dependencies>
85-
```
86-
87-
### Gradle
88-
89-
For Gradle, you can first add the `com.google.osdetector` to automatically detect the classifier based on your platform:
90-
91-
92-
```groovy
93-
plugins {
94-
id "com.google.osdetector" version "1.7.3"
95-
}
96-
```
97-
98-
Then add the dependency to `kcl-lib` as follows:
99-
100-
```groovy
101-
dependencies {
102-
implementation "com.kcl:kcl-lib:0.7.5"
103-
implementation "com.kcl:kcl-lib:0.7.5:$osdetector.classifier"
104-
}
105-
```
106-
107-
Write the code
108-
109-
```java
110-
import com.kcl.api.API;
111-
import com.kcl.api.Spec.*;
112-
import com.kcl.ast.Program;
113-
import com.kcl.util.JsonUtil;
114-
115-
public class Main {
116-
public void testProgramSymbols() throws Exception {
117-
API api = new API();
118-
LoadPackage_Result result = api.loadPackage(
119-
LoadPackage_Args.newBuilder().setResolveAst(true).setParseArgs(
120-
ParseProgram_Args.newBuilder().addPaths("./src/test_data/schema.k").build())
121-
.build());
122-
String programString = result.getProgram();
123-
Program program = JsonUtil.deserializeProgram(programString);
124-
result.getSymbolsMap().values().forEach(s -> System.out.println(s));
125-
}
126-
}
127-
```
128-
129-
See [here](./java/README.md) for more information.
53+
See [here](https://github.com/kcl-lang/kcl-java) for more information.
13054

13155
## Python
13256

a.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

java/README.md

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,3 @@
11
# KCL Artifact Library for Java
22

3-
## Example
4-
5-
```java
6-
import com.kcl.api.API;
7-
import com.kcl.api.Spec.*;
8-
import com.kcl.ast.Program;
9-
import com.kcl.util.JsonUtil;
10-
11-
public class Main {
12-
public void testProgramSymbols() throws Exception {
13-
API api = new API();
14-
LoadPackage_Result result = api.loadPackage(
15-
LoadPackage_Args.newBuilder().setResolveAst(true).setParseArgs(
16-
ParseProgram_Args.newBuilder().addPaths("./src/test_data/schema.k").build())
17-
.build());
18-
String programString = result.getProgram();
19-
Program program = JsonUtil.deserializeProgram(programString);
20-
result.getSymbolsMap().values().forEach(s -> System.out.println(s));
21-
}
22-
}
23-
```
24-
25-
## Getting Started
26-
27-
This project is built upon the native KCL core library, and it is released for multiple platforms you can use a classifier to specify the platform you are building the application on.
28-
29-
### Maven
30-
31-
Generally, you can first add the `os-maven-plugin` to automatically detect the classifier based on your platform:
32-
33-
```xml
34-
<build>
35-
<extensions>
36-
<extension>
37-
<groupId>kr.motd.maven</groupId>
38-
<artifactId>os-maven-plugin</artifactId>
39-
<version>1.7.0</version>
40-
</extension>
41-
</extensions>
42-
</build>
43-
```
44-
45-
Then add the dependency to `kcl-lib` as follows:
46-
47-
```xml
48-
<dependencies>
49-
<dependency>
50-
<groupId>com.kcl</groupId>
51-
<artifactId>kcl-lib</artifactId>
52-
<version>${kcl_lib.version}</version>
53-
</dependency>
54-
<dependency>
55-
<groupId>com.kcl</groupId>
56-
<artifactId>kcl-lib</artifactId>
57-
<version>${kcl_lib.version}</version>
58-
<classifier>${os.detected.classifier}</classifier>
59-
</dependency>
60-
</dependencies>
61-
```
62-
63-
### Gradle
64-
65-
For Gradle, you can first add the `com.google.osdetector` to automatically detect the classifier based on your platform:
66-
67-
68-
```groovy
69-
plugins {
70-
id "com.google.osdetector" version "1.7.3"
71-
}
72-
```
73-
74-
Then add the dependency to `kcl-lib` as follows:
75-
76-
```groovy
77-
dependencies {
78-
implementation "com.kcl:kcl-lib:0.7.5"
79-
implementation "com.kcl:kcl-lib:0.7.5:$osdetector.classifier"
80-
}
81-
```
82-
83-
### Classified Library
84-
85-
Note that the dependency without classifier ships all classes and resources except the `kcl-lib` shared library. And those with classifier bundle only the shared library.
86-
87-
For downstream usage, it's recommended:
88-
89-
+ Depends on the one without the classifier to write code;
90-
+ Depends on the classified ones with "test" for testing.
91-
92-
To load the shared library correctly, you can choose one of the following approaches:
93-
94-
+ Append the classified JARs to the classpath at the runtime;
95-
+ Depend on the classified JARs and build a fat JAR (You may need to depend on all the provided classified JARs for running on multiple platforms);
96-
+ Build your own `kcl-lib` shared library and specify `-Djava.library.path` to the folder containing that shared library using the `make` command.
97-
98-
## Developing
99-
100-
+ Install Python3
101-
+ Install Rust
102-
+ Install Java8+
103-
+ Install Maven
3+
See [here](https://github.com/kcl-lang/kcl-java) for more information.

0 commit comments

Comments
 (0)