/// <summary> /// Builds the binary. /// </summary> /// <param name="Target">The target rules</param> /// <param name="ToolChain">The toolchain to use for building</param> /// <param name="CompileEnvironment">The environment to compile the binary in</param> /// <param name="LinkEnvironment">The environment to link the binary in</param> /// <param name="SharedPCHs">List of available shared PCHs</param> /// <param name="ActionGraph">The graph to add build actions to</param> /// <returns>Set of produced build artifacts</returns> public override IEnumerable <FileItem> Build(ReadOnlyTargetRules Target, UEToolChain ToolChain, CppCompileEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment, List <PrecompiledHeaderTemplate> SharedPCHs, ActionGraph ActionGraph) { CSharpEnvironment ProjectCSharpEnviroment = new CSharpEnvironment(); if (LinkEnvironment.Configuration == CppConfiguration.Debug) { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Debug; } else { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Development; } ProjectCSharpEnviroment.EnvironmentTargetPlatform = LinkEnvironment.Platform; ToolChain.CompileCSharpProject(ProjectCSharpEnviroment, Config.ProjectFilePath, Config.OutputFilePath, ActionGraph); return(new FileItem[] { FileItem.GetItemByFileReference(Config.OutputFilePath) }); }
/// <summary> /// Builds the binary. /// </summary> /// <param name="ToolChain">The toolchain to use for building</param> /// <param name="CompileEnvironment">The environment to compile the binary in</param> /// <param name="LinkEnvironment">The environment to link the binary in</param> /// <returns></returns> public override IEnumerable <FileItem> Build(UEBuildTarget Target, UEToolChain ToolChain, CPPEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment) { CSharpEnvironment ProjectCSharpEnviroment = new CSharpEnvironment(); if (LinkEnvironment.Config.Target.Configuration == CPPTargetConfiguration.Debug) { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Debug; } else { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Development; } ProjectCSharpEnviroment.EnvironmentTargetPlatform = LinkEnvironment.Config.Target.Platform; ToolChain.CompileCSharpProject(ProjectCSharpEnviroment, Config.ProjectFilePath, Config.OutputFilePath); return(new FileItem[] { FileItem.GetItemByFileReference(Config.OutputFilePath) }); }
/// <summary> /// Builds the binary. /// </summary> /// <param name="ToolChain">The toolchain to use for building</param> /// <param name="CompileEnvironment">The environment to compile the binary in</param> /// <param name="LinkEnvironment">The environment to link the binary in</param> /// <returns></returns> public override IEnumerable <FileItem> Build(IUEToolChain ToolChain, CPPEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment) { var ProjectCSharpEnviroment = new CSharpEnvironment(); if (LinkEnvironment.Config.Target.Configuration == CPPTargetConfiguration.Debug) { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Debug; } else { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Development; } ProjectCSharpEnviroment.EnvironmentTargetPlatform = LinkEnvironment.Config.Target.Platform; // Currently only supported by windows... UEToolChain.GetPlatformToolChain(CPPTargetPlatform.Win64).CompileCSharpProject( ProjectCSharpEnviroment, Config.ProjectFilePath, Config.OutputFilePath); return(new FileItem[] { FileItem.GetItemByPath(Config.OutputFilePath) }); }
public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, string ProjectFileName, string DestinationFile) { throw new BuildException("Android cannot compile C# files"); }
// @todo Mac: Full implementation. public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, string ProjectFileName, string DestinationFile) { string ProjectDirectory = Path.GetDirectoryName(Path.GetFullPath(ProjectFileName)); if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac) { RPCUtilHelper.CopyFile(ProjectFileName, ConvertPath(ProjectFileName), true); RPCUtilHelper.CopyFile("Engine/Source/Programs/DotNETCommon/MetaData.cs", ConvertPath("Engine/Source/Programs/DotNETCommon/MetaData.cs"), true); string[] FileList = Directory.GetFiles(ProjectDirectory, "*.cs", SearchOption.AllDirectories); foreach (string File in FileList) { RPCUtilHelper.CopyFile(File, ConvertPath(File), true); } } string XBuildArgs = "/verbosity:quiet /nologo /target:Rebuild /property:Configuration=Development /property:Platform=AnyCPU " + Path.GetFileName(ProjectFileName); if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac) { RPCUtilHelper.Command(ConvertPath(ProjectDirectory), "xbuild", XBuildArgs, null); } else { Process XBuildProcess = new Process(); XBuildProcess.StartInfo.WorkingDirectory = ProjectDirectory; XBuildProcess.StartInfo.FileName = "sh"; XBuildProcess.StartInfo.Arguments = "-c 'xbuild " + XBuildArgs + " |grep -i error; if [ $? -ne 1 ]; then exit 1; else exit 0; fi'"; XBuildProcess.OutputDataReceived += new DataReceivedEventHandler(OutputReceivedDataEventHandler); XBuildProcess.ErrorDataReceived += new DataReceivedEventHandler(OutputReceivedDataEventHandler); Utils.RunLocalProcess(XBuildProcess); } }
public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, FileReference ProjectFileName, FileReference DestinationFile) { throw new BuildException("HTML5 cannot compile C# files"); }
public virtual void CompileCSharpProject(CSharpEnvironment CompileEnvironment, FileReference ProjectFileName, FileReference DestinationFile) { }
public virtual void CompileCSharpProject(CSharpEnvironment CompileEnvironment, FileReference ProjectFileName, FileReference DestinationFile, ActionGraph ActionGraph) { }
public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, FileReference ProjectFileName, FileReference DestinationFile) { throw new BuildException("Android cannot compile C# files"); }
public virtual void CompileCSharpProject(CSharpEnvironment CompileEnvironment, string ProjectFileName, string DestinationFile) { }
/// <summary> /// Builds the binary. /// </summary> /// <param name="ToolChain">The toolchain to use for building</param> /// <param name="CompileEnvironment">The environment to compile the binary in</param> /// <param name="LinkEnvironment">The environment to link the binary in</param> /// <returns></returns> public override IEnumerable<FileItem> Build(IUEToolChain ToolChain, CPPEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment) { var ProjectCSharpEnviroment = new CSharpEnvironment(); if (LinkEnvironment.Config.Target.Configuration == CPPTargetConfiguration.Debug) { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Debug; } else { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Development; } ProjectCSharpEnviroment.EnvironmentTargetPlatform = LinkEnvironment.Config.Target.Platform; // Currently only supported by windows... UEToolChain.GetPlatformToolChain(CPPTargetPlatform.Win64).CompileCSharpProject( ProjectCSharpEnviroment, Config.ProjectFilePath, Config.OutputFilePath); return new FileItem[] { FileItem.GetItemByPath(Config.OutputFilePath) }; }
public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, string ProjectFileName, string DestinationFile) { // Initialize environment variables required for spawned tools. var EnvVars = VCEnvironment.SetEnvironment(CompileEnvironment.EnvironmentTargetPlatform); var BuildProjectAction = new Action(ActionType.BuildProject); // Specify the source file (prerequisite) for the action var ProjectFileItem = FileItem.GetExistingItemByPath(ProjectFileName); if (ProjectFileItem == null) { throw new BuildException("Expected C# project file {0} to exist.", ProjectFileName); } // Add the project and the files contained to the prerequisites. BuildProjectAction.PrerequisiteItems.Add(ProjectFileItem); var ProjectFile = new VCSharpProjectFile( Utils.MakePathRelativeTo( ProjectFileName, ProjectFileGenerator.MasterProjectRelativePath ) ); var ProjectPreReqs = ProjectFile.GetCSharpDependencies(); var ProjectFolder = Path.GetDirectoryName(ProjectFileName); foreach( string ProjectPreReqRelativePath in ProjectPreReqs ) { string ProjectPreReqAbsolutePath = Path.Combine( ProjectFolder, ProjectPreReqRelativePath ); var ProjectPreReqFileItem = FileItem.GetExistingItemByPath(ProjectPreReqAbsolutePath); if( ProjectPreReqFileItem == null ) { throw new BuildException("Expected C# dependency {0} to exist.", ProjectPreReqAbsolutePath); } BuildProjectAction.PrerequisiteItems.Add(ProjectPreReqFileItem); } // We might be able to distribute this safely, but it doesn't take any time. BuildProjectAction.bCanExecuteRemotely = false; // Setup execution via MSBuild. BuildProjectAction.WorkingDirectory = Path.GetFullPath("."); BuildProjectAction.StatusDescription = Path.GetFileName(ProjectFileName); BuildProjectAction.CommandPath = EnvVars.MSBuildPath; if (CompileEnvironment.TargetConfiguration == CSharpTargetConfiguration.Debug) { BuildProjectAction.CommandArguments = " /target:rebuild /property:Configuration=Debug"; } else { BuildProjectAction.CommandArguments = " /target:rebuild /property:Configuration=Development"; } // Be less verbose BuildProjectAction.CommandArguments += " /nologo /verbosity:minimal"; // Add project BuildProjectAction.CommandArguments += String.Format(" \"{0}\"", ProjectFileItem.AbsolutePath); // Specify the output files. string PDBFilePath = Path.Combine( Path.GetDirectoryName(DestinationFile), Path.GetFileNameWithoutExtension(DestinationFile) + ".pdb" ); FileItem PDBFile = FileItem.GetItemByPath( PDBFilePath ); BuildProjectAction.ProducedItems.Add( FileItem.GetItemByPath(DestinationFile) ); BuildProjectAction.ProducedItems.Add( PDBFile ); }
public override void CompileCSharpProject(CSharpEnvironment CompileEnvironment, string ProjectFileName, string DestinationFile) { throw new BuildException("Linux cannot compile C# files"); }
/// <summary> /// Builds the binary. /// </summary> /// <param name="ToolChain">The toolchain to use for building</param> /// <param name="CompileEnvironment">The environment to compile the binary in</param> /// <param name="LinkEnvironment">The environment to link the binary in</param> /// <returns></returns> public override IEnumerable<FileItem> Build(UEBuildTarget Target, UEToolChain ToolChain, CPPEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment) { CSharpEnvironment ProjectCSharpEnviroment = new CSharpEnvironment(); if (LinkEnvironment.Config.Target.Configuration == CPPTargetConfiguration.Debug) { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Debug; } else { ProjectCSharpEnviroment.TargetConfiguration = CSharpTargetConfiguration.Development; } ProjectCSharpEnviroment.EnvironmentTargetPlatform = LinkEnvironment.Config.Target.Platform; ToolChain.CompileCSharpProject(ProjectCSharpEnviroment, Config.ProjectFilePath, Config.OutputFilePath); return new FileItem[] { FileItem.GetItemByFileReference(Config.OutputFilePath) }; }