Skip to content
Permalink
Browse files

Get build working again: Correct publish paths in prebuild event

- publish is relative to current directory, not project location
- nit: use `$(MSBuildProjectDirectory)` to make all paths in this event absolute
- remove redundant commands from build/01_Build.bat

nit: update NSwag.Npm/package-lock.json
  • Loading branch information...
dougbu committed Jul 28, 2019
1 parent 996b61f commit 67f4edf95f4b34a5d7203524bf9c256fe7adb597
Showing with 22 additions and 29 deletions.
  1. +2 −9 build/01_Build.bat
  2. +1 −1 src/NSwag.Npm/package-lock.json
  3. +19 −19 src/NSwagStudio.Installer/NSwagStudio.Installer.wixproj
@@ -10,14 +10,7 @@ xcopy "%~dp0/../src/NSwag.Console/bin/Release/net461" "%~dp0/../src/NSwag.Npm/bi
xcopy "%~dp0\..\src\NSwag.Console.x86\bin\Release\net461\NSwag.x86.exe" "%~dp0\..\src\NSwag.Npm\bin\binaries\Win"
xcopy "%~dp0\..\src\NSwag.Console.x86\bin\Release\net461\NSwag.x86.exe.config" "%~dp0\..\src\NSwag.Npm\bin\binaries\Win"

REM Build and copy .NET Core command line
dotnet restore "%~dp0/../src/NSwag.ConsoleCore" --no-cache
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp1.0" -o "bin/release/netcoreapp1.0/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp1.1" -o "bin/release/netcoreapp1.1/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp2.0" -o "bin/release/netcoreapp2.0/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp2.1" -o "bin/release/netcoreapp2.1/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp2.2" -o "bin/release/netcoreapp2.2/Publish" /property:Platform=AnyCPU || goto :error

REM Build and publish .NET Core command line done in prebuild event for NSwagStudio.Installer.wixproj
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp1.0/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore10" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp1.1/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore11" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.0/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore20" /E /I /y
@@ -32,4 +25,4 @@ REM Package nuspecs
goto :EOF
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
exit /b %errorlevel%

Some generated files are not rendered by default. Learn more.

@@ -52,28 +52,28 @@
<HeatDirectory DirectoryRefId="RootDirectory" VerboseOutput="true" AutogenerateGuids="true" GenerateGuidsNow="true" SuppressRootDirectory="true" OutputFile="Generated.wxs" RunAsSeparateProcess="true" PreprocessorVariable="var.SourcePath" Directory="..\NSwagStudio\bin\$(Configuration)" ComponentGroupName="SourceComponentGroup" ToolPath="$(WixToolPath)" />
</Target>
<PropertyGroup>
<PreBuildEvent>rmdir "../../../../src/NSwagStudio/bin/$(ConfigurationName)/Win" /Q /S nonemptydir
rmdir "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore10" /Q /S nonemptydir
rmdir "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore11" /Q /S nonemptydir
rmdir "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore20" /Q /S nonemptydir
rmdir "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore21" /Q /S nonemptydir
rmdir "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore22" /Q /S nonemptydir
<PreBuildEvent>rmdir "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/Win" /Q /S nonemptydir
rmdir "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore10" /Q /S nonemptydir
rmdir "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore11" /Q /S nonemptydir
rmdir "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore20" /Q /S nonemptydir
rmdir "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore21" /Q /S nonemptydir
rmdir "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore22" /Q /S nonemptydir

dotnet restore "../../../../src/NSwag.ConsoleCore" --no-cache
dotnet restore "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/NSwag.ConsoleCore.csproj" --no-cache

dotnet publish "../../../../src/NSwag.ConsoleCore" -c $(ConfigurationName) -f "netcoreapp1.0" -o "bin/$(ConfigurationName)/netcoreapp1.0/Publish" /property:Platform=AnyCPU
dotnet publish "../../../../src/NSwag.ConsoleCore" -c $(ConfigurationName) -f "netcoreapp1.1" -o "bin/$(ConfigurationName)/netcoreapp1.1/Publish" /property:Platform=AnyCPU
dotnet publish "../../../../src/NSwag.ConsoleCore" -c $(ConfigurationName) -f "netcoreapp2.0" -o "bin/$(ConfigurationName)/netcoreapp2.0/Publish" /property:Platform=AnyCPU
dotnet publish "../../../../src/NSwag.ConsoleCore" -c $(ConfigurationName) -f "netcoreapp2.1" -o "bin/$(ConfigurationName)/netcoreapp2.1/Publish" /property:Platform=AnyCPU
dotnet publish "../../../../src/NSwag.ConsoleCore" -c $(ConfigurationName) -f "netcoreapp2.2" -o "bin/$(ConfigurationName)/netcoreapp2.2/Publish" /property:Platform=AnyCPU
dotnet publish "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/NSwag.ConsoleCore.csproj" -c $(ConfigurationName) -f "netcoreapp1.0" -o "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp1.0/Publish" /property:Platform=AnyCPU
dotnet publish "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/NSwag.ConsoleCore.csproj" -c $(ConfigurationName) -f "netcoreapp1.1" -o "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp1.1/Publish" /property:Platform=AnyCPU
dotnet publish "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/NSwag.ConsoleCore.csproj" -c $(ConfigurationName) -f "netcoreapp2.0" -o "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.0/Publish" /property:Platform=AnyCPU
dotnet publish "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/NSwag.ConsoleCore.csproj" -c $(ConfigurationName) -f "netcoreapp2.1" -o "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.1/Publish" /property:Platform=AnyCPU
dotnet publish "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/NSwag.ConsoleCore.csproj" -c $(ConfigurationName) -f "netcoreapp2.2" -o "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.2/Publish" /property:Platform=AnyCPU

xcopy "../../../../src/NSwag.Console.x86/bin/$(ConfigurationName)/net461" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/Win" /E /I /y
xcopy "../../../../src/NSwag.Console/bin/$(ConfigurationName)/net461" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/Win" /E /I /y
xcopy "$(MSBuildProjectDirectory)/../NSwag.Console.x86/bin/$(ConfigurationName)/net461" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/Win" /E /I /y
xcopy "$(MSBuildProjectDirectory)/../NSwag.Console/bin/$(ConfigurationName)/net461" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/Win" /E /I /y

xcopy "../../../../src/NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp1.0/publish" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore10" /E /I /y
xcopy "../../../../src/NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp1.1/publish" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore11" /E /I /y
xcopy "../../../../src/NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.0/publish" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore20" /E /I /y
xcopy "../../../../src/NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.1/publish" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore21" /E /I /y
xcopy "../../../../src/NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.2/publish" "../../../../src/NSwagStudio/bin/$(ConfigurationName)/NetCore22" /E /I /y</PreBuildEvent>
xcopy "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp1.0/publish" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore10" /E /I /y
xcopy "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp1.1/publish" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore11" /E /I /y
xcopy "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.0/publish" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore20" /E /I /y
xcopy "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.1/publish" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore21" /E /I /y
xcopy "$(MSBuildProjectDirectory)/../NSwag.ConsoleCore/bin/$(ConfigurationName)/netcoreapp2.2/publish" "$(MSBuildProjectDirectory)/../NSwagStudio/bin/$(ConfigurationName)/NetCore22" /E /I /y</PreBuildEvent>
</PropertyGroup>
</Project>

0 comments on commit 67f4edf

Please sign in to comment.
You can’t perform that action at this time.