Updating the mono compile script to target .net 2

This commit is contained in:
Andrew B 2015-07-21 11:12:17 -07:00
parent a6012ecf41
commit 0247f0774d
5 changed files with 12 additions and 5 deletions

View File

@ -101,8 +101,12 @@ public class Unity3DCsharpDotNet2ClientCodegen extends DefaultCodegen implements
additionalProperties.put("packageName", packageName); additionalProperties.put("packageName", packageName);
} }
additionalProperties.put("clientPackage", clientPackage); if (additionalProperties.containsKey("clientPackage")) {
this.setClientPackage((String) additionalProperties.get("clientPackage"));
} else {
additionalProperties.put("clientPackage", clientPackage);
}
supportingFiles.add(new SupportingFile("Configuration.mustache", supportingFiles.add(new SupportingFile("Configuration.mustache",
(sourceFolder + File.separator + clientPackage).replace(".", java.io.File.separator), "Configuration.cs")); (sourceFolder + File.separator + clientPackage).replace(".", java.io.File.separator), "Configuration.cs"));
supportingFiles.add(new SupportingFile("ApiClient.mustache", supportingFiles.add(new SupportingFile("ApiClient.mustache",
@ -110,12 +114,15 @@ public class Unity3DCsharpDotNet2ClientCodegen extends DefaultCodegen implements
supportingFiles.add(new SupportingFile("ApiException.mustache", supportingFiles.add(new SupportingFile("ApiException.mustache",
(sourceFolder + File.separator + clientPackage).replace(".", java.io.File.separator), "ApiException.cs")); (sourceFolder + File.separator + clientPackage).replace(".", java.io.File.separator), "ApiException.cs"));
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config")); supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config"));
supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat"));
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh")); supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
supportingFiles.add(new SupportingFile("README.md", "", "README.md")); supportingFiles.add(new SupportingFile("README.md", "", "README.md"));
} }
public void setClientPackage(String clientPackage) {
this.clientPackage = clientPackage;
}
public CodegenType getTag() { public CodegenType getTag() {
return CodegenType.CLIENT; return CodegenType.CLIENT;
} }

View File

@ -145,7 +145,7 @@ namespace {{packageName}}.Client
if (obj is DateTime) if (obj is DateTime)
return ((DateTime)obj).ToString ("u"); return ((DateTime)obj).ToString ("u");
else if (obj is List<string>) else if (obj is List<string>)
return String.Join(",", obj as List<string>); return String.Join(",", (obj as List<string>).ToArray());
else else
return Convert.ToString (obj); return Convert.ToString (obj);
} }

View File

@ -2,7 +2,7 @@ wget -nc https://nuget.org/nuget.exe;
mozroots --import --sync mozroots --import --sync
mono nuget.exe install vendor/packages.config -o vendor; mono nuget.exe install vendor/packages.config -o vendor;
mkdir -p bin; mkdir -p bin;
mcs -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\
vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\
System.Runtime.Serialization.dll \ System.Runtime.Serialization.dll \
-target:library \ -target:library \