You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To access GitHub Packages, you need to authenticate with GitHub. You can do this by:
42
+
43
+
1. **Using environment variables:**
44
+
```bash
45
+
export USERNAME=your_github_username
46
+
export TOKEN=your_github_personal_access_token
47
+
```
48
+
49
+
2. **Using gradle.properties:**
50
+
```properties
51
+
gpr.user=your_github_username
52
+
gpr.key=your_github_personal_access_token
53
+
```
54
+
55
+
You can generate a personal access token at [GitHub > Settings > Developer settings > Personal access tokens](https://github.com/settings/tokens) with `read:packages` permission.
Copy file name to clipboardExpand all lines: lib/build.gradle.kts
+60Lines changed: 60 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ plugins {
3
3
id("buildsrc.convention.kotlin-jvm")
4
4
alias(libs.plugins.kover)
5
5
alias(libs.plugins.kotlinPluginSerialization)
6
+
`maven-publish`
6
7
}
7
8
8
9
dependencies {
@@ -21,3 +22,62 @@ dependencies {
21
22
tasks.test {
22
23
useJUnitPlatform()
23
24
}
25
+
26
+
// Configure JAR to include sources
27
+
val sourcesJar by tasks.registering(Jar::class) {
28
+
archiveClassifier.set("sources")
29
+
from(sourceSets.main.get().allSource)
30
+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
31
+
}
32
+
33
+
// Publishing configuration
34
+
publishing {
35
+
publications {
36
+
register<MavenPublication>("maven") {
37
+
groupId = "hossain.dev"
38
+
artifactId = "json5kt"
39
+
version = "1.0.0"
40
+
41
+
from(components["java"])
42
+
artifact(sourcesJar)
43
+
44
+
pom {
45
+
name.set("JSON5 Kotlin")
46
+
description.set("A robust JSON5 parser and serializer for Kotlin/JVM that extends JSON with helpful features like comments, trailing commas, and unquoted keys while maintaining full backward compatibility with JSON.")
0 commit comments