@@ -57,6 +57,8 @@ set rootDirPath=%cd%
5757popd
5858set sdkPath = %rootDirPath% \%srcDir% \%sdkDir%
5959set sdkScriptsDirPath = %sdkPath% \Scripts
60+ set utilsScriptsDirPath = %rootDirPath% \devops\scripts
61+ set utilsScript = !utilsScriptsDirPath! \utils.bat
6062
6163:: Override some values via parameters ::::::::::::::::::::::::::::::::::::::::
6264
@@ -98,30 +100,30 @@ set externalModulesDirPath=!rootDirPath!\..\!externalModulesDir!
98100set downloadDirPath = !rootDirPath! \!downloadDir!
99101
100102:: Let's go
101- if /i " !useColor! " == " true" call " !sdkScriptsDirPath! \utils.bat " setESC
103+ if /i " !useColor! " == " true" call " !utilsScript! " setESC
102104
103105set lineWidth = 70
104106
105- call " !sdkScriptsDirPath! \utils.bat " WriteLine
106- call " !sdkScriptsDirPath! \utils.bat " WriteLine " Creating CodeProject.AI Module Downloads" " DarkYellow" " Default" !lineWidth!
107- call " !sdkScriptsDirPath! \utils.bat " WriteLine
108- call " !sdkScriptsDirPath! \utils.bat " WriteLine " ========================================================================" " DarkGreen"
109- call " !sdkScriptsDirPath! \utils.bat " WriteLine
110- call " !sdkScriptsDirPath! \utils.bat " WriteLine " CodeProject.AI Packager " " DarkGreen"
111- call " !sdkScriptsDirPath! \utils.bat " WriteLine
112- call " !sdkScriptsDirPath! \utils.bat " WriteLine " ========================================================================" " DarkGreen"
113- call " !sdkScriptsDirPath! \utils.bat " WriteLine
107+ call " !utilsScript! " WriteLine
108+ call " !utilsScript! " WriteLine " Creating CodeProject.AI Module Downloads" " DarkYellow" " Default" !lineWidth!
109+ call " !utilsScript! " WriteLine
110+ call " !utilsScript! " WriteLine " ========================================================================" " DarkGreen"
111+ call " !utilsScript! " WriteLine
112+ call " !utilsScript! " WriteLine " CodeProject.AI Packager " " DarkGreen"
113+ call " !utilsScript! " WriteLine
114+ call " !utilsScript! " WriteLine " ========================================================================" " DarkGreen"
115+ call " !utilsScript! " WriteLine
114116
115117
116118if /i " %verbosity% " neq " quiet" (
117- call " !sdkScriptsDirPath! \utils.bat " WriteLine
118- call " !sdkScriptsDirPath! \utils.bat " WriteLine " rootDirPath = !rootDirPath! " !color_mute!
119- call " !sdkScriptsDirPath! \utils.bat " WriteLine " thisScriptDirPath = !thisScriptDirPath! " !color_mute!
120- call " !sdkScriptsDirPath! \utils.bat " WriteLine " sdkPath = !sdkPath! " !color_mute!
121- call " !sdkScriptsDirPath! \utils.bat " WriteLine " sdkScriptsDirPath = !sdkScriptsDirPath! " !color_mute!
122- call " !sdkScriptsDirPath! \utils.bat " WriteLine " modulesDirPath = !modulesDirPath! " !color_mute!
123- call " !sdkScriptsDirPath! \utils.bat " WriteLine " externalModulesDirPath = !externalModulesDirPath! " !color_mute!
124- call " !sdkScriptsDirPath! \utils.bat " WriteLine
119+ call " !utilsScript! " WriteLine
120+ call " !utilsScript! " WriteLine " rootDirPath = !rootDirPath! " !color_mute!
121+ call " !utilsScript! " WriteLine " thisScriptDirPath = !thisScriptDirPath! " !color_mute!
122+ call " !utilsScript! " WriteLine " sdkPath = !sdkPath! " !color_mute!
123+ call " !utilsScript! " WriteLine " utilsScriptsDirPath = !utilsScriptsDirPath! " !color_mute!
124+ call " !utilsScript! " WriteLine " modulesDirPath = !modulesDirPath! " !color_mute!
125+ call " !utilsScript! " WriteLine " externalModulesDirPath = !externalModulesDirPath! " !color_mute!
126+ call " !utilsScript! " WriteLine
125127)
126128
127129:: And off we go...
@@ -149,10 +151,10 @@ for /f "delims=" %%D in ('dir /a:d /b "!modulesDirPath!"') do (
149151 set packageModuleDirName = %%~nxD
150152 set packageModuleDirPath = !modulesDirPath! \!packageModuleDirName!
151153
152- call " !sdkScriptsDirPath! \utils.bat " GetModuleIdFromModuleSettingsFile " !packageModuleDirPath! \modulesettings.json"
154+ call " !utilsScript! " GetModuleIdFromModuleSettingsFile " !packageModuleDirPath! \modulesettings.json"
153155 set packageModuleId = !moduleSettingValue!
154156
155- if /i " %verbosity% " neq " quiet" call " !sdkScriptsDirPath! \utils.bat " WriteLine " Processing !packageModuleDirName! (!packageModuleId! )"
157+ if /i " %verbosity% " neq " quiet" call " !utilsScript! " WriteLine " Processing !packageModuleDirName! (!packageModuleId! )"
156158
157159 if " !packageModuleId! " neq " " (
158160 call :DoModulePackage " !packageModuleId! " " !packageModuleDirName! " " !packageModuleDirPath! " errors
@@ -165,20 +167,20 @@ for /f "delims=" %%D in ('dir /a:d /b "!externalModulesDirPath!"') do (
165167 set packageModuleDirName = %%~nxD
166168 set packageModuleDirPath = !externalModulesDirPath! \!packageModuleDirName!
167169
168- call " !sdkScriptsDirPath! \utils.bat " GetModuleIdFromModuleSettingsFile " !packageModuleDirPath! \modulesettings.json"
170+ call " !utilsScript! " GetModuleIdFromModuleSettingsFile " !packageModuleDirPath! \modulesettings.json"
169171 set packageModuleId = !moduleSettingValue!
170172
171- if /i " %verbosity% " neq " quiet" call " !sdkScriptsDirPath! \utils.bat " WriteLine " Processing !packageModuleDirName! (!packageModuleId! )"
173+ if /i " %verbosity% " neq " quiet" call " !utilsScript! " WriteLine " Processing !packageModuleDirName! (!packageModuleId! )"
172174
173175 if " !packageModuleId! " neq " " (
174176 call :DoModulePackage " !packageModuleId! " " !packageModuleDirName! " " !packageModuleDirPath! " errors
175177 if " !moduleInstallErrors! " NEQ " " set success = false
176178 )
177179)
178180
179- call " !sdkScriptsDirPath! \utils.bat " WriteLine
180- call " !sdkScriptsDirPath! \utils.bat " WriteLine " Modules packaging Complete" " White" " DarkGreen" !lineWidth!
181- call " !sdkScriptsDirPath! \utils.bat " WriteLine
181+ call " !utilsScript! " WriteLine
182+ call " !utilsScript! " WriteLine " Modules packaging Complete" " White" " DarkGreen" !lineWidth!
183+ call " !utilsScript! " WriteLine
182184
183185if /i " !success! " == " false" exit /b 1
184186goto :eof
@@ -196,7 +198,7 @@ REM Creates a package for a module
196198 set packageModuleDirPath = %~3
197199
198200 if /i " %verbosity% " neq " quiet" (
199- call " !sdkScriptsDirPath! \utils.bat " WriteLine " packageModuleDirPath = !packageModuleDirPath! " !color_mute!
201+ call " !utilsScript! " WriteLine " packageModuleDirPath = !packageModuleDirPath! " !color_mute!
200202 )
201203
202204 if exist " !packageModuleDirPath! \package.bat" (
@@ -208,40 +210,40 @@ REM Creates a package for a module
208210 if " !includeDotNet! " == " false" if /i " !packageModuleId! " == " SentimentAnalysis" set doPackage = false
209211
210212 if " !doPackage! " == " false" (
211- call " !sdkScriptsDirPath! \utils.bat " WriteLine " Skipping packaging module !packageModuleId! ..." " DarkRed"
213+ call " !utilsScript! " WriteLine " Skipping packaging module !packageModuleId! ..." " DarkRed"
212214 ) else (
213215 REM Read the version from the modulesettings.json file and then pass this
214216 REM version to the package.bat file.
215- call " !sdkScriptsDirPath! \utils.bat " Write " Preparing !packageModuleId! ..."
216- call " !sdkScriptsDirPath! \utils.bat " GetValueFromModuleSettingsFile " !packageModuleDirPath! " , " !packageModuleId! " , " Version"
217+ call " !utilsScript! " Write " Preparing !packageModuleId! ..."
218+ call " !utilsScript! " GetValueFromModuleSettingsFile " !packageModuleDirPath! " , " !packageModuleId! " , " Version"
217219 set packageVersion = !moduleSettingsFileValue!
218220
219221 if " !packageVersion! " == " " (
220- call " !sdkScriptsDirPath! \utils.bat " WriteLine " Unable to read version from modulesettings file. Skipping" " Red"
222+ call " !utilsScript! " WriteLine " Unable to read version from modulesettings file. Skipping" " Red"
221223 ) else (
222224
223225 pushd " !packageModuleDirPath! "
224226 if /i " %verbosity% " == " loud" cd
225227
226228 rem Create module download package
227229 if exist package.bat (
228- call " !sdkScriptsDirPath! \utils.bat " Write " Packaging !packageModuleId! !packageVersion! ..." " White"
230+ call " !utilsScript! " Write " Packaging !packageModuleId! !packageVersion! ..." " White"
229231 call package.bat !packageModuleId! !packageVersion!
230- if errorlevel 1 call " !sdkScriptsDirPath! \utils.bat " WriteLine " Error in package.bat for !packageModuleDirName! " " Red"
232+ if errorlevel 1 call " !utilsScript! " WriteLine " Error in package.bat for !packageModuleDirName! " " Red"
231233
232234 rem Move package into modules download cache
233235
234236 rem echo Moving !packageModuleDirPath!\!packageModuleId!-!version!.zip to !downloadDirPath!\!modulesDir!\
235237 move /Y !packageModuleDirPath! \!packageModuleId! -!packageVersion! .zip !downloadDirPath! \!modulesDir! \ > NUL
236238
237239 if errorlevel 1 (
238- call " !sdkScriptsDirPath! \utils.bat " WriteLine " Error" " Red"
240+ call " !utilsScript! " WriteLine " Error" " Red"
239241 set success = false
240242 ) else (
241- call " !sdkScriptsDirPath! \utils.bat " WriteLine " done" " DarkGreen"
243+ call " !utilsScript! " WriteLine " done" " DarkGreen"
242244 )
243245 ) else (
244- call " !sdkScriptsDirPath! \utils.bat " WriteLine " No package.bat file found..." " Red"
246+ call " !utilsScript! " WriteLine " No package.bat file found..." " Red"
245247 )
246248
247249 popd
0 commit comments