Skip to content

Commit da11e79

Browse files
committed
re-arranging the bat file
1 parent e2efde2 commit da11e79

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

generator/cybersource_dotnet_sdk_gen.bat

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,32 @@ endlocal
1313

1414
java -jar swagger-codegen-cli-2.4.38.jar generate -t cybersource-csharp-template -i cybersource-rest-spec-dotnet.json -l csharp -o ../ -c cybersource-csharp-config.json
1515

16-
powershell -Command "Get-ChildItem '..\src\Cybersource\Api\*.cs' -Recurse | ForEach-Object { (Get-Content $_).Replace('Method.POST','Method.Post').Replace('Method.GET','Method.Get').Replace('Method.PATCH','Method.Patch').Replace('Method.DELETE','Method.Delete').Replace('Method.PUT','Method.Put') | Set-Content $_ }"
16+
xcopy ..\src\cybersource ..\ /s /e /y /exclude:excludelist.txt
17+
md ..\test
18+
xcopy ..\src\cybersource.test ..\test /s /e /y
19+
rd /s /q ..\src
20+
21+
echo "starting of powershell commands"
22+
23+
powershell -Command "Get-ChildItem '..\Api\*.cs' -Recurse | ForEach-Object { (Get-Content $_).Replace('Method.POST','Method.Post').Replace('Method.GET','Method.Get').Replace('Method.PATCH','Method.Patch').Replace('Method.DELETE','Method.Delete').Replace('Method.PUT','Method.Put') | Set-Content $_ }"
1724

18-
powershell -Command "(Get-Content ..\src\CyberSource\Api\SecureFileShareApi.cs) | ForEach-Object { $_ -replace 'null\); \/\/ Return statement', 'localVarResponse.Content); // Return statement' } | Set-Content ..\src\CyberSource\Api\SecureFileShareApi.cs"
25+
powershell -Command "(Get-Content ..\Api\SecureFileShareApi.cs) | ForEach-Object { $_ -replace 'null\); \/\/ Return statement', 'localVarResponse.Content); // Return statement' } | Set-Content ..\Api\SecureFileShareApi.cs"
1926

20-
powershell -Command "(Get-Content ..\src\CyberSource\Api\ReportDownloadsApi.cs) | ForEach-Object { $_ -replace 'null\); \/\/ Return statement', 'localVarResponse.Content); // Return statement' } | Set-Content ..\src\CyberSource\Api\ReportDownloadsApi.cs"
27+
powershell -Command "(Get-Content ..\Api\ReportDownloadsApi.cs) | ForEach-Object { $_ -replace 'null\); \/\/ Return statement', 'localVarResponse.Content); // Return statement' } | Set-Content ..\Api\ReportDownloadsApi.cs"
2128

22-
powershell -Command "(Get-Content ..\src\CyberSource\Api\TransactionBatchesApi.cs) | ForEach-Object { $_ -replace 'null\); \/\/ Return statement', 'localVarResponse.Content); // Return statement' } | Set-Content ..\src\CyberSource\Api\TransactionBatchesApi.cs"
29+
powershell -Command "(Get-Content ..\Api\TransactionBatchesApi.cs) | ForEach-Object { $_ -replace 'null\); \/\/ Return statement', 'localVarResponse.Content); // Return statement' } | Set-Content ..\Api\TransactionBatchesApi.cs"
2330

24-
powershell -Command " Set-Content ..\src\CyberSource\Api\SecureFileShareApi.cs ((get-content ..\src\CyberSource\Api\SecureFileShareApi.cs -raw) -replace '\*_\/_\*;charset=utf-8', '*/*;charset=utf-8') "
31+
powershell -Command " Set-Content ..\Api\SecureFileShareApi.cs ((get-content ..\Api\SecureFileShareApi.cs -raw) -replace '\*_\/_\*;charset=utf-8', '*/*;charset=utf-8') "
2532

2633
REM For changing nuspec filename in csproj file
27-
powershell -Command "(Get-Content ..\src\CyberSource\CyberSource.csproj) | ForEach-Object { $_ -replace '<None Include=\"CyberSource.nuspec\" />', '<None Include=\"cybersource-rest-client-dotnet.nuspec\" />' } | Set-Content ..\src\CyberSource\CyberSource.csproj"
34+
powershell -Command "(Get-Content ..\CyberSource.csproj) | ForEach-Object { $_ -replace '<None Include=\"CyberSource.nuspec\" />', '<None Include=\"cybersource-rest-client-dotnet.nuspec\" />' } | Set-Content ..\CyberSource.csproj"
2835

29-
powershell -Command "(Get-Content ..\src\CyberSource.Test\CyberSource.Test.csproj) | ForEach-Object { $_ -replace 'CyberSource\\CyberSource.csproj', 'cybersource-rest-client-dotnet.csproj' } | ForEach-Object { $_ -replace '<Name>CyberSource</Name>', '<Name>cybersource-rest-client-dotnet</Name>' } | Set-Content ..\src\CyberSource.Test\CyberSource.Test.csproj"
36+
powershell -Command "(Get-Content ..\test\CyberSource.Test.csproj) | ForEach-Object { $_ -replace 'CyberSource\\CyberSource.csproj', 'cybersource-rest-client-dotnet.csproj' } | ForEach-Object { $_ -replace '<Name>CyberSource</Name>', '<Name>cybersource-rest-client-dotnet</Name>' } | Set-Content ..\test\CyberSource.Test.csproj"
3037

3138
REM For Renaming the .csproj file Name from Cybersource to cybersource-rest-client-dotnet
32-
powershell Rename-Item ..\src\CyberSource\CyberSource.csproj cybersource-rest-client-dotnet.csproj
33-
powershell Rename-Item ..\src\CyberSource.Test\CyberSource.Test.csproj cybersource-rest-client-dotnet.Test.csproj
39+
del ..\cybersource-rest-client-dotnet.csproj
40+
powershell Rename-Item ..\CyberSource.csproj cybersource-rest-client-dotnet.csproj
41+
powershell Rename-Item ..\test\CyberSource.Test.csproj cybersource-rest-client-dotnet.Test.csproj
3442

3543
REM For changing project filenames in sln file
3644
powershell -Command "(Get-Content ..\CyberSource.sln) | ForEach-Object { $_ -replace 'CyberSource', 'cybersource-rest-client-dotnet' } | Set-Content ..\CyberSource.sln"
@@ -40,7 +48,7 @@ del ..\cybersource-rest-client-dotnet.sln
4048

4149
powershell Rename-Item ..\CyberSource.sln cybersource-rest-client-dotnet.sln
4250

43-
xcopy ..\src\cybersource ..\ /s /e /y /exclude:excludelist.txt
51+
echo "completed powershell commands"
4452

4553
@REM replace sdkLinks fieldName to links for supporting links field name in request/response body
4654
echo "starting of replacing the links keyword in PblPaymentLinksAllGet200Response.cs model"
@@ -51,11 +59,8 @@ git checkout ..\README.md
5159
git checkout ..\Api\OAuthApi.cs
5260
git checkout ..\Model\AccessTokenResponse.cs
5361
git checkout ..\Model\CreateAccessTokenRequest.cs
54-
md ..\test
55-
xcopy ..\src\cybersource.test ..\test /s /e /y
56-
git checkout ..\test\packages.config
5762

58-
rd /s /q ..\src
63+
git checkout ..\test\packages.config
5964

6065
del ..\Client\IReadableConfiguration.cs
6166

0 commit comments

Comments
 (0)