~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Moonlight/MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
                
42
42
                protected override void Initialize (TargetRuntime runtime, TargetFramework framework)
43
43
                {
 
44
                        if (framework.Id.Identifier != "Silverlight")
 
45
                                throw new InvalidOperationException (string.Format ("Cannot handle unknown framework {0}", framework.Id));
 
46
                        
44
47
                        base.Initialize (runtime, framework);
45
 
                        fxVersion = GetFxVersion (framework);
 
48
                        fxVersion = framework.Id.Version;
46
49
                        
47
50
                        foreach (var dir in GetMoonDirectories ()) {
48
51
                                var fxdir = dir.Combine (fxVersion);
55
58
                        }
56
59
                }
57
60
                
58
 
                internal static string GetFxVersion (TargetFramework fx)
59
 
                {
60
 
                        switch (fx.Id) {
61
 
                        case "SL2.0":
62
 
                                return "2.0";
63
 
                        case "SL3.0":
64
 
                                return "3.0";
65
 
                        default:
66
 
                                throw new InvalidOperationException ("Cannot handle unknown target framework '" + fx.Id +"'");
67
 
                        }
68
 
                }
69
 
                
70
61
                bool LoadVersionString (FilePath buildVersion)
71
62
                {
72
63
                        try {
112
103
                        string path;
113
104
                        if (targetRuntime.EnvironmentVariables.TryGetValue ("MOONLIGHT_SDK_PATH", out path))
114
105
                                yield return (FilePath) path;
115
 
                        yield return ((FilePath)base.targetRuntime.Prefix).Combine ("lib", "moonlight");
 
106
                        yield return ((FilePath)targetRuntime.Prefix).Combine ("lib", "moonlight");
116
107
                        var env = System.Environment.GetEnvironmentVariable ("MOONLIGHT_SDK_PATH");
117
108
                        if (!string.IsNullOrEmpty (env))
118
109
                                yield return (FilePath) env;
124
115
                
125
116
                public override IEnumerable<string> GetToolsPaths ()
126
117
                {
127
 
                        foreach (var f in GetFrameworkFolders ())
128
 
                                yield return f;
129
 
                        foreach (var f in base.GetToolsPaths ())
130
 
                                yield return f;
 
118
                        yield return location;
 
119
                        yield return location.Combine (fxVersion);
 
120
                        foreach (var f in BaseGetToolsPaths ())
 
121
                                yield return f;
 
122
                }
 
123
                
 
124
                //WORKAROUND for gmcs code generation bug - base not properly accessible from generators.
 
125
                //Should be fixed in Mono 2.8 final. 
 
126
                IEnumerable<string> BaseGetToolsPaths ()
 
127
                {
 
128
                        return base.GetToolsPaths ();
131
129
                }
132
130
                
133
131
                Dictionary<string, string> envVars;