Skip to content

Commit 0d34aa2

Browse files
Adds an sdk update command for Java
Signed-off-by: Elena Kolevska <[email protected]>
1 parent ae812a7 commit 0d34aa2

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

makefile

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ update_gosdk_version:
1010
echo "Error: VERSION parameter is required. Usage: make update_gosdk_version VERSION=v1.13.0-rc.1"; \
1111
exit 1; \
1212
fi
13+
@if ! [[ "$(VERSION)" == v* ]]; then \
14+
echo "Error: Go SDK VERSION must start with 'v' (e.g., v1.13.0)"; \
15+
exit 1; \
16+
fi
1317
@echo "Updating go-sdk to version $(VERSION) in all SDK variant quickstarts..."
1418
@building_blocks=$$(find . -maxdepth 1 -mindepth 1 -type d); \
1519
for building_block in $$building_blocks; do \
@@ -70,8 +74,6 @@ update_python_sdk_version:
7074
done
7175
@echo "Python dependency update complete! Please verify changes and run tests before committing."
7276

73-
74-
7577
# Target to update Dapr package versions in all C# quickstarts (SDK variant only)
7678
# Usage: make update_dotnet_sdk_version VERSION=1.15.0
7779
update_dotnet_sdk_version:
@@ -140,8 +142,6 @@ update_dotnet_sdk_version:
140142

141143
@echo "C# Dapr package update complete! Please verify changes and run tests before committing."
142144

143-
.PHONY: update_dotnet_sdk_version
144-
145145
# Target to update Dapr package versions in all JavaScript quickstarts (SDK variant only)
146146
# Usage: make update_javascript_sdk_version VERSION=3.4.0
147147
update_javascript_sdk_version:
@@ -175,7 +175,44 @@ update_javascript_sdk_version:
175175
done
176176
@echo "JavaScript Dapr package update complete! Please verify changes and run tests before committing."
177177

178-
.PHONY: update_javascript_sdk_version
178+
# Target to update Dapr SDK version in all Java quickstarts (SDK variant only)
179+
# Usage: make update_java_sdk_version VERSION=1.12.0
180+
# Target to update Dapr SDK version in all Java quickstarts (SDK variant only)
181+
# Usage: make update_java_sdk_version VERSION=1.12.0
182+
update_java_sdk_version:
183+
@if [ -z "$(VERSION)" ]; then \
184+
echo "Error: VERSION parameter is required. Usage: make update_java_sdk_version VERSION=1.12.0"; \
185+
exit 1; \
186+
fi
187+
@echo "Updating Dapr packages to version $(VERSION) in all Java projects..."
188+
@# Process standard SDK quickstarts
189+
@echo "Processing SDK quickstarts..."
190+
@building_blocks=$$(find . -maxdepth 1 -mindepth 1 -type d); \
191+
for building_block in $$building_blocks; do \
192+
if [ -d "$$building_block/java/sdk" ]; then \
193+
echo "Checking $$building_block/java/sdk for pom.xml files"; \
194+
POM_FILES=$$(find "$$building_block/java/sdk" -name "pom.xml"); \
195+
if [ -n "$$POM_FILES" ]; then \
196+
for POM in $$POM_FILES; do \
197+
POM_DIR=$$(dirname "$$POM"); \
198+
echo "Processing: $$POM"; \
199+
if grep -q "<groupId>io.dapr</groupId>" "$$POM"; then \
200+
echo " Found io.dapr dependency in $$POM"; \
201+
echo " Updating to version $(VERSION)"; \
202+
(cd "$$POM_DIR" && mvn versions:use-dep-version -Dincludes=io.dapr:dapr-sdk -DdepVersion=$(VERSION) -DgenerateBackupPoms=false -q) || \
203+
echo " Failed to update io.dapr:dapr-sdk in $$POM"; \
204+
echo " Updated dependency: "; \
205+
grep -A2 "<groupId>io.dapr</groupId>" "$$POM"; \
206+
else \
207+
echo " No io.dapr dependency found in $$POM"; \
208+
fi; \
209+
done; \
210+
else \
211+
echo "No pom.xml files found in $$building_block/java/sdk"; \
212+
fi; \
213+
fi; \
214+
done
215+
@echo "Java SDK update complete! Please verify changes and run tests before committing."
179216

180217
test_go_quickstarts:
181218
@echo "Testing all Go quickstarts..."
@@ -192,7 +229,6 @@ test_go_quickstarts:
192229
done
193230
@echo "Go quickstart testing complete!"
194231

195-
196232
test_python_quickstarts:
197233
@echo "Testing all Python quickstarts..."
198234
@building_blocks=$$(find . -maxdepth 1 -mindepth 1 -type d); \
@@ -263,4 +299,4 @@ test_javascript_quickstarts:
263299
test_all_quickstarts: test_go_quickstarts test_python_quickstarts test_csharp_quickstarts test_java_quickstarts test_javascript_quickstarts
264300
@echo "All quickstart tests complete!"
265301

266-
.PHONY: all update_gosdk_version update_python_sdk_version test_go_quickstarts test_python_quickstarts test_csharp_quickstarts test_java_quickstarts test_javascript_quickstarts test_all_quickstarts
302+
.PHONY: all update_gosdk_version update_python_sdk_version update_dotnet_sdk_version update_javascript_sdk_version update_java_sdk_version test_go_quickstarts test_python_quickstarts test_csharp_quickstarts test_java_quickstarts test_javascript_quickstarts test_all_quickstarts

0 commit comments

Comments
 (0)