Skip to content

Commit 6dbe273

Browse files
committed
publish script improvements
1 parent ac6e151 commit 6dbe273

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

publish_client_local.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

publish_core_local.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

publish_local.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# This script publishes all FastComments Java libraries to local Maven repository
4+
5+
# Exit on error
6+
set -e
7+
8+
# Extract version from command line or use a default
9+
VERSION=${1:-1.0.0}
10+
11+
# Check if the version in client/build.gradle matches the requested version
12+
CLIENT_VERSION=$(grep -o "version = '[^']*'" ./client/build.gradle | cut -d"'" -f2)
13+
if [ "$CLIENT_VERSION" != "$VERSION" ]; then
14+
echo "ERROR: client/build.gradle version ($CLIENT_VERSION) does not match requested version ($VERSION)"
15+
echo "Please update config.json and regenerate client/build.gradle, or use version $CLIENT_VERSION"
16+
exit 1
17+
fi
18+
19+
echo "Publishing version $VERSION to local Maven repository"
20+
21+
# Publish client
22+
echo "Publishing client module..."
23+
chmod +x ./client/gradlew
24+
cd ./client && ./gradlew --init-script ./../init-client.gradle publishMavenJavaPublicationToMavenLocal -PreleaseVersion=$VERSION && cd -
25+
26+
# Publish core
27+
echo "Publishing core module..."
28+
chmod +x ./core/gradlew
29+
cd ./core && ./gradlew --init-script ./../init-core.gradle publishMavenJavaPublicationToMavenLocal -PreleaseVersion=$VERSION && cd -
30+
31+
# Publish pubsub
32+
echo "Publishing pubsub module..."
33+
chmod +x ./pubsub/gradlew
34+
cd ./pubsub && ./gradlew --init-script ./../init-pubsub.gradle publishMavenJavaPublicationToMavenLocal -PreleaseVersion=$VERSION && cd -
35+
36+
echo "All modules published successfully to local Maven repository"

publish_pubsub_local.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

pubsub/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ dependencies {
6969

7070
// Use Maven artifacts instead of project dependencies
7171
// This works better for local publishing when run from the pubsub directory
72-
implementation 'com.fastcomments:client:0.0.2'
73-
implementation 'com.fastcomments:core:0.0.2'
72+
implementation "com.fastcomments:client:${version}"
73+
implementation "com.fastcomments:core:${version}"
7474
}
7575

7676
javadoc {

0 commit comments

Comments
 (0)