@@ -71,6 +71,78 @@ update_python_sdk_version:
7171 @echo " Python dependency update complete! Please verify changes and run tests before committing."
7272
7373
74+
75+ # Target to update Dapr package versions in all C# quickstarts (SDK variant only)
76+ # Usage: make update_dotnet_sdk_version VERSION=1.15.0
77+ update_dotnet_sdk_version :
78+ @if [ -z " $( VERSION) " ]; then \
79+ echo " Error: VERSION parameter is required. Usage: make update_csharp_dapr VERSION=1.16.0-rc01" ; \
80+ exit 1; \
81+ fi
82+ @echo " Updating Dapr packages to version $( VERSION) in all C# projects..."
83+
84+ @# Process standard SDK quickstarts
85+ @echo " Processing SDK quickstarts..."
86+ @building_blocks=$$(find . -maxdepth 1 -mindepth 1 -type d ) ; \
87+ for building_block in $$ building_blocks; do \
88+ if [ -d " $$ building_block/csharp/sdk" ]; then \
89+ echo " Checking $$ building_block/csharp/sdk for .csproj files" ; \
90+ CSPROJ_FILES=$$(find "$$building_block/csharp/sdk" -name "*.csproj" ) ; \
91+ if [ -n " $$ CSPROJ_FILES" ]; then \
92+ for CSPROJ in $$ CSPROJ_FILES; do \
93+ echo " Processing: $$ CSPROJ" ; \
94+ PROJ_DIR=$$(dirname "$$CSPROJ" ) ; \
95+ DAPR_LINES=$$(grep -A1 "PackageReference Include=\"Dapr." "$$CSPROJ" || echo "" ) ; \
96+ if [ -n " $$ DAPR_LINES" ]; then \
97+ echo " $$ DAPR_LINES" | grep " Include=\" Dapr." | while read -r LINE; do \
98+ PACKAGE=$$(echo $$LINE | sed 's/.*Include="\([^"]*\ ) " .*/\1/'); \
99+ echo " Updating $$ PACKAGE to version $( VERSION) " ; \
100+ (cd " $$ PROJ_DIR" && dotnet add " $$ (basename $$ CSPROJ)" package " $$ PACKAGE" --version $( VERSION) ) || \
101+ echo " Failed to update $$ PACKAGE in $$ CSPROJ" ; \
102+ done ; \
103+ else \
104+ echo " No Dapr package references found in $$ CSPROJ" ; \
105+ fi ; \
106+ done ; \
107+ else \
108+ echo " No .csproj files found in $$ building_block/csharp/sdk" ; \
109+ fi ; \
110+ fi ; \
111+ done
112+
113+ @# Process tutorials directory separately
114+ @echo " Processing tutorials directory..."
115+ @if [ -d " ./tutorials" ]; then \
116+ echo " Searching tutorials for .csproj files with Dapr references..." ; \
117+ TUTORIAL_CSPROJ_FILES=$$(find "./tutorials" -name "*.csproj" ) ; \
118+ if [ -n " $$ TUTORIAL_CSPROJ_FILES" ]; then \
119+ for CSPROJ in $$ TUTORIAL_CSPROJ_FILES; do \
120+ echo " Processing tutorial: $$ CSPROJ" ; \
121+ PROJ_DIR=$$(dirname "$$CSPROJ" ) ; \
122+ DAPR_LINES=$$(grep -A1 "PackageReference Include=\"Dapr." "$$CSPROJ" || echo "" ) ; \
123+ if [ -n " $$ DAPR_LINES" ]; then \
124+ echo " $$ DAPR_LINES" | grep " Include=\" Dapr." | while read -r LINE; do \
125+ PACKAGE=$$(echo $$LINE | sed 's/.*Include="\([^"]*\ ) " .*/\1/'); \
126+ echo " Updating $$ PACKAGE to version $( VERSION) " ; \
127+ (cd " $$ PROJ_DIR" && dotnet add " $$ (basename $$ CSPROJ)" package " $$ PACKAGE" --version $( VERSION) ) || \
128+ echo " Failed to update $$ PACKAGE in $$ CSPROJ" ; \
129+ done ; \
130+ else \
131+ echo " No Dapr package references found in $$ CSPROJ" ; \
132+ fi ; \
133+ done ; \
134+ else \
135+ echo " No .csproj files found in tutorials directory" ; \
136+ fi ; \
137+ else \
138+ echo " No tutorials directory found" ; \
139+ fi
140+
141+ @echo " C# Dapr package update complete! Please verify changes and run tests before committing."
142+
143+ .PHONY : update_dotnet_sdk_version
144+
145+
74146test_go_quickstarts :
75147 @echo " Testing all Go quickstarts..."
76148 @building_blocks=$$(find . -maxdepth 1 -mindepth 1 -type d ) ; \
0 commit comments