当前位置: 首页>>代码示例>>C#>>正文


C# ConfigurationSelector.GetConfiguration方法代码示例

本文整理汇总了C#中MonoDevelop.Projects.ConfigurationSelector.GetConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationSelector.GetConfiguration方法的具体用法?C# ConfigurationSelector.GetConfiguration怎么用?C# ConfigurationSelector.GetConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoDevelop.Projects.ConfigurationSelector的用法示例。


在下文中一共展示了ConfigurationSelector.GetConfiguration方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildCommonArgAppendix

        public static void BuildCommonArgAppendix(StringBuilder sr,DubProject prj, ConfigurationSelector sel)
        {
            sr.Append (" \"").Append(prj.packageName).Append("\"");

            if(!string.IsNullOrWhiteSpace(DubSettings.Instance.CommonArgs))
                sr.Append(' ').Append (DubSettings.Instance.CommonArgs);

            if (prj.Configurations.Count > 1 && sel.GetConfiguration(prj).Name.ToLower() != "default")
                sr.Append(" \"--config=").Append(sel.GetConfiguration(prj).Name).Append("\"");
        }
开发者ID:Geod24,项目名称:Mono-D,代码行数:10,代码来源:DubBuilder.cs

示例2: BuildCommonArgAppendix

        public static void BuildCommonArgAppendix(StringBuilder sr,DubProject prj, ConfigurationSelector sel)
        {
            sr.Append (" \"").Append(prj.packageName).Append("\"");

            if(!string.IsNullOrWhiteSpace(DubSettings.Instance.CommonArgs))
                sr.Append(' ').Append (DubSettings.Instance.CommonArgs);

            var buildType = Ide.IdeApp.Workspace.ActiveExecutionTarget.Id;
            if (!string.IsNullOrWhiteSpace(buildType))
                sr.Append(" \"--build=").Append(buildType).Append("\"");

            if (prj.Configurations.Count > 1 && sel.GetConfiguration(prj).Name.ToLower() != "default")
                sr.Append(" \"--config=").Append(sel.GetConfiguration(prj).Name).Append("\"");
        }
开发者ID:foerdi,项目名称:Mono-D,代码行数:14,代码来源:DubBuilder.cs

示例3: PopulateSupportFileList

		protected override void PopulateSupportFileList (MonoDevelop.Projects.FileCopySet list, ConfigurationSelector solutionConfiguration)
		{
			base.PopulateSupportFileList (list, solutionConfiguration);

			//HACK: workaround for MD not local-copying package references
			foreach (var projectReference in References) {
				if (projectReference.Package != null && projectReference.Package.Name == "monogame") {
					if (projectReference.ReferenceType == ReferenceType.Gac) {
						foreach (var assem in projectReference.Package.Assemblies) {
							list.Add (assem.Location);
							var cfg = (MonoGameProjectConfiguration)solutionConfiguration.GetConfiguration (this);
							if (cfg.DebugMode) {
								var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (assem.Location);
								if (System.IO.File.Exists (mdbFile))
									list.Add (mdbFile);
							}
						}
					}
					break;
				}
			}
		}
开发者ID:jschieck,项目名称:MonoGame-2.5.1.0-0,代码行数:22,代码来源:MonoGameProject.cs

示例4: Build

		protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem item, ConfigurationSelector configuration)
		{
			var proj = item as MonoMacProject;
			if (proj == null || proj.CompileTarget != CompileTarget.Exe)
				return base.Build (monitor, item, configuration);
			
			var conf = (MonoMacProjectConfiguration) configuration.GetConfiguration (item);
			var resDir = conf.AppDirectory.Combine ("Contents", "Resources");
			var appDir = conf.AppDirectory;
			
			var res = base.Build (monitor, item, configuration);
			if (res.ErrorCount > 0)
				return res;
			
			//copy exe, mdb, refs, copy-to-output, Content files to Resources
			var filesToCopy = GetCopyFiles (proj, configuration, conf).Where (NeedsBuilding).ToList ();
			if (filesToCopy.Count > 0) {
				monitor.BeginTask ("Copying resource files to app bundle", filesToCopy.Count);
				foreach (var f in filesToCopy) {
					f.EnsureOutputDirectory ();
					File.Copy (f.Input, f.Output, true);
					monitor.Log.WriteLine ("Copied {0}", f.Output.ToRelative (appDir));
					monitor.Step (1);
				}
				monitor.EndTask ();
			}
			
			//FIXME: only do this check if there are actually xib files
			if (!Platform.IsMac) {
				res.AddWarning ("Cannot compile xib files on non-Mac platforms");
			} else {
				//Interface Builder files
				if (res.Append (CompileXibFiles (monitor, proj.Files, resDir)).ErrorCount > 0)
					return res;
			}
			
			//info.plist
			var plistOut = conf.AppDirectory.Combine ("Contents", "Info.plist");
			var appInfoIn = proj.Files.GetFile (proj.BaseDirectory.Combine ("Info.plist"));
			if (new FilePair (proj.FileName, plistOut).NeedsBuilding () ||
			    	(appInfoIn != null && new FilePair (appInfoIn.FilePath, plistOut).NeedsBuilding ()))
				if (res.Append (MergeInfoPlist (monitor, proj, conf, appInfoIn, plistOut)).ErrorCount > 0)
					return res;
			
			if (Platform.IsWindows) {
				res.AddWarning ("Cannot create app bundle on Windows");
			} else {	
				//launch script
				var macOSDir = appDir.Combine ("Contents", "MacOS");
				CopyExecutableFile (AddinManager.CurrentAddin.GetFilePath ("MonoMacLaunchScript.sh"), conf.LaunchScript);
				CopyExecutableFile (AddinManager.CurrentAddin.GetFilePath ("mono-version-check"),
					macOSDir.Combine ("mono-version-check"));
				
				var si = new UnixSymbolicLinkInfo (appDir.Combine (conf.AppName));
				if (!si.Exists)
					si.CreateSymbolicLinkTo ("/Library/Frameworks/Mono.framework/Versions/Current/bin/mono");
			}
			
			//pkginfo
			var pkgInfo = conf.AppDirectory.Combine ("Contents", "PkgInfo");
			if (!File.Exists (pkgInfo))
				using (var f = File.OpenWrite (pkgInfo))
					f.Write (new byte [] { 0X41, 0X50, 0X50, 0X4C, 0x3f, 0x3f, 0x3f, 0x3f}, 0, 8); // "APPL???"
			
			return res;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:66,代码来源:MonoMacBuildExtension.cs

示例5: Clean

		protected override void Clean (IProgressMonitor monitor, SolutionEntityItem item, ConfigurationSelector configuration)
		{
			base.Clean (monitor, item, configuration);
			
			var proj = item as MonoMacProject;
			if (proj == null || proj.CompileTarget != CompileTarget.Exe)
				return;
			var conf = (MonoMacProjectConfiguration) configuration.GetConfiguration (item);
			
			if (Directory.Exists (conf.AppDirectory))
				Directory.Delete (conf.AppDirectory, true);
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:12,代码来源:MonoMacBuildExtension.cs

示例6: GetNeedsBuilding

		protected override bool GetNeedsBuilding (SolutionEntityItem item, ConfigurationSelector configuration)
		{
			if (base.GetNeedsBuilding (item, configuration))
				return true;
			
			var proj = item as MonoMacProject;
			if (proj == null || proj.CompileTarget != CompileTarget.Exe)
				return false;
			var conf = (MonoMacProjectConfiguration) configuration.GetConfiguration (item);
			
			//all content files
			if (GetCopyFiles (proj, configuration, conf).Where (NeedsBuilding).Any ())
				return true;
			
			if (Platform.IsMac) {
				//Interface Builder files
				var resDir = conf.AppDirectory.Combine ("Contents", "Resources");
				if (GetIBFilePairs (proj.Files, resDir).Any (NeedsBuilding))
					return true;
			}
			
			//the Info.plist
			var plistOut = conf.AppDirectory.Combine ("Contents", "Info.plist");
			var appInfoIn = proj.Files.GetFile (proj.BaseDirectory.Combine ("Info.plist"));
			if (new FilePair (proj.FileName, plistOut).NeedsBuilding () ||
			    	(appInfoIn != null && new FilePair (appInfoIn.FilePath, plistOut).NeedsBuilding ()))
			    return true;
			
			//launch script
			var ls = conf.LaunchScript;
			if (!File.Exists (ls))
				return true;
			
			//pkginfo
			if (!File.Exists (conf.AppDirectory.Combine ("Contents", "PkgInfo")))
			    return true;
			
			return false;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:39,代码来源:MonoMacBuildExtension.cs

示例7: BuildCommonArgAppendix

 public void BuildCommonArgAppendix(StringBuilder sr,DubProject prj, ConfigurationSelector sel)
 {
     if (prj.Configurations.Count > 1)
         sr.Append(" --config=").Append(sel.GetConfiguration(prj).Id);
 }
开发者ID:simendsjo,项目名称:Mono-D,代码行数:5,代码来源:DubBuilder.cs

示例8: CreateExecutionCommand

		public ProcessExecutionCommand CreateExecutionCommand (IWorkspaceObject entry, ConfigurationSelector configuration)
		{
			string exe, args;
			StringTagModel tagSource = GetTagModel (entry, configuration);
			ParseCommand (tagSource, out exe, out args);
			
			ProjectConfiguration config = null;
			
			if (entry is IConfigurationTarget)
				config = configuration.GetConfiguration ((IConfigurationTarget)entry) as ProjectConfiguration;

			//if the executable name matches an executable in the project directory, use that, for back-compat
			//else fall back and let the execution handler handle it via PATH, working directory, etc.
			if (!Path.IsPathRooted (exe)) {
				string localPath = ((FilePath) exe).ToAbsolute (entry.BaseDirectory).FullPath;
				if (File.Exists (localPath))
					exe = localPath;
			}
			
			ProcessExecutionCommand cmd = Runtime.ProcessService.CreateCommand (exe);
			
			cmd.Arguments = args;
			
			FilePath workingDir = this.workingdir;
			if (!workingDir.IsNullOrEmpty)
				workingDir = StringParserService.Parse (workingDir, tagSource);
			cmd.WorkingDirectory = workingDir.IsNullOrEmpty
				? entry.BaseDirectory
				: workingDir.ToAbsolute (entry.BaseDirectory);
			
			if (environmentVariables != null) {
				var vars = new Dictionary<string, string> ();
				foreach (var v in environmentVariables)
					vars [v.Key] = StringParserService.Parse (v.Value, tagSource);
				if (config != null) {
					foreach (var v in config.EnvironmentVariables)
						vars [v.Key] = StringParserService.Parse (v.Value, tagSource);
				}
				cmd.EnvironmentVariables = vars;
			}
			
			return cmd;
		}
开发者ID:neXyon,项目名称:monodevelop,代码行数:43,代码来源:CustomCommand.cs

示例9: PopulateSupportFileList

        protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector solutionConfiguration)
        {
            System.Diagnostics.Debug.WriteLine("MonoGamePlatform=" +this.MonoGamePlatform);
            base.PopulateSupportFileList (list, solutionConfiguration);
            //HACK: workaround for MD not local-copying package references
            foreach (var projectReference in References)
            {
                if (projectReference.Reference.Contains("MonoGame.Framework"))
                {
                    // because of a weird bug in the way monodevelop resolves the assemblies
                    // we do it manually. We combine the monogame-<MonoGamePlatform>
                    // to resolve the internal packages.
                    foreach(var p in this.AssemblyContext.GetPackages(this.TargetFramework))
                    {
                        if (p.Name == string.Format("monogame-{0}", this.MonoGamePlatform.ToLower()))
                        {
                            foreach(var assem in p.Assemblies) {
                                list.Add(assem.Location);
                                var cfg = (MonoGameProjectConfiguration)solutionConfiguration.GetConfiguration(this);
                                if (cfg.DebugMode)
                                {
                                    var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(assem.Location);
                                    if (System.IO.File.Exists(mdbFile))
                                        list.Add(mdbFile);
                                }
                                var assemDir = System.IO.Path.GetDirectoryName (assem.Location);
                                // opentk needs a config file on linux and mac, so we just copy it over anyway
                                if (assem.Location.ToLower().Contains("opentk")) {
                                    if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "OpenTK.dll.config"))) {
                                        list.Add(System.IO.Path.Combine(assemDir, "OpenTK.dll.config"));
                                    }
                                }
                                // we are a Tao.SDL project we need the sdl support libraries as well
                                if (assem.Location.ToLower().Contains("tao.sdl")) {
                                    if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
                                        if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "sdl.dll"))) {
                                            list.Add(System.IO.Path.Combine(assemDir, "sdl.dll"));
                                        }
                                        if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "sdl_mixer.dll"))) {
                                            list.Add(System.IO.Path.Combine(assemDir, "sdl_mixer.dll"));
                                        }
                                    }
                                    if (System.IO.File.Exists(System.IO.Path.Combine(assemDir, "Tao.Sdl.dll.config"))) {
                                        list.Add(System.IO.Path.Combine(assemDir, "Tao.Sdl.dll.config"));
                                    }
                                }

                            }
                        }
                    }
                    break;
                }
            }
        }
开发者ID:dellis1972,项目名称:MonoGameMonoDevelopAddin,代码行数:54,代码来源:MonoGameProject.cs

示例10: PopulateSupportFileList

        protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector configuration)
        {
            base.PopulateSupportFileList (list, configuration);
            foreach(var projectReference in References){
                if (projectReference != null && projectReference.Package.Name == "monogame") {
                    if (projectReference.ReferenceType == ReferenceType.Gac) {
                        foreach (var assem in projectReference.Package.Assemblies) {
                            list.Add (assem.Location);
                            var cfg = (MonoGameProjectConfiguration)configuration.GetConfiguration (this);
                            if (cfg.DebugMode) {
                                var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (assem.Location);
                                if (System.IO.File.Equals(mdbFile)){
                                    list.Add(mdbFile);
                                }
                            }
                        }
                    }
                    break;
                }

            }
        }
开发者ID:nanexcool,项目名称:Monogame_templates,代码行数:22,代码来源:MonoGameProject.cs


注:本文中的MonoDevelop.Projects.ConfigurationSelector.GetConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。