Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b7540377 authored by Florent Coriat's avatar Florent Coriat
Browse files

README: add build and usage instructions

parent c2fa10e6
No related branches found
No related tags found
1 merge request!12Resolve "Deliver NPM package to GitLab registry"
......@@ -14,12 +14,67 @@ The code of the version v0 is in the directory *src/*.
The pseudo code of the version v1 is in the directory *pseudo-code-v1/*.
## Usage
This library is delivered as an NPM package and a Maven in [Gitlab Packages](
https://gitlab.inria.fr/concordant/software/c-client/-/packages)
(as a private registry).
### NPM install
Get a deploy token or personal access token from Gitlab,
with at least the read_package_registry scope.
Then setup authentication:
``` shell
$ npm config set @concordant:registry "https://gitlab.inria.fr/api/v4/packages/npm/"
$ npm config set '//gitlab.inria.fr/api/v4/packages/npm/:_authToken' "<deployOrPersonalToken>"
```
Install the package:
``` shell
$ npm i @concordant/c-client
```
And use it:
``` typescript
import * from @concordant/c-client;
```
## Build project
The building is managed through the use of Gradle.
The build is managed by Gradle.
Kotlin sources (code and tests) are compiled to JVM Bytecode
and to Javascript as a Node.js package.
`gradle assemble`:
- compiles code and tests to JVM Bytecode;
- compiles code and tests to Javascript (Node.js package);
- creates a TypeScript interface
- assembles a NPM package
`gradle allTests`:
- runs JVM test suite;
- runs Node.js test suite in a server like manner;
- a report containing all tests results can be found in the file
`build/reports/tests/allTests/index.html`.
`gradle build`:
- compiles code and test.
`gradle pack`:
- pack the NPM package
`gradle publish`:
- publish the NPM package to the Gitlab Packages registry
(requires authentication ; better use it via CI pipelines).
`gradle dokkaHtml`:
- creates the documentation from code comments;
- documentation is accessible at `build/dokka/html/crdtlib/index.html`.
See `gradle tasks` for variants other than HTML.
Build depends on the C-CRDTLib Maven registry package see
[here](https://gitlab.inria.fr/concordant/software/c-crdtlib/-/blob/master/README.md)
how to install it.
`gradle clean`:
- cleans the project.
*gradle build*: compiles code.
`gradle tasks`:
- show all available tasks with descriptions.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment