An IRC library written in C#
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Build-Package.cmd 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @echo off
  2. pushd %~dp0
  3. SETLOCAL ENABLEDELAYEDEXPANSION
  4. call Build-Release.cmd
  5. : loop thru nuspec files and build the packages
  6. for /R %%v in (*.nuspec) do (
  7. set file=%%~npv.csproj
  8. CALL :mkrel file
  9. : build each package (use relative path name)
  10. tools\nuget pack !file! -symbols -Properties Configuration=Release || goto fail
  11. )
  12. REM move *.nupkg ..\repo || goto fail
  13. goto fin
  14. :fail
  15. echo ERROR!
  16. echo EXITING...
  17. goto fin
  18. :mkrel
  19. :MakeRelative file base -- makes a file name relative to a base path
  20. :: -- file [in,out] - variable with file name to be converted, or file name itself for result in stdout
  21. :: -- base [in,opt] - base path, leave blank for current directory
  22. :$created 20060101 :$changed 20080219 :$categories Path
  23. :$source http://www.dostips.com
  24. SETLOCAL ENABLEDELAYEDEXPANSION
  25. set src=%~1
  26. if defined %1 set src=!%~1!
  27. set bas=%~2
  28. if not defined bas set bas=%cd%
  29. for /f "tokens=*" %%a in ("%src%") do set src=%%~fa
  30. for /f "tokens=*" %%a in ("%bas%") do set bas=%%~fa
  31. set mat=&rem variable to store matching part of the name
  32. set upp=&rem variable to reference a parent
  33. for /f "tokens=*" %%a in ('echo.%bas:\=^&echo.%') do (
  34. set sub=!sub!%%a\
  35. call set tmp=%%src:!sub!=%%
  36. if "!tmp!" NEQ "!src!" (set mat=!sub!)ELSE (set upp=!upp!..\)
  37. )
  38. set src=%upp%!src:%mat%=!
  39. ( ENDLOCAL & REM RETURN VALUES
  40. IF defined %1 (SET %~1=%src%) ELSE ECHO.%src%
  41. )
  42. EXIT /b
  43. :fin
  44. popd