Development versions of this library are delivered as both a Maven package and an NPM package.
- The kotlin-multiplatform gradle plugin needs Gradle 6.0 or later.
- Make sure you have a recent version of Node.js (required to generate Javascript).
LICENSEREADME.mdDoc: userREADME.dev.mdDoc: developer.git/Config: Git.gitignoresettings.gradle.ktsConfig: Gradle: project namebuild.gradle.ktsConfig: Gradle: metadata, dependencies, publications, config (Kotlin, kotest, ktlint)pre-commitGit pre-commit lint script; installed bygradle assemble(taskinstallGitHook).editorconfigConfig: ktlint (& IDE).gitlab-ci.ymlConfig: continuous integration
src/CodecommonMain/Source code common to all platformscommonTest/Tests code common to all platformskotlin/crdtlib/utils/CustomGenerators.ktGenerators for property-based tests
**/*PropTest.ktProperty-based tests**/*Test.ktTests
jvmMain/Source code for JVM targetkotlin/crdtlib/GenerateTS.ktTS typings (*.d.ts) generator
nodeJsMain/Source code for JavaScript target
build/Project artifactsreports/tests/allTests/Tests results, created and populated bygradle allTestsbuild/dokka/html/crdtlib/Auto-generated documentation, created and populated bygradle dokkaHtmllibs/Maven packagespublications/npm/nodeJs/NPM package- … (non exhaustive)
.gradle/Gradle project cache
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 module);
- creates a TypeScript interface
- assembles Maven packages
gradle allTests:
- runs JVM test suite;
- runs Node.js test suite in a server like manner;
- generate tests reports.
gradle pack:
- pack the NPM package
gradle publish:
- publish the Maven and NPM packages to the Gitlab Packages registry (requires authentication ; better use it via CI pipelines).
gradle dokkaHtml:
- creates the HTML documentation from code comments. See
gradle tasksfor variants other than HTML.
gradle clean:
- cleans the project.
gradle tasks:
- show all available tasks with descriptions.
This library is delivered as both a Maven package and an NPM package in a private Gitlab Packages registry.
To use it, you will need to authenticate to Gitlab, using either:
- a Gitlab deploy token with at least the
read_package_registryscope, or - a Gitlab personal access token with at least the
read_apiscope.
To setup authentication, add the token to your gradle properties file
~/.gradle/gradle.properties:
gitlabToken=<deployOrPersonalToken>Then, in your project configuration build file build.gradle.kts:
- Ensure
mavenCentral()is listed in therepositories{}for usual packages. - Add Gitlab to repositories:
repositories {
maven(url = "https://jitpack.io")
maven {
url = uri("https://gitlab.inria.fr/api/v4/projects/18591/packages/maven")
credentials(HttpHeaderCredentials::class) {
// set to "Deploy-Token" here if appropriate
name = "Private-Token"
val gitlabToken: String by project
value = gitlabToken
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}- Add the c-crdtlib Maven package as a dependency:
dependencies {
implementation("concordant:c-crdtlib:x.y.z")
}First setup authentication:
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>"