* Makefile.am:
[monodevelop.git] / extras / PythonBinding / Project / PythonCompilerParameters.cs
blobd7033c9d3f2bc11ad74b340012db5344a8d957ad
1 using System;
2 using System.ComponentModel;
3 using System.IO;
4 using System.Text;
5 using System.Xml;
7 using MonoDevelop.Core.Gui.Components;
8 using MonoDevelop.Projects;
10 namespace PythonBinding
12 /// <summary>
13 /// This class handles project specific compiler parameters
14 /// </summary>
15 public class PythonCompilerParameters : ProjectConfiguration
17 CompilerOptions compilerOptions = new CompilerOptions ();
19 public CompilerOptions CurrentCompilerOptions {
20 get {
21 return compilerOptions;
25 public string OutputPath {
26 get {
27 return OutputDirectory;
29 set {
30 OutputDirectory = value;
34 public string AssemblyName {
35 get {
36 return OutputAssembly;
38 set {
39 OutputAssembly = value;
43 [DefaultValue(CompilationTarget.Exe)]
44 public CompilationTarget CompilationTarget {
45 get {
46 return compilerOptions.compilationTarget;
48 set {
49 compilerOptions.compilationTarget = value;
53 [DefaultValue(false)]
54 public bool IncludeDebugInformation {
55 get {
56 return compilerOptions.includeDebugInformation;
58 set {
59 compilerOptions.includeDebugInformation = value;
63 public PythonCompilerParameters ()
67 public PythonCompilerParameters (string name)
69 this.name = name;
72 [XmlNodeName("CompilerOptions")]
73 public class CompilerOptions
75 [XmlAttribute("compilationTarget")]
76 public CompilationTarget compilationTarget = CompilationTarget.Exe;
78 [XmlAttribute("includeDebugInformation")]
79 internal bool includeDebugInformation = false;
81 public string GenerateOptions ()
83 StringBuilder options = new StringBuilder ();
84 switch (compilationTarget) {
85 case PythonBinding.CompilationTarget.Dll:
86 options.Append ("/dll ");
87 break;
88 case PythonBinding.CompilationTarget.Exe:
89 options.Append ("/exe ");
90 break;
91 default:
92 throw new System.NotSupportedException ("Unsupported compilation target : " + compilationTarget);
95 if (includeDebugInformation) {
96 options.Append ("/DEBUG ");
99 return options.ToString ();