published lyngio to maven, added to docs

This commit is contained in:
Sergey Chernov 2025-11-29 09:02:28 +01:00
parent 438e48959e
commit 062f344676
3 changed files with 41 additions and 11 deletions

View File

@ -1,8 +1,6 @@
# Lyng: modern scripting for kotlin multiplatform
Please visit the project homepage: [https://lynglang.com](https://lynglang.com)
A KMP library and a standalone interpreter. v1.0.0-SNAPSHOT is now available.
Please visit the project homepage: [https://lynglang.com](https://lynglang.com) and a [telegram channel](https://t.me/lynglang) for updates.
- simple, compact, intuitive and elegant modern code:
@ -39,6 +37,7 @@ and it is multithreaded on platforms supporting it (automatically, no code chang
## Resources:
- [Language home](https://lynglang.com)
- [introduction and tutorial](docs/tutorial.md) - start here please
- [Samples directory](docs/samples)
- [Books directory](docs)

View File

@ -8,27 +8,31 @@ This module provides a uniform, suspend-first filesystem API to Lyng scripts, ba
It exposes a Lyng class `Path` with methods for file and directory operations, including streaming readers for large files.
It is a separate library because access to teh filesystem is a security risk we compensate with a separate API that user must explicitly include to the dependency and allow. Together with `FsAceessPolicy` that is required to `createFs()` which actually adds the filesystem to the scope, the security risk is isolated.
Also, it helps keep Lyng core small and focused.
---
#### Add the library to your project (Gradle)
If you use this repository as a multi-module project, add a dependency on `:lyngio`:
```kotlin
dependencies {
implementation(project(":lyngio"))
}
```
If you consume it as a published artifact (group and version may vary):
```kotlin
dependencies {
implementation("net.sergeych:lyngio:0.0.1-SNAPSHOT")
}
```
Note on maven repository. Lyngio uses ths same maven as Lyng code (`lynglib`) so it is most likely already in your project. If ont, add it to the proper section of your `build.gradle.kts` or settings.gradle.kts:
```kotlin
repositories {
maven("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
}
```
This brings in:
- `:lynglib` (Lyng engine)
- Okio (`okio`, `okio-fakefilesystem`, and `okio-nodefilesystem` for JS)
- Kotlin coroutines

View File

@ -26,6 +26,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
`maven-publish`
}
group = "net.sergeych"
@ -68,6 +69,14 @@ kotlin {
}
sourceSets {
all {
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
// languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
// Correct opt-in markers for coroutines
// languageSettings.optIn("kotlinx.coroutines.DelicateCoroutinesApi")
// languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
// languageSettings.optIn("kotlinx.coroutines.FlowPreview")
}
val commonMain by getting {
dependencies {
api(project(":lynglib"))
@ -123,3 +132,21 @@ android {
tasks.matching { it.name.startsWith("lint", ignoreCase = true) }.configureEach {
this.enabled = false
}
publishing {
val mavenToken by lazy {
File("${System.getProperty("user.home")}/.gitea_token").readText()
}
repositories {
maven {
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = mavenToken
}
url = uri("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
authentication {
create("Authorization", HttpHeaderAuthentication::class)
}
}
}
}