~bratsche/ubuntu/maverick/monodevelop/disable-appmenu

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Projects/MonoDevelop.Projects/DotNetProject.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-03-29 23:36:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080329233633-wq5p1rktg8ek3vxc
Tags: 1.0+dfsg-1ubuntu1
* Merge from Debian unstable. (LP: #209012) Remaining Ubuntu changes:
+ debian/control: 
  - Build-dep on xulrunner-1.9-dev instead of firefox-dev
  - Depend on xulrunner-1.9 instead of firefox
+ don't do any MOZILLA_HOME/MOZILLA_FIVE_HOME business which isn't needed
  for xulrunner-1.9 using the standalone glue anymore (gecko gil uses
  standalone by default)
  - add debian/patches/use_xulrunner_1.9.dpatch
  - update debian/patches/00list
* Remove build-dep on libxul-dev and the dep on libxul0d
  since we are using xulrunner1.9 instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        {
43
43
                [ItemProperty]
44
44
                string language;
45
 
                ClrVersion clrVersion = ClrVersion.Net_1_1;
 
45
                ClrVersion clrVersion = ClrVersion.Default;
46
46
                bool usePartialTypes = true;
47
47
                
48
48
                IDotNetLanguageBinding languageBinding;
72
72
                [ItemProperty ("clr-version")]
73
73
                public ClrVersion ClrVersion {
74
74
                        get {
75
 
                                return (clrVersion == ClrVersion.Default) ? ClrVersion.Net_1_1 : clrVersion;
 
75
                                if (clrVersion == ClrVersion.Default)
 
76
                                        ClrVersion = ClrVersion.Default;
 
77
                                return clrVersion;
76
78
                        }
77
79
                        set {
78
 
                                if (clrVersion == value)
 
80
                                ClrVersion validValue = GetValidClrVersion (value);
 
81
                                if (clrVersion == validValue || validValue == ClrVersion.Default)
79
82
                                        return;
80
 
                                clrVersion = value;
 
83
                                clrVersion = validValue;
81
84
                                
82
85
                                // Propagate the clr version to configurations. We don't support
83
86
                                // per-project clr versions right now, but we might support it
89
92
                        }
90
93
                }
91
94
                
 
95
                //if possible, find a ClrVersion that the language binding can handle
 
96
                ClrVersion GetValidClrVersion (ClrVersion suggestion)
 
97
                {
 
98
                        if (suggestion == ClrVersion.Default) {
 
99
                                if (languageBinding == null)
 
100
                                        return ClrVersion.Default;
 
101
                                else
 
102
                                        suggestion = ClrVersion.Net_2_0;
 
103
                        }
 
104
                        
 
105
                        if (languageBinding != null) {
 
106
                                ClrVersion[] versions = languageBinding.GetSupportedClrVersions ();
 
107
                                if (versions != null && versions.Length > 0) {
 
108
                                        foreach (ClrVersion v in versions) {
 
109
                                                if (v == suggestion) {
 
110
                                                        return suggestion;
 
111
                                                }
 
112
                                        }
 
113
                                        
 
114
                                        return versions[0];
 
115
                                }
 
116
                        }
 
117
                        
 
118
                        return suggestion;
 
119
                }
 
120
                
92
121
                [ItemProperty (DefaultValue=true)]
93
122
                public bool UsePartialTypes {
94
123
                        get { return usePartialTypes; }
120
149
                        languageBinding = FindLanguage (language);
121
150
                        
122
151
                        if (languageBinding != null) {
 
152
                                if (projectOptions != null)
 
153
                                        projectOptions.SetAttribute ("DefineDebug", "True");
123
154
                                DotNetProjectConfiguration configuration = (DotNetProjectConfiguration) CreateConfiguration ("Debug");
124
155
                                configuration.CompilationParameters = languageBinding.CreateCompilationParameters (projectOptions);
125
156
                                Configurations.Add (configuration);
126
157
                                
127
158
                                configuration = (DotNetProjectConfiguration) CreateConfiguration ("Release");
128
159
                                configuration.DebugMode = false;
 
160
                                if (projectOptions != null)
 
161
                                        projectOptions.SetAttribute ("DefineDebug", "False");
129
162
                                configuration.CompilationParameters = languageBinding.CreateCompilationParameters (projectOptions);
130
163
                                Configurations.Add (configuration);
131
164
                        }
158
191
                        }
159
192
                }
160
193
                
 
194
                protected override DataCollection Serialize (ITypeSerializer handler)
 
195
                {
 
196
                        //make sure clr version is sorted out before saving
 
197
                        ClrVersion v = this.ClrVersion;
 
198
                        
 
199
                        return base.Serialize (handler);
 
200
                }
 
201
                
161
202
                protected override void Deserialize (ITypeSerializer handler, DataCollection data)
162
203
                {
163
204
                        base.Deserialize (handler, data);
344
385
                {
345
386
                        resourceId = finfo.ResourceId;
346
387
                        if (resourceId == null) {
347
 
                                Console.WriteLine (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
 
388
                                LoggingService.LogDebug (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
348
389
                                monitor.Log.WriteLine (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
349
390
 
350
391
                                return new CompilerError (fname, 0, 0, String.Empty,
363
404
                        }
364
405
 
365
406
                        using (StringWriter sw = new StringWriter ()) {
366
 
                                Console.WriteLine ("Compiling resources\n{0}$ {1} /compile {2}", Path.GetDirectoryName (fname), resgen, fname);
 
407
                                LoggingService.LogDebug ("Compiling resources\n{0}$ {1} /compile {2}", Path.GetDirectoryName (fname), resgen, fname);
367
408
                                monitor.Log.WriteLine (GettextCatalog.GetString (
368
409
                                        "Compiling resource {0} with {1}", fname, resgen));
369
410
                                ProcessWrapper pw = null;
377
418
 
378
419
                                        pw = Runtime.ProcessService.StartProcess (info, sw, sw, null);
379
420
                                } catch (System.ComponentModel.Win32Exception ex) {
380
 
                                        Console.WriteLine (GettextCatalog.GetString (
 
421
                                        LoggingService.LogDebug (GettextCatalog.GetString (
381
422
                                                "Error while trying to invoke '{0}' to compile resource '{1}' :\n {2}", resgen, fname, ex.ToString ()));
382
423
                                        monitor.Log.WriteLine (GettextCatalog.GetString (
383
424
                                                "Error while trying to invoke '{0}' to compile resource '{1}' :\n {2}", resgen, fname, ex.Message));
392
433
                                        fname = Path.ChangeExtension (fname, ".resources");
393
434
                                } else {
394
435
                                        string output = sw.ToString ();
395
 
                                        Console.WriteLine (GettextCatalog.GetString (
 
436
                                        LoggingService.LogDebug (GettextCatalog.GetString (
396
437
                                                "Unable to compile ({0}) {1} to .resources. \nReason: \n{2}\n",
397
438
                                                resgen, fname, output));
398
439
                                        monitor.Log.WriteLine (GettextCatalog.GetString (
439
480
                                        //generate assembly
440
481
                                        string args = String.Format ("/t:lib {0} \"/out:{1}\" /culture:{2}", pair.Value, outputFile, culture);
441
482
 
442
 
                                        Console.WriteLine ("Generating satellite assembly for '{0}' culture.\n{1}$ {2} {3}", culture, satDir, al, args);
 
483
                                        LoggingService.LogDebug ("Generating satellite assembly for '{0}' culture.\n{1}$ {2} {3}", culture, satDir, al, args);
443
484
                                        monitor.Log.WriteLine (GettextCatalog.GetString (
444
485
                                                "Generating satellite assembly for '{0}' culture with {1}", culture, al));
445
486
                                        ProcessWrapper pw = null;
450
491
 
451
492
                                                pw = Runtime.ProcessService.StartProcess (info, sw, sw, null);
452
493
                                        } catch (System.ComponentModel.Win32Exception ex) {
453
 
                                                Console.WriteLine (GettextCatalog.GetString (
 
494
                                                LoggingService.LogDebug (GettextCatalog.GetString (
454
495
                                                        "Error while trying to invoke '{0}' to generate satellite assembly for '{1}' culture:\n {2}", al, culture, ex.ToString ()));
455
496
                                                monitor.Log.WriteLine (GettextCatalog.GetString (
456
497
                                                        "Error while trying to invoke '{0}' to generate satellite assembly for '{1}' culture:\n {2}", al, culture, ex.Message));
463
504
 
464
505
                                        if (pw.ExitCode != 0) {
465
506
                                                string output = sw.ToString ();
466
 
                                                Console.WriteLine (GettextCatalog.GetString (
 
507
                                                LoggingService.LogDebug (GettextCatalog.GetString (
467
508
                                                        "Unable to generate satellite assemblies for '{0}' culture with {1}.\nReason: \n{2}\n",
468
509
                                                        culture, al, output));
469
510
                                                monitor.Log.WriteLine (GettextCatalog.GetString (
580
621
                
581
622
                public virtual string GetDefaultNamespace (string fileName)
582
623
                {
 
624
                        if (!string.IsNullOrEmpty (DefaultNamespace))
 
625
                                return DefaultNamespace;
 
626
                        
583
627
                        StringBuilder sb = new StringBuilder ();
584
628
                        foreach (char c in Name) {
585
629
                                if (char.IsLetterOrDigit (c) || c == '_' || c == '.')