This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathbuild.bat
64 lines (54 loc) · 3.17 KB
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
:: Generated by: https://github.com/swagger-api/swagger-codegen.git
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
@echo off
set FORGESDK_VERSION=1.9.9
set RESTSHARP_VERSION=108.0.1
set NEWTOWNSOFT_VERSION=13.0.1
set VS_VERSION=2022
set VS_FLAVOR=Community :: Community / Enterprise
:: if "%VCINSTALLDIR%" == ""
call "C:\Program Files\Microsoft Visual Studio\%VS_VERSION%\%VS_FLAVOR%\Common7\Tools\VsDevCmd.bat"
::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 restore Autodesk.Forge.sln
::if not exist ".\packages\RestSharp.%RESTSHARP_VERSION%"^
:: .\nuget.exe install RestSharp -Version %RESTSHARP_VERSION% -OutputDirectory packages
::if not exist ".\packages\Newtonsoft.Json.%NEWTOWNSOFT_VERSION%"^
:: .\nuget.exe install Newtonsoft.Json -Version %NEWTOWNSOFT_VERSION% -OutputDirectory packages
:: if not exist ".\bin" mkdir bin
:: copy packages\Newtonsoft.Json.%NEWTOWNSOFT_VERSION%\lib\net452\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
:: copy packages\RestSharp.%RESTSHARP_VERSION%\lib\net452\RestSharp.dll bin\RestSharp.dll
:: /platform:anycpu - default
:: /debug - not default
:: %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\Autodesk.Forge.dll /recurse:src\Autodesk.Forge\*.cs /doc:bin\Autodesk.Forge.xml
:: .\nuget pack src\Autodesk.Forge\Autodesk.Forge.csproj -Prop Platform=AnyCPU -Prop Configuration=Release
:: .\nuget pack Autodesk.Forge.nuspec
::%CSCPATH%\csc
:: -platform:anycpu
:: /reference:packages\Newtonsoft.Json.%NEWTOWNSOFT_VERSION%\lib\net452\Newtonsoft.Json.dll;packages\RestSharp.%RESTSHARP_VERSION%\lib\net452\RestSharp.dll
:: /target:library
:: /out:src\Autodesk.Forge\bin\Release\Autodesk.Forge.dll
:: /recurse:src\Autodesk.Forge\*.cs
:: /doc:src\Autodesk.Forge\bin\Release\Autodesk.Forge.xml
msbuild Autodesk.Forge.sln /p:Platform="Any CPU" /p:Configuration=Release
:: if not exist ".\bin\Release\Autodesk.Forge\bin\Release"
:: mkdir ".\bin\Release\Autodesk.Forge\bin\Release"
::xcopy .\src\Autodesk.Forge\bin\Release .\bin\Release\Autodesk.Forge\bin\Release /E /C /Y
:: nuget pack src\Autodesk.Forge\Autodesk.Forge.csproj -Prop Platform=AnyCPU -Prop Configuration=Release
:: nuget pack src\Autodesk.Forge\Autodesk.Forge.csproj -Prop Platform=AnyCPU -Prop Configuration=Release
nuget pack src\Autodesk.Forge\Autodesk.Forge.nuspec
echo .
echo ".\nuget push Autodesk.Forge.%FORGESDK_VERSION%.nupkg %NUGETAPIKEY% -Source https://www.nuget.org/api/v2/package"
:: .\nuget push Autodesk.Forge.%FORGESDK_VERSION%.nupkg %NUGETAPIKEY% -Source https://www.nuget.org/api/v2/package