forked from loafle/openapi-generator-original
* Updating packages version (#5313) * Add support to RestSharp version 106.10.1 Restsharp 106.10.1 needs the Content Lenght as a parameter to AddFile method * Updating RestSharp Version Updating RestSharp Version * Update netcore_project.mustache * Update netcore_testproject.mustache * Update Project.mustache * Updating packages version Updating packages version * Updating packages version Updating packages version * Updating packages version Updating packages version * Updating packages version Updating packages version * Updating packages version Updating packages version * Updating packages version Updating packages version * Execute task async obsolete Use ExecuteAsync instead * update csharp samples Co-authored-by: William Cheng <wing328hk@gmail.com> * [csharp] Library upgrade fix (#5848) * On .net45 framework, Restsharp version is updated to 106.10.1 Otherwise, it stays on version 105.1.0 * Added additionalProperties for library versions and target frameworks * Removed unused properties * Added an additional property to test for a specific version of RestSharp * Updated csharp samples * Fixed nuspec.mustache to use library specific additional properties * Updated csharp samples * Updating CI/samples.ci csharp petstore test project file. * Updated csharp.md Co-authored-by: Olivier Leonard <oleonard@ankama.com> * [csharp-client] Restored tests on csharp samples (#5879) * Restored tests on csharp samples * Restored a reference to the file used to test file uploads Co-authored-by: Olivier Leonard <oleonard@ankama.com> * update samples Co-authored-by: Igor Quirino <iquirino91@gmail.com> Co-authored-by: Bouillie <34162532+Bouillie@users.noreply.github.com> Co-authored-by: Olivier Leonard <oleonard@ankama.com>
69 lines
1.7 KiB
Bash
69 lines
1.7 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# Generated by: https://github.com/openapitools/openapi-generator.git
|
|
#
|
|
|
|
frameworkVersion=net40
|
|
|
|
# sdk must match installed framworks under PREFIX/lib/mono/[value]
|
|
sdk=4
|
|
|
|
# langversion refers to C# language features. see man mcs for details.
|
|
langversion=${sdk}
|
|
nuget_cmd=nuget
|
|
|
|
# Match against our known SDK possibilities
|
|
case "${sdk}" in
|
|
4)
|
|
langversion=4
|
|
;;
|
|
4.5*)
|
|
langversion=5
|
|
;;
|
|
4.6*)
|
|
langversion=6
|
|
;;
|
|
4.7*)
|
|
langversion=7 # ignoring 7.1 for now.
|
|
;;
|
|
*)
|
|
langversion=6
|
|
;;
|
|
esac
|
|
|
|
echo "[INFO] Target framework: ${frameworkVersion}"
|
|
|
|
if ! type nuget &>/dev/null; then
|
|
echo "[INFO] Download nuget and packages"
|
|
wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
|
|
nuget_cmd="mono nuget.exe"
|
|
fi
|
|
|
|
mozroots --import --sync
|
|
${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages;
|
|
|
|
echo "[INFO] Copy DLLs to the 'bin' folder"
|
|
mkdir -p bin;
|
|
cp packages/Newtonsoft.Json.12.0.3/lib/net40/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
|
cp packages/RestSharp.105.1.0/lib/net4/RestSharp.dll bin/RestSharp.dll;
|
|
cp packages/JsonSubTypes.1.6.0/lib/net40/JsonSubTypes.dll bin/JsonSubTypes.dll
|
|
|
|
echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll"
|
|
mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\
|
|
bin/RestSharp.dll,\
|
|
System.ComponentModel.DataAnnotations.dll,\
|
|
System.Runtime.Serialization.dll \
|
|
-target:library \
|
|
-out:bin/Org.OpenAPITools.dll \
|
|
-recurse:'src/Org.OpenAPITools/*.cs' \
|
|
-doc:bin/Org.OpenAPITools.xml \
|
|
-platform:anycpu
|
|
|
|
if [ $? -ne 0 ]
|
|
then
|
|
echo "[ERROR] Compilation failed with exit code $?"
|
|
exit 1
|
|
else
|
|
echo "[INFO] bin/Org.OpenAPITools.dll was created successfully"
|
|
fi
|