You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.1 KiB

1 year ago
  1. #!/usr/bin/env bash
  2. #
  3. # Generated by: https://github.com/swagger-api/swagger-codegen.git
  4. #
  5. frameworkVersion=net45
  6. # sdk must match installed framworks under PREFIX/lib/mono/[value]
  7. sdk=4.5.2-api
  8. # langversion refers to C# language features. see man mcs for details.
  9. langversion=${sdk}
  10. nuget_cmd=nuget
  11. # Match against our known SDK possibilities
  12. case "${sdk}" in
  13. 4)
  14. langversion=4
  15. ;;
  16. 4.5*)
  17. langversion=5
  18. ;;
  19. 4.6*)
  20. langversion=6
  21. ;;
  22. 4.7*)
  23. langversion=7 # ignoring 7.1 for now.
  24. ;;
  25. *)
  26. langversion=6
  27. ;;
  28. esac
  29. echo "[INFO] Target framework: ${frameworkVersion}"
  30. if ! type nuget &>/dev/null; then
  31. echo "[INFO] Download nuget and packages"
  32. wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
  33. nuget_cmd="mono nuget.exe"
  34. fi
  35. mozroots --import --sync
  36. <<<<<<< Updated upstream
  37. ${nuget_cmd} install src/CircleSDK/packages.config -o packages;
  38. =======
  39. ${nuget_cmd} install src/IO.Swagger/packages.config -o packages;
  40. >>>>>>> Stashed changes
  41. echo "[INFO] Copy DLLs to the 'bin' folder"
  42. mkdir -p bin;
  43. cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
  44. cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
  45. cp packages/JsonSubTypes.1.2.0/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll
  46. <<<<<<< Updated upstream
  47. echo "[INFO] Run 'mcs' to build bin/CircleSDK.dll"
  48. =======
  49. echo "[INFO] Run 'mcs' to build bin/IO.Swagger.dll"
  50. >>>>>>> Stashed changes
  51. mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\
  52. bin/RestSharp.dll,\
  53. System.ComponentModel.DataAnnotations.dll,\
  54. System.Runtime.Serialization.dll \
  55. -target:library \
  56. <<<<<<< Updated upstream
  57. -out:bin/CircleSDK.dll \
  58. -recurse:'src/CircleSDK/*.cs' \
  59. -doc:bin/CircleSDK.xml \
  60. =======
  61. -out:bin/IO.Swagger.dll \
  62. -recurse:'src/IO.Swagger/*.cs' \
  63. -doc:bin/IO.Swagger.xml \
  64. >>>>>>> Stashed changes
  65. -platform:anycpu
  66. if [ $? -ne 0 ]
  67. then
  68. echo "[ERROR] Compilation failed with exit code $?"
  69. exit 1
  70. else
  71. <<<<<<< Updated upstream
  72. echo "[INFO] bin/CircleSDK.dll was created successfully"
  73. =======
  74. echo "[INFO] bin/IO.Swagger.dll was created successfully"
  75. >>>>>>> Stashed changes
  76. fi