コード例 #1
0
ファイル: ProjectUtils.cs プロジェクト: wblong/UE4
        /// <summary>
        /// Optionally compiles and loads target rules assembly.
        /// </summary>
        /// <param name="Properties"></param>
        /// <param name="TargetsDllFilename"></param>
        /// <param name="DoNotCompile"></param>
        /// <param name="TargetScripts"></param>
        private static void CompileAndLoadTargetsAssembly(ProjectProperties Properties, FileReference TargetsDllFilename, bool DoNotCompile, List <FileReference> TargetScripts)
        {
            CommandUtils.LogVerbose("Compiling targets DLL: {0}", TargetsDllFilename);

            List <string> ReferencedAssemblies = new List <string>()
            {
                "System.dll",
                "System.Core.dll",
                "System.Xml.dll",
                typeof(UnrealBuildTool.PlatformExports).Assembly.Location
            };
            List <string> PreprocessorDefinitions = RulesAssembly.GetPreprocessorDefinitions();
            Assembly      TargetsDLL = DynamicCompilation.CompileAndLoadAssembly(TargetsDllFilename, new HashSet <FileReference>(TargetScripts), ReferencedAssemblies, PreprocessorDefinitions, DoNotCompile);

            Type[] AllCompiledTypes = TargetsDLL.GetTypes();
            foreach (Type TargetType in AllCompiledTypes)
            {
                // Find TargetRules but skip all "UE4Editor", "UE4Game" targets.
                if (typeof(TargetRules).IsAssignableFrom(TargetType) && !TargetType.IsAbstract)
                {
                    string TargetName = GetTargetName(TargetType);

                    TargetInfo DummyTargetInfo = new TargetInfo(TargetName, BuildHostPlatform.Current.Platform, UnrealTargetConfiguration.Development, "", Properties.RawProjectPath, null);

                    // Create an instance of this type
                    CommandUtils.LogVerbose("Creating target rules object: {0}", TargetType.Name);
                    TargetRules Rules = Activator.CreateInstance(TargetType, DummyTargetInfo) as TargetRules;
                    CommandUtils.LogVerbose("Adding target: {0} ({1})", TargetType.Name, Rules.Type);

                    SingleTargetProperties TargetData = new SingleTargetProperties();
                    TargetData.TargetName = GetTargetName(TargetType);
                    TargetData.Rules      = Rules;
                    if (Rules.Type == global::UnrealBuildTool.TargetType.Program)
                    {
                        Properties.Programs.Add(TargetData);
                    }
                    else
                    {
                        Properties.Targets.Add(TargetData);
                    }
                }
            }
        }
コード例 #2
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
 public static string StaticGetFullName(UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
 {
     return "InternalTools_" + InProgramTarget.TargetName + StaticGetHostPlatformSuffix(InHostPlatform);
 }
コード例 #3
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
		private void SetupSingleInternalToolsNode(SingleTargetProperties InProgramTarget, bool bSkipRootEditorPsuedoDependency = true)
		{
			ProgramTarget = InProgramTarget;
			AgentSharingGroup = "ToolsGroup" + StaticGetHostPlatformSuffix(HostPlatform);
			
			if (!bSkipRootEditorPsuedoDependency) 
			{
				AddPseudodependency(RootEditorNode.StaticGetFullName(HostPlatform));
			}
		}
コード例 #4
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
		public SingleInternalToolsNode(GUBP bp, GUBPBranchConfig InBranchConfig, UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
			: base(InBranchConfig, InHostPlatform)
        {
			// Don't add rooteditor dependency if it isn't in the graph
			var bRootEditorNodeDoesExit = BranchConfig.HasNode(RootEditorNode.StaticGetFullName(HostPlatform));
			SetupSingleInternalToolsNode(InProgramTarget, !bRootEditorNodeDoesExit && BranchConfig.BranchOptions.bNoEditorDependenciesForTools);
        }
コード例 #5
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
        public SingleInternalToolsNode(GUBP.GUBPBranchConfig InBranchConfig, UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
            : base(InBranchConfig, InHostPlatform)
        {
			SetupSingleInternalToolsNode(InProgramTarget);
        }
コード例 #6
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
 public SingleToolsNode(GUBP.GUBPBranchConfig InBranchConfig, UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
     : base(InBranchConfig, InHostPlatform)
 {
     ProgramTarget = InProgramTarget;
     AddPseudodependency(RootEditorNode.StaticGetFullName(HostPlatform));
     AgentSharingGroup = "ToolsGroup" + StaticGetHostPlatformSuffix(HostPlatform);
 }
コード例 #7
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
		public static string StaticGetFullName(UnrealTargetPlatform InHostPlatform, SingleTargetProperties InGameProj)
		{
			return InGameProj.TargetName + "_NonUnityTestCompile" + StaticGetHostPlatformSuffix(InHostPlatform);
		}
コード例 #8
0
ファイル: LegacyNodes.cs プロジェクト: frobro98/UnrealSource
		public NonUnityToolNode(UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
			: base(InHostPlatform)
		{
			ProgramTarget = InProgramTarget;
			AddPseudodependency(SingleInternalToolsNode.StaticGetFullName(HostPlatform, ProgramTarget));
			AddPseudodependency(RootEditorNode.StaticGetFullName(HostPlatform));
		}
コード例 #9
0
ファイル: GUBP.Automation.cs プロジェクト: mymei/UE4
 public SingleInternalToolsNode(GUBP bp, UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
     : base(InHostPlatform)
 {
     // Don't add rooteditor dependency if it isn't in the graph
     var bRootEditorNodeDoesExit = bp.HasNode(RootEditorNode.StaticGetFullName(HostPlatform));
     SetupSingleInternalToolsNode(InProgramTarget, !bRootEditorNodeDoesExit);
 }
コード例 #10
0
ファイル: GUBP.Automation.cs プロジェクト: mymei/UE4
 public SingleInternalToolsNode(UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
     : base(InHostPlatform)
 {
     SetupSingleInternalToolsNode(InProgramTarget);
 }
コード例 #11
0
ファイル: GUBP.Automation.cs プロジェクト: xiangyuan/Unreal4
 public SingleInternalToolsNode(UnrealTargetPlatform InHostPlatform, SingleTargetProperties InProgramTarget)
     : base(InHostPlatform)
 {
     ProgramTarget = InProgramTarget;
     if (!GUBP.bBuildRocket) // more errors and more performance by just starting before the root editor is done
     {
         AddPseudodependency(RootEditorNode.StaticGetFullName(HostPlatform));
     }
     AgentSharingGroup = "ToolsGroup" + StaticGetHostPlatformSuffix(HostPlatform);
 }