Synchronized from the repo: https://github.com/kcl-lang/lib/tree/main/java
Refer to this to configure your Maven; set up your GitHub account and Token in the settings.xml
.
In your project's pom.xml, configure our repository as follows:
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/kcl-lang/*</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
This way you'll be able to import the above dependency to use the SDK.
<dependency>
<groupId>com.kcl</groupId>
<artifactId>kcl-lib</artifactId>
<version>0.8.6</version>
</dependency>
Write the code
import com.kcl.api.API;
import com.kcl.api.Spec.ExecProgram_Args;
import com.kcl.api.Spec.ExecProgram_Result;
public class ExecProgramTest {
public static void main(String[] args) throws Exception {
API api = new API();
ExecProgram_Result result = api
.execProgram(ExecProgram_Args.newBuilder().addKFilenameList("path/to/kcl.k").build());
System.out.println(result.getYamlResult());
}
}
- Install
Java 8+
- Install
cargo
andPython
(for Rust code building)
pnpm install
make build
make test
make fmt