Skip to content

Commit a2ef7b9

Browse files
committed
[ECO-5383] Fixed build script to enable local maven publish
1 parent c4f1f1c commit a2ef7b9

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ implementation("io.ably:ably-java:$ABLY_VERSION") {
4747
runtimeOnly("io.ably:network-client-okhttp:$ABLY_VERSION")
4848
```
4949

50+
### Publishing to local Maven repository for Development and Testing
51+
To publish the library to your local Maven repository, you can use the following command:
52+
53+
```bash
54+
./gradlew publishToMavenLocal
55+
```
56+
To use the locally published library in your project, you can add the following dependency in your `build.gradle` file:
57+
58+
```groovy
59+
repositories {
60+
mavenLocal()
61+
}
62+
```
63+
5064
### How to Add a New Network Engine
5165

5266
To add a new network engine, follow these steps:

build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ subprojects {
3030
configure(subprojects) {
3131
pluginManager.withPlugin("com.vanniktech.maven.publish") {
3232
extensions.configure<MavenPublishBaseExtension> {
33-
signAllPublications()
33+
// Check if we're running a local publish task
34+
val isLocalPublish = gradle.startParameter.taskNames.any {
35+
it.contains("publishToMavenLocal") || it.contains("ToMavenLocal")
36+
}
37+
38+
if (!isLocalPublish) {
39+
signAllPublications()
40+
}
3441
}
3542
}
3643
}

live-objects/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33
plugins {
44
`java-library`
55
alias(libs.plugins.kotlin.jvm)
6+
alias(libs.plugins.maven.publish)
67
}
78

89
repositories {

0 commit comments

Comments
 (0)