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 # Lyng: modern scripting for kotlin multiplatform
Please visit the project homepage: [https://lynglang.com](https://lynglang.com) Please visit the project homepage: [https://lynglang.com](https://lynglang.com) and a [telegram channel](https://t.me/lynglang) for updates.
A KMP library and a standalone interpreter. v1.0.0-SNAPSHOT is now available.
- simple, compact, intuitive and elegant modern code: - simple, compact, intuitive and elegant modern code:
@ -39,6 +37,7 @@ and it is multithreaded on platforms supporting it (automatically, no code chang
## Resources: ## Resources:
- [Language home](https://lynglang.com)
- [introduction and tutorial](docs/tutorial.md) - start here please - [introduction and tutorial](docs/tutorial.md) - start here please
- [Samples directory](docs/samples) - [Samples directory](docs/samples)
- [Books directory](docs) - [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 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) #### Add the library to your project (Gradle)
If you use this repository as a multi-module project, add a dependency on `:lyngio`: 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 ```kotlin
dependencies { dependencies {
implementation("net.sergeych:lyngio:0.0.1-SNAPSHOT") 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: This brings in:
- `:lynglib` (Lyng engine) - `:lynglib` (Lyng engine)
- Okio (`okio`, `okio-fakefilesystem`, and `okio-nodefilesystem` for JS) - Okio (`okio`, `okio-fakefilesystem`, and `okio-nodefilesystem` for JS)
- Kotlin coroutines - Kotlin coroutines

View File

@ -26,6 +26,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins { plugins {
alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary) alias(libs.plugins.androidLibrary)
`maven-publish`
} }
group = "net.sergeych" group = "net.sergeych"
@ -68,6 +69,14 @@ kotlin {
} }
sourceSets { 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 { val commonMain by getting {
dependencies { dependencies {
api(project(":lynglib")) api(project(":lynglib"))
@ -123,3 +132,21 @@ android {
tasks.matching { it.name.startsWith("lint", ignoreCase = true) }.configureEach { tasks.matching { it.name.startsWith("lint", ignoreCase = true) }.configureEach {
this.enabled = false 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)
}
}
}
}