openapi-generator/samples/client/petstore/csharp/SwaggerClient/build.bat
Jim Schubert 7b578a4c4e Update C# client structure using common standards
Aligns C# project outputs more with community accepted standards and
leverges Nuget for package management.

This also moves the generated C# sample code out of the test project's
Lib folder. The output structure here was causing some issues with
maintainability (e.g. had to update test project with generated code).

(see: https://gist.github.com/davidfowl/ed7564297c61fe9ab814)
Output for a project, IO.Swagger will now look like:

    .
    ├── IO.Swagger.sln
    ├── README.md
    ├── bin
    ├── build.bat
    ├── build.sh
    ├── docs
    ├── packages
    └── src
        ├── IO.Swagger
        │   └── packages.config
        └── IO.Swagger.Test
            └── packages.config

This is a change from the Java-like src/main/csharp/IO/Swagger/etc
structure and will be a breaking change for some.
2016-05-01 20:03:45 -04:00

15 lines
636 B
Batchfile

@echo off
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
.\nuget.exe install src\IO.Swagger\packages.config -o packages
if not exist ".\bin" mkdir bin
copy packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml