public HotPatcherEditor(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicIncludePaths.AddRange(
            new string[] {
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "UnrealEd",
            "UMG",
            "UMGEditor",
            "Core",
            "Json",
            "ContentBrowser",
            "SandboxFile",
            "JsonUtilities",
            "TargetPlatform",
            "PropertyEditor",
            "DesktopPlatform",
            "Projects",
            "Settings",
            "HTTP",
            "RHI",
            "EngineSettings",
            "AssetRegistry",
            "PakFileUtilities",
            "HotPatcherRuntime",
            "BinariesPatchFeature"
            // ... add other public dependencies that you statically link with here ...
        }
            );

        // only in UE5
        if (Target.Version.MajorVersion > 4)
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                "DeveloperToolSettings"
            });
        }

        if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 23)
        {
            PublicDependencyModuleNames.Add("ToolMenus");
        }

        System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) =>
        {
            PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0));
            return(true);
        };

        AddPublicDefinitions("GENERATE_ASSET_REGISTRY_DATA", false);

        bool bIOStoreSupport = Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 25;

        if (bIOStoreSupport)
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                "IoStoreUtilities"
            });
        }
        AddPublicDefinitions("WITH_IO_STORE_SUPPORT", bIOStoreSupport);

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "UnrealEd",
            "Projects",
            "DesktopPlatform",
            "InputCore",
            "EditorStyle",
            "LevelEditor",
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore",
            "RenderCore"
            // ... add private dependencies that you statically link with here ...
        }
            );

        switch (Target.Configuration)
        {
        case UnrealTargetConfiguration.Debug:
        {
            PublicDefinitions.Add("WITH_HOTPATCHER_DEBUG");
            break;
        }

        case UnrealTargetConfiguration.DebugGame:
        {
            PublicDefinitions.Add("WITH_HOTPATCHER_DEBUGGAME");
            break;
        }

        case UnrealTargetConfiguration.Development:
        {
            PublicDefinitions.Add("WITH_HOTPATCHER_DEVELOPMENT");
            break;
        }
        }
        ;

        PublicDefinitions.AddRange(new string[]
        {
            "ENABLE_COOK_ENGINE_MAP=0",
            "ENABLE_COOK_PLUGIN_MAP=0"
        });

        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );
        if (Target.Version.MajorVersion < 5 && Target.Version.MinorVersion <= 21)
        {
            bUseRTTI = true;
        }


        BuildVersion Version;

        BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version);
        // PackageContext

        AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24);

        System.Console.WriteLine("MajorVersion {0} MinorVersion: {1} PatchVersion {2}", Target.Version.MajorVersion, Target.Version.MinorVersion, Target.Version.PatchVersion);
        bLegacyPublicIncludePaths = false;
        OptimizeCode = CodeOptimization.InShippingBuildsOnly;

        // Game feature
        bool bEnableGameFeature = true;

        if (bEnableGameFeature || (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 26))
        {
            PublicDefinitions.AddRange(new string[]
            {
                "ENGINE_GAME_FEATURE"
            });
            PublicDependencyModuleNames.AddRange(new string[]
            {
                // "GameFeatures",
                // "ModularGameplay",
            });
        }

        PublicDefinitions.AddRange(new string[]
        {
            "ENABLE_UPDATER_CHECK=1",
            "ENABLE_MULTI_COOKER=0",
            "TOOL_NAME=\"HotPatcher\"",
            "CURRENT_VERSION_ID=74",
            "REMOTE_VERSION_FILE=\"https://imzlp.com/opensource/version.json\""
        });

        bool bEnablePackageContext = true;

        AddPublicDefinitions("WITH_PACKAGE_CONTEXT", (Version.MajorVersion > 4 || Version.MinorVersion > 23) && bEnablePackageContext);
        if (Version.MajorVersion > 4 || Version.MajorVersion > 26)
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                "IoStoreUtilities",
                "UnrealEd"
            });
        }

        if (Version.MajorVersion > 4 && Version.MinorVersion > 0)
        {
            PublicIncludePaths.AddRange(new List <string>()
            {
                // Path.Combine(EngineDirectory,"Source/Developer/IoStoreUtilities/Internal"),
                // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private/Cooker"),
                // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private"),
                // Path.Combine(EngineDirectory,"Source/Runtime/CoreUObject/Internal"),
                Path.Combine(ModuleDirectory, "../CookerWriterForUE5")
            });
        }
    }
Пример #2
0
        virtual protected bool ResolveBuildReference(string InBuildReference, Func <string, string> ResolutionDelegate, out IEnumerable <string> OutBuildPaths, out string OutBuildName)
        {
            OutBuildName  = null;
            OutBuildPaths = null;

            if (string.IsNullOrEmpty(InBuildReference))
            {
                return(false);
            }

            if (InBuildReference.Equals("AutoP4", StringComparison.InvariantCultureIgnoreCase))
            {
                if (!CommandUtils.P4Enabled)
                {
                    throw new AutomationException("-Build=AutoP4 requires -P4");
                }
                if (CommandUtils.P4Env.Changelist < 1000)
                {
                    throw new AutomationException("-Build=AutoP4 requires a CL from P4 and we have {0}", CommandUtils.P4Env.Changelist);
                }

                string BuildRoot = CommandUtils.CombinePaths(CommandUtils.RootBuildStorageDirectory());
                string CachePath = InternalUtils.GetEnvironmentVariable("UE-BuildCachePath", "");

                string SrcBuildPath  = CommandUtils.CombinePaths(BuildRoot, ProjectName);
                string SrcBuildPath2 = CommandUtils.CombinePaths(BuildRoot, ProjectName.Replace("Game", "").Replace("game", ""));

                string SrcBuildPath_Cache  = CommandUtils.CombinePaths(CachePath, ProjectName);
                string SrcBuildPath2_Cache = CommandUtils.CombinePaths(CachePath, ProjectName.Replace("Game", "").Replace("game", ""));

                if (!InternalUtils.SafeDirectoryExists(SrcBuildPath))
                {
                    if (!InternalUtils.SafeDirectoryExists(SrcBuildPath2))
                    {
                        throw new AutomationException("-Build=AutoP4: Neither {0} nor {1} exists.", SrcBuildPath, SrcBuildPath2);
                    }
                    SrcBuildPath       = SrcBuildPath2;
                    SrcBuildPath_Cache = SrcBuildPath2_Cache;
                }
                string SrcCLPath       = CommandUtils.CombinePaths(SrcBuildPath, CommandUtils.EscapePath(CommandUtils.P4Env.Branch) + "-CL-" + CommandUtils.P4Env.Changelist.ToString());
                string SrcCLPath_Cache = CommandUtils.CombinePaths(SrcBuildPath_Cache, CommandUtils.EscapePath(CommandUtils.P4Env.Branch) + "-CL-" + CommandUtils.P4Env.Changelist.ToString());
                if (!InternalUtils.SafeDirectoryExists(SrcCLPath))
                {
                    throw new AutomationException("-Build=AutoP4: {0} does not exist.", SrcCLPath);
                }

                if (InternalUtils.SafeDirectoryExists(SrcCLPath_Cache))
                {
                    InBuildReference = SrcCLPath_Cache;
                }
                else
                {
                    InBuildReference = SrcCLPath;
                }
                Log.Verbose("Using AutoP4 path {0}", InBuildReference);
            }

            // BuildParam could be a path, a name that we should resolve to a path, Staged, or Editor
            DirectoryInfo BuildDir = new DirectoryInfo(InBuildReference);

            if (BuildDir.Exists)
            {
                // Easy option first - is this a full path?
                OutBuildName  = BuildDir.Name;
                OutBuildPaths = new string[] { BuildDir.FullName };
            }
            else if (BuildDir.Name.Equals("local", StringComparison.OrdinalIgnoreCase) || BuildDir.Name.Equals("staged", StringComparison.OrdinalIgnoreCase))
            {
                // First special case - "Staged" means use whats locally staged
                OutBuildName = "Local";
                string StagedPath = Path.Combine(ProjectPath.Directory.FullName, "Saved", "StagedBuilds");

                if (Directory.Exists(StagedPath) == false)
                {
                    Log.Error("BuildReference was Staged but staged directory {0} not found", StagedPath);
                    return(false);
                }

                // include binaries path for packaged builds if it exists
                string BinariesPath = Path.Combine(ProjectPath.Directory.FullName, "Binaries");
                OutBuildPaths = Directory.Exists(BinariesPath) ? new string[] { StagedPath, BinariesPath } : new string[] { StagedPath };
            }
            else if (BuildDir.Name.Equals("editor", StringComparison.OrdinalIgnoreCase))
            {
                // Second special case - "Editor" means run using the editor, no path needed
                OutBuildName  = "Editor";
                OutBuildPaths = new string[] { Environment.CurrentDirectory };
            }
            else
            {
                // todo - make this more generic
                if (BuildDir.Name.Equals("usesyncedbuild", StringComparison.OrdinalIgnoreCase))
                {
                    BuildVersion Version;
                    if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
                    {
                        InBuildReference = Version.BranchName + "-CL-" + Version.Changelist.ToString();
                    }
                }

                // See if it's in the passed locations
                if (ResolutionDelegate != null)
                {
                    string FullPath = ResolutionDelegate(InBuildReference);

                    if (string.IsNullOrEmpty(FullPath) == false)
                    {
                        DirectoryInfo Di = new DirectoryInfo(FullPath);

                        if (Di.Exists == false)
                        {
                            throw new AutomationException("Resolution delegate returned non existent path");
                        }

                        OutBuildName  = Di.Name;
                        OutBuildPaths = new string[] { Di.FullName };
                    }
                }
            }

            if (string.IsNullOrEmpty(OutBuildName) || (OutBuildPaths == null || OutBuildPaths.Count() == 0))
            {
                Log.Error("Unable to resolve build argument '{0}'", InBuildReference);
                return(false);
            }

            return(true);
        }
Пример #3
0
        public override void Setup(DotNetCoreContext context)
        {
            context.Information("v{0}", GetType().Assembly.GetName().Version);
            _lifetimeActions?.BeforeSetup(context);
            if (!context.DisableGitVersion)
            {
                GitVersionTool.InstallGitVersion(context, version: context.GitVersionToolVersion);
            }

            context.Target        = context.Argument("target", "Default");
            context.Configuration = context.Argument("configuration", "Release");
            context.SolutionRoot  = context.FileSystem.GetDirectory(".").Path.MakeAbsolute(context.Environment);
            if (!context.DisableGitVersion)
            {
                context.BuildVersion = BuildVersion.Calculate(context);
            }

            context.Artifacts = context.Argument("artifacts", "./artifacts");
            context.NugetDefaultPushSourceUrl    = GetEnvOrArg(context, "NUGET_DEFAULT_PUSH_SOURCE_URL", "nugetDefaultPushSourceUrl");
            context.NugetDefaultPushSourceApiKey = GetEnvOrArg(context, "NUGET_DEFAULT_PUSH_SOURCE_API_KEY", "nugetDefaultPushSourceApiKey");

            if (!context.HasArgument("solutionFilePath"))
            {
                var slnPaths = context.Globber.Match("*.sln", x => true).Where(x => !x.FullPath.EndsWith("Build.sln", System.StringComparison.OrdinalIgnoreCase));

                if (slnPaths != null && slnPaths.Count() == 1)
                {
                    context.SolutionFilePath = slnPaths.Single().FullPath;
                }
                else if (slnPaths != null && slnPaths.Count() > 1)
                {
                    throw new CakeException("More than 1 sln files found. Specify the sln file to used with the solutionFilePath argument.");
                }
            }
            else
            {
                context.SolutionFilePath = context.SolutionFilePath != null && context.SolutionFilePath.IsSolution() ? context.SolutionFilePath : context.Argument <string>("solutionFilePath", null);
            }

            if (context.SolutionFilePath != null)
            {
                context.Information("Using solution: {0}", context.SolutionFilePath.FullPath);
                var slnResult = context.ParseSolution(context.SolutionFilePath);
                context.Projects = slnResult.Projects.Where(x => {
                    return(!x.IsSolutionFolder());
                }).Select(x => new Project(x.Path, context.ParseProject(x.Path, context.Configuration))).ToList().AsReadOnly();
            }
            else
            {
                context.Projects = new Project[0];
            }

            var buildSystem = context.BuildSystem();

            context.IsLocalBuild = buildSystem.IsLocalBuild;
            if (buildSystem.IsRunningOnTeamCity)
            {
                //do specific TC stuff here
            }

            context.DirectoriesToClean = new DirectoryPath[] { context.Artifacts };

            _lifetimeActions?.AfterSetup(context);
        }
 public void AddToBuildVersions(BuildVersion buildVersion)
 {
     base.AddObject("BuildVersions", buildVersion);
 }
Пример #5
0
 public IDisposable Initialize(DatabaseSmugglerOptions options, SmugglerResult result, long buildVersion)
 {
     _buildType = BuildVersion.Type(buildVersion);
     return(null);
 }
Пример #6
0
    private static bool FindBestSharedCookedBuild(ref string FinalCookedBuildPath, string ProjectFullPath, UnrealTargetPlatform TargetPlatform, string CookPlatform, string SharedCookedBuildCL)
    {
        string BuildRoot    = CommandUtils.P4Enabled ? CommandUtils.P4Env.Branch.Replace("/", "+") : "";
        int    CurrentCLInt = CommandUtils.P4Enabled ? CommandUtils.P4Env.Changelist : 0;

        BuildVersion Version;

        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
        {
            CurrentCLInt = Version.Changelist;
            BuildRoot    = Version.BranchName;
        }
        System.GC.Collect();
        string CurrentCL = CurrentCLInt.ToString();


        FileReference ProjectFileRef = new FileReference(ProjectFullPath);
        // get network location
        ConfigHierarchy Hierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(ProjectFileRef), TargetPlatform);
        List <string>   CookedBuildPaths;

        if (Hierarchy.GetArray("SharedCookedBuildSettings", "SharedCookedBuildPath", out CookedBuildPaths) == false)
        {
            CommandUtils.LogInformation("Unable to copy shared cooked build: SharedCookedBuildPath not set in Engine.ini SharedCookedBuildSettings");
            return(false);
        }

        const string MetaDataFilename = "\\Metadata\\DevelopmentAssetRegistry.bin";


        if (SharedCookedBuildCL == "usesyncedbuild")
        {
            foreach (string CookedBuildPath in CookedBuildPaths)
            {
                if (CurrentCL == "" && FinalCookedBuildPath.Contains("[CL]"))
                {
                    CommandUtils.LogInformation("Unable to copy shared cooked build: Unable to determine CL number from P4 or UGS, and is required by SharedCookedBuildPath");
                    return(false);
                }

                if (CurrentCL == "" && FinalCookedBuildPath.Contains("[BRANCHNAME]"))
                {
                    CommandUtils.LogInformation("Unable to copy shared cooked build: Unable to determine BRANCHNAME number from P4 or UGS, and is required by SharedCookedBuildPath");
                    return(false);
                }


                FinalCookedBuildPath = FinalCookedBuildPath.Replace("[CL]", CurrentCL.ToString());
                FinalCookedBuildPath = FinalCookedBuildPath.Replace("[BRANCHNAME]", BuildRoot);
                FinalCookedBuildPath = FinalCookedBuildPath.Replace("[PLATFORM]", CookPlatform);

                // make sure that the directory and metadata file exist.  otherwise this build might not be finished yet and we should skip it
                if (Directory.Exists(FinalCookedBuildPath))
                {
                    if (File.Exists(FinalCookedBuildPath + MetaDataFilename))
                    {
                        return(true);
                    }
                }
            }
        }
        else if (SharedCookedBuildCL == "userecentbuild")
        {
            // build our CookedBUildPath into a regex which we can execute on the directories and extract info from



            string BestBuild    = null;
            int    BestCLNumber = 0;

            // find all the recent builds which are valid
            foreach (string CookedBuildPath in CookedBuildPaths)
            {
                int IndexOfFirstParam = CookedBuildPath.IndexOf("[");
                int CustomFolderStart = CookedBuildPath.LastIndexOf("\\", IndexOfFirstParam);

                string CookedBuildDirectory = CookedBuildPath.Substring(0, CustomFolderStart);

                string BuildNameWildcard = CookedBuildPath.Substring(CustomFolderStart);


                BuildNameWildcard += MetaDataFilename;

                FileFilter BuildSearch = new FileFilter();

                // we know the platform and the branch name;
                string BuildRule = BuildNameWildcard;
                BuildRule = BuildRule.Replace("[BRANCHNAME]", BuildRoot);
                BuildRule = BuildRule.Replace("[PLATFORM]", CookPlatform);

                string IncludeRule = BuildRule.Replace("[CL]", "*");
                string ForgetRule  = BuildRule.Replace("[CL]", "*-PF-*");                // get rid of any preflights from the list... they don't count because who knows what they did...

                BuildSearch.AddRule(IncludeRule);
                BuildSearch.AddRule(ForgetRule, FileFilterType.Exclude);

                List <FileReference> ValidBuilds = BuildSearch.ApplyToDirectory(new DirectoryReference(CookedBuildDirectory), false);

                // figure out what the CL is
                string BuildNameRegex = String.Format(".*{0}", CookedBuildPath.Substring(CustomFolderStart));
                BuildNameRegex = BuildNameRegex.Replace("\\", "\\\\");
                BuildNameRegex = BuildNameRegex.Replace("[BRANCHNAME]", BuildRoot);
                BuildNameRegex = BuildNameRegex.Replace("+", "\\+");
                BuildNameRegex = BuildNameRegex.Replace("[PLATFORM]", CookPlatform);
                BuildNameRegex = BuildNameRegex.Replace("[CL]", "(?<CL>.*)");

                Regex ExtractCL = new Regex(BuildNameRegex);

                foreach (FileReference ValidBuild in ValidBuilds)
                {
                    string BuildPath = ValidBuild.FullName.Replace(MetaDataFilename, "");

                    Match CLMatch = ExtractCL.Match(BuildPath);
                    if (CLMatch != null)
                    {
                        string CLNumber    = CLMatch.Result("${CL}");
                        int    CLNumberInt = int.Parse(CLNumber);
                        if (CLNumberInt <= CurrentCLInt)
                        {
                            if (CLNumberInt > BestCLNumber)
                            {
                                BestCLNumber = CLNumberInt;
                                BestBuild    = BuildPath;
                            }
                        }
                    }
                }
            }

            if (string.IsNullOrEmpty(BestBuild))
            {
                return(false);
            }

            FinalCookedBuildPath = BestBuild;
            return(true);
        }


        return(false);
    }
    public HotPatcherCore(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
        bLegacyPublicIncludePaths = false;
        OptimizeCode = CodeOptimization.InShippingBuildsOnly;
        if (Target.Version.MajorVersion < 5 && Target.Version.MinorVersion <= 21)
        {
            bUseRTTI = true;
        }

        PublicIncludePaths.AddRange(
            new string[] {
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "UnrealEd",
            "UMG",
            "UMGEditor",
            "Core",
            "Json",
            "ContentBrowser",
            "SandboxFile",
            "JsonUtilities",
            "TargetPlatform",
            "DesktopPlatform",
            "Projects",
            "Settings",
            "HTTP",
            "RHI",
            "EngineSettings",
            "AssetRegistry",
            "PakFileUtilities",
            "HotPatcherRuntime",
            "BinariesPatchFeature"
            // ... add other public dependencies that you statically link with here ...
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "DesktopPlatform",
            "InputCore",
            "CoreUObject",
            "Engine",
            "RenderCore"
            // ... add private dependencies that you statically link with here ...
        }
            );

        if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 21)
        {
            PrivateDependencyModuleNames.Add("RenderCore");
        }
        else
        {
            PrivateDependencyModuleNames.Add("ShaderCore");
        }

        if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 23)
        {
            PublicDependencyModuleNames.AddRange(new string[] {
                "TraceLog"
            });
        }


        // // only in UE5
        if (Target.Version.MajorVersion > 4)
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                "DeveloperToolSettings"
            });
        }

        switch (Target.Configuration)
        {
        case UnrealTargetConfiguration.Debug:
        {
            PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"Debug\"");
            break;
        }

        case UnrealTargetConfiguration.DebugGame:
        {
            PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"DebugGame\"");
            break;
        }

        case UnrealTargetConfiguration.Development:
        {
            PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"Development\"");
            break;
        }

        default:
        {
            PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"\"");
            break;
        }
        }
        ;

        System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) =>
        {
            PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0));
            return(true);
        };

        bool bIOStoreSupport = Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 25;

        if (bIOStoreSupport)
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                "IoStoreUtilities"
            });
        }
        AddPublicDefinitions("WITH_IO_STORE_SUPPORT", bIOStoreSupport);
        AddPublicDefinitions("GENERATE_ASSET_REGISTRY_DATA", false);
        AddPublicDefinitions("ENABLE_COOK_LOG", true);
        AddPublicDefinitions("ENABLE_COOK_ENGINE_MAP", false);
        AddPublicDefinitions("ENABLE_COOK_PLUGIN_MAP", false);
        BuildVersion Version;

        BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version);
        AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24);
        System.Console.WriteLine("MajorVersion {0} MinorVersion: {1} PatchVersion {2}", Target.Version.MajorVersion, Target.Version.MinorVersion, Target.Version.PatchVersion);


        // Game feature
        bool bEnableGameFeature = true;

        if (bEnableGameFeature || (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 26))
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                // "GameFeatures",
                // "ModularGameplay",
            });
        }

        bool bEnablePackageContext = true;

        AddPublicDefinitions("WITH_PACKAGE_CONTEXT", (Version.MajorVersion > 4 || Version.MinorVersion > 23) && bEnablePackageContext);
        if (Version.MajorVersion > 4 || Version.MajorVersion > 26)
        {
            PublicDependencyModuleNames.AddRange(new string[]
            {
                "IoStoreUtilities",
                // "UnrealEd"
            });
        }

        if (Version.MajorVersion > 4 && Version.MinorVersion > 0)
        {
            PublicIncludePaths.AddRange(new List <string>()
            {
                // Path.Combine(EngineDirectory,"Source/Developer/IoStoreUtilities/Internal"),
                // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private/Cooker"),
                // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private"),
                // Path.Combine(EngineDirectory,"Source/Runtime/CoreUObject/Internal"),
                Path.Combine(ModuleDirectory, "../CookerWriterForUE5")
            });
        }
    }
Пример #8
0
    public HotPatcherRuntime(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicIncludePaths.AddRange(
            new string[] {
            Path.Combine(EngineDirectory, "Source/Runtime/Launch"),
            Path.Combine(ModuleDirectory, "Public")
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            // ... add other private include paths required here ...
        }
            );

        if (Target.bBuildEditor)
        {
            PublicDependencyModuleNames.Add("TargetPlatform");
        }
        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "RHI",
            "Core",
            "Projects",
            "Json",
            "JsonUtilities",
            "PakFile",
            "AssetRegistry",
            "AssetManagerEx"
            // ... add other public dependencies that you statically link with here ...
        }
            );

        // PackageContext
        {
            bool         bEnablePackageContext = false;
            BuildVersion Version;
            if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
            {
                if (Version.MajorVersion > 4 || Version.MinorVersion > 24)
                {
                    PublicDefinitions.Add("WITH_PACKAGE_CONTEXT=1");
                    bEnablePackageContext = true;
                }
            }

            if (!bEnablePackageContext)
            {
                PublicDefinitions.Add("WITH_PACKAGE_CONTEXT=0");
            }
        }

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore"
            // ... add private dependencies that you statically link with here ...
        }
            );
        if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 21)
        {
            PrivateDependencyModuleNames.Add("RenderCore");
        }
        else
        {
            PrivateDependencyModuleNames.Add("ShaderCore");
        }
        bLegacyPublicIncludePaths = false;
        OptimizeCode = CodeOptimization.InShippingBuildsOnly;
    }
Пример #9
0
 public void SetVersion(BuildVersion otherVersionData)
 {
     major = otherVersionData.major;
     minor = otherVersionData.minor;
     patch = otherVersionData.patch;
 }
Пример #10
0
    public AudiokineticTools(TargetInfo Target)
#endif
    {
        PCHUsage = PCHUsageMode.UseSharedPCHs;
        PrivateIncludePaths.Add("AudiokineticTools/Private");
        PrivateIncludePathModuleNames.AddRange(
            new string[]
        {
            "TargetPlatform",
            "MainFrame",
            "MovieSceneTools",
            "LevelEditor"
        });

        PublicIncludePathModuleNames.AddRange(
            new string[]
        {
            "AssetTools",
            "ContentBrowser",
            "Matinee"
        });

        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "AkAudio",
            "Core",
            "InputCore",
            "CoreUObject",
            "Engine",
            "UnrealEd",
            "Slate",
            "SlateCore",
            "Matinee",
            "EditorStyle",
            "Json",
            "XmlParser",
            "WorkspaceMenuStructure",
            "DirectoryWatcher",
            "Projects",
            "Sequencer",
            "PropertyEditor"
        });

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "MovieScene",
            "MovieSceneTools",
            "MovieSceneTracks"
        });

        BuildVersion Version;

        if (BuildVersion.TryRead(GetDefaultVersionFileName(Target), out Version))
        {
            if (Version.MajorVersion == 4 && Version.MinorVersion >= 15)
            {
                PrivateDependencyModuleNames.Add("MatineeToLevelSequence");
            }
        }
    }
Пример #11
0
    public override void Setup(Context context)
    {
        context.Target        = context.Argument("target", "Default");
        context.Configuration = context.Argument("configuration", "Release");
        context.LinkSources   = context.Argument("linkSources", false);

        context.Artifacts = "./packaging/";

        // Build system information.
        var buildSystem = context.BuildSystem();

        context.IsLocalBuild = buildSystem.IsLocalBuild;

        context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor;
        context.TravisCI = buildSystem.TravisCI.IsRunningOnTravisCI;
        context.IsTagged = IsBuildTagged(buildSystem);

        if (context.AppVeyor)
        {
            context.IsPullRequest  = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
            context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.AppVeyor.Environment.Repository.Name);
            context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch);
        }
        else if (context.TravisCI)
        {
            context.IsPullRequest  = !string.IsNullOrEmpty(buildSystem.TravisCI.Environment.Repository.PullRequest);
            context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.TravisCI.Environment.Repository.Slug);
            context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.TravisCI.Environment.Build.Branch);
        }

        // Force publish?
        context.ForcePublish = context.Argument <bool>("forcepublish", false);

        // Setup projects.
        context.Projects = new Project[]
        {
            new Project {
                Name = "Octokit", Path = "./Octokit/Octokit.csproj", Publish = true
            },
            new Project {
                Name = "Octokit.Reactive", Path = "./Octokit.Reactive/Octokit.Reactive.csproj", Publish = true
            },
            new Project {
                Name = "Octokit.Tests", Path = "./Octokit.Tests/Octokit.Tests.csproj", UnitTests = true
            },
            new Project {
                Name = "Octokit.Tests.Conventions", Path = "./Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj", ConventionTests = true
            },
            new Project {
                Name = "Octokit.Tests.Integration", Path = "./Octokit.Tests.Integration/Octokit.Tests.Integration.csproj", IntegrationTests = true
            }
        };

        // Install tools
        context.Information("Installing tools...");
        ToolInstaller.Install(context, "GitVersion.CommandLine", "3.6.2");
        ToolInstaller.Install(context, "Octokit.CodeFormatter", "1.0.0-preview");

        // Calculate semantic version.
        context.Version        = BuildVersion.Calculate(context);
        context.Version.Prefix = context.Argument <string>("version", context.Version.Prefix);
        context.Version.Suffix = context.Argument <string>("suffix", context.Version.Suffix);

        context.Information("Version:        {0}", context.Version.Prefix);
        context.Information("Version suffix: {0}", context.Version.Suffix);
        context.Information("Configuration:  {0}", context.Configuration);
        context.Information("LinkSources:    {0}", context.LinkSources);
        context.Information("Target:         {0}", context.Target);
        context.Information("AppVeyor:       {0}", context.AppVeyor);
        context.Information("TravisCI:       {0}", context.TravisCI);
    }
 public void MergeFrom(BuilderConfig other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Action.Length != 0)
     {
         Action = other.Action;
     }
     if (other.Track.Length != 0)
     {
         Track = other.Track;
     }
     if (other.RegistryMirror.Length != 0)
     {
         RegistryMirror = other.RegistryMirror;
     }
     if (other.DockerDaemonMtu.Length != 0)
     {
         DockerDaemonMtu = other.DockerDaemonMtu;
     }
     if (other.manifest_ != null)
     {
         if (manifest_ == null)
         {
             Manifest = new global::Estafette.Ci.Manifest.V1.EstafetteManifest();
         }
         Manifest.MergeFrom(other.Manifest);
     }
     if (other.JobName.Length != 0)
     {
         JobName = other.JobName;
     }
     if (other.ReleaseName.Length != 0)
     {
         ReleaseName = other.ReleaseName;
     }
     events_.Add(other.events_);
     if (other.ciServer_ != null)
     {
         if (ciServer_ == null)
         {
             CiServer = new global::Estafette.Ci.Contracts.V1.CiServerConfig();
         }
         CiServer.MergeFrom(other.CiServer);
     }
     if (other.buildParams_ != null)
     {
         if (buildParams_ == null)
         {
             BuildParams = new global::Estafette.Ci.Contracts.V1.BuildParamsConfig();
         }
         BuildParams.MergeFrom(other.BuildParams);
     }
     if (other.releaseParams_ != null)
     {
         if (releaseParams_ == null)
         {
             ReleaseParams = new global::Estafette.Ci.Contracts.V1.ReleaseParamsConfig();
         }
         ReleaseParams.MergeFrom(other.ReleaseParams);
     }
     if (other.git_ != null)
     {
         if (git_ == null)
         {
             Git = new global::Estafette.Ci.Contracts.V1.GitConfig();
         }
         Git.MergeFrom(other.Git);
     }
     if (other.buildVersion_ != null)
     {
         if (buildVersion_ == null)
         {
             BuildVersion = new global::Estafette.Ci.Contracts.V1.BuildVersionConfig();
         }
         BuildVersion.MergeFrom(other.BuildVersion);
     }
     credentials_.Add(other.credentials_);
     trustedImages_.Add(other.trustedImages_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Action.Length != 0)
            {
                hash ^= Action.GetHashCode();
            }
            if (Track.Length != 0)
            {
                hash ^= Track.GetHashCode();
            }
            if (RegistryMirror.Length != 0)
            {
                hash ^= RegistryMirror.GetHashCode();
            }
            if (DockerDaemonMtu.Length != 0)
            {
                hash ^= DockerDaemonMtu.GetHashCode();
            }
            if (manifest_ != null)
            {
                hash ^= Manifest.GetHashCode();
            }
            if (JobName.Length != 0)
            {
                hash ^= JobName.GetHashCode();
            }
            if (ReleaseName.Length != 0)
            {
                hash ^= ReleaseName.GetHashCode();
            }
            hash ^= events_.GetHashCode();
            if (ciServer_ != null)
            {
                hash ^= CiServer.GetHashCode();
            }
            if (buildParams_ != null)
            {
                hash ^= BuildParams.GetHashCode();
            }
            if (releaseParams_ != null)
            {
                hash ^= ReleaseParams.GetHashCode();
            }
            if (git_ != null)
            {
                hash ^= Git.GetHashCode();
            }
            if (buildVersion_ != null)
            {
                hash ^= BuildVersion.GetHashCode();
            }
            hash ^= credentials_.GetHashCode();
            hash ^= trustedImages_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #14
0
    private static bool CopySharedCookedBuildForTargetInternal(string CookedBuildPath, string CookPlatform, string LocalPath, bool bOnlyCopyAssetRegistry)
    {
        string BuildRoot = CommandUtils.P4Enabled ? CommandUtils.P4Env.Branch.Replace("/", "+") : "";
        string RecentCL  = CommandUtils.P4Enabled ? CommandUtils.P4Env.Changelist.ToString() : "";

        BuildVersion Version;

        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
        {
            RecentCL  = Version.Changelist.ToString();
            BuildRoot = Version.BranchName;
        }
        System.GC.Collect();

        // check to see if we have already synced this build ;)
        var    SyncedBuildFile = CommandUtils.CombinePaths(LocalPath, "SyncedBuild.txt");
        string BuildCL         = "Invalid";

        if (File.Exists(SyncedBuildFile))
        {
            BuildCL = File.ReadAllText(SyncedBuildFile);
        }

        if (RecentCL == "" && CookedBuildPath.Contains("[CL]"))
        {
            CommandUtils.Log("Unable to copy shared cooked build: Unable to determine CL number from P4 or UGS, and is required by SharedCookedBuildPath");
            return(false);
        }

        if (RecentCL == "" && CookedBuildPath.Contains("[BRANCHNAME]"))
        {
            CommandUtils.Log("Unable to copy shared cooked build: Unable to determine BRANCHNAME number from P4 or UGS, and is required by SharedCookedBuildPath");
            return(false);
        }


        CookedBuildPath = CookedBuildPath.Replace("[CL]", RecentCL.ToString());
        CookedBuildPath = CookedBuildPath.Replace("[BRANCHNAME]", BuildRoot);
        CookedBuildPath = CookedBuildPath.Replace("[PLATFORM]", CookPlatform);

        if (Directory.Exists(CookedBuildPath) == false)
        {
            CommandUtils.Log("Unable to copy shared cooked build: Unable to find shared build at location {0} check SharedCookedBuildPath in Engine.ini SharedCookedBuildSettings is correct", CookedBuildPath);
            return(false);
        }

        CommandUtils.Log("Attempting download of latest shared build CL {0} from location {1}", RecentCL, CookedBuildPath);

        if (BuildCL == RecentCL.ToString())
        {
            CommandUtils.Log("Already downloaded latest shared build at CL {0}", RecentCL);
            return(false);
        }

        if (bOnlyCopyAssetRegistry)
        {
            RecentCL += "RegistryOnly";
        }

        if (BuildCL == RecentCL)
        {
            CommandUtils.Log("Already downloaded latest shared build at CL {0}", RecentCL);
            return(false);
        }

        // delete all the stuff
        CommandUtils.Log("Deleting previous shared build because it was out of date");
        CommandUtils.DeleteDirectory(LocalPath);
        Directory.CreateDirectory(LocalPath);



        string CookedBuildMetadataDirectory = Path.Combine(CookedBuildPath, "Metadata");

        CookedBuildMetadataDirectory = Path.GetFullPath(CookedBuildMetadataDirectory);
        string LocalBuildMetadataDirectory = Path.Combine(LocalPath, "Metadata");

        LocalBuildMetadataDirectory = Path.GetFullPath(LocalBuildMetadataDirectory);
        if (Directory.Exists(CookedBuildMetadataDirectory))
        {
            foreach (string FileName in Directory.EnumerateFiles(CookedBuildMetadataDirectory, "*.*", SearchOption.AllDirectories))
            {
                string SourceFileName = Path.GetFullPath(FileName);
                string DestFileName   = SourceFileName.Replace(CookedBuildMetadataDirectory, LocalBuildMetadataDirectory);
                Directory.CreateDirectory(Path.GetDirectoryName(DestFileName));
                File.Copy(SourceFileName, DestFileName);
            }
        }

        if (CopySharedCookedBuildTask != null)
        {
            WaitForCopy();
        }

        if (bOnlyCopyAssetRegistry == false)
        {
            CopySharedCookedBuildTask = Task.Run(() =>
            {
                // find all the files in the staged directory
                string CookedBuildStagedDirectory = Path.GetFullPath(Path.Combine(CookedBuildPath, "Staged"));
                string LocalBuildStagedDirectory  = Path.GetFullPath(Path.Combine(LocalPath, "Staged"));
                if (Directory.Exists(CookedBuildStagedDirectory))
                {
                    foreach (string FileName in Directory.EnumerateFiles(CookedBuildStagedDirectory, "*.*", SearchOption.AllDirectories))
                    {
                        string SourceFileName = Path.GetFullPath(FileName);
                        string DestFileName   = SourceFileName.Replace(CookedBuildStagedDirectory, LocalBuildStagedDirectory);
                        Directory.CreateDirectory(Path.GetDirectoryName(DestFileName));
                        File.Copy(SourceFileName, DestFileName);
                    }
                }
                File.WriteAllText(SyncedBuildFile, RecentCL.ToString());
            }
                                                 );
        }
        else
        {
            File.WriteAllText(SyncedBuildFile, RecentCL.ToString());
        }


        return(true);
    }
Пример #15
0
    public override void Setup(Context context)
    {
        context.Target        = context.Argument("target", "Default");
        context.Configuration = context.Argument("configuration", "Release");
        context.LinkSources   = context.Argument("linkSources", false);
        context.CoreOnly      = context.Argument("CoreOnly", !context.IsRunningOnWindows());

        context.Artifacts    = "./packaging/";
        context.CodeCoverage = "./coverage-results/";

        // Build system information.
        var buildSystem = context.BuildSystem();

        context.IsLocalBuild = buildSystem.IsLocalBuild;

        if (context.CoreOnly && !context.IsLocalBuild)
        {
            context.Warning("CoreOnly was specified on a non-local build. Artifacts may be versioned incorrectly!");
        }

        context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor;
        context.TravisCI = buildSystem.TravisCI.IsRunningOnTravisCI;
        context.IsTagged = IsBuildTagged(buildSystem);

        if (context.AppVeyor)
        {
            context.IsPullRequest  = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
            context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.AppVeyor.Environment.Repository.Name);
            context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch);
        }
        else if (context.TravisCI)
        {
            context.IsPullRequest  = !string.IsNullOrEmpty(buildSystem.TravisCI.Environment.Repository.PullRequest);
            context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.TravisCI.Environment.Repository.Slug);
            context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.TravisCI.Environment.Build.Branch);
        }

        // Force publish?
        context.ForcePublish = context.Argument <bool>("forcepublish", false);

        // Setup projects.
        context.Projects = new Project[]
        {
            new Project {
                Name = "Octokit", Path = "./Octokit/Octokit.csproj", Publish = true
            },
            new Project {
                Name = "Octokit.Reactive", Path = "./Octokit.Reactive/Octokit.Reactive.csproj", Publish = true
            },
            new Project {
                Name = "Octokit.Tests", Path = "./Octokit.Tests/Octokit.Tests.csproj", UnitTests = true
            },
            new Project {
                Name = "Octokit.Tests.Conventions", Path = "./Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj", ConventionTests = true
            },
            new Project {
                Name = "Octokit.Tests.Integration", Path = "./Octokit.Tests.Integration/Octokit.Tests.Integration.csproj", IntegrationTests = true
            }
        };

        context.DotNetFormatToolPath = ToolInstaller.DotNetCoreToolInstall(context, "dotnet-format", "3.1.37601", "dotnet-format");
        context.GitVersionToolPath   = ToolInstaller.DotNetCoreToolInstall(context, "GitVersion.Tool", "5.0.0", "dotnet-gitversion");

        // Calculate semantic version.
        context.Version        = BuildVersion.Calculate(context);
        context.Version.Prefix = context.Argument <string>("version", context.Version.Prefix);
        context.Version.Suffix = context.Argument <string>("suffix", context.Version.Suffix);

        context.Information("Version:        {0}", context.Version.Prefix);
        context.Information("Version suffix: {0}", context.Version.Suffix);
        context.Information("Configuration:  {0}", context.Configuration);
        context.Information("LinkSources:    {0}", context.LinkSources);
        context.Information("CoreOnly:       {0}", context.CoreOnly);
        context.Information("Target:         {0}", context.Target);
        context.Information("AppVeyor:       {0}", context.AppVeyor);
        context.Information("TravisCI:       {0}", context.TravisCI);
    }
Пример #16
0
        /// <summary>
        /// Generate HTML documentation for all the tasks
        /// </summary>
        /// <param name="NameToTask">Map of task name to implementation</param>
        /// <param name="OutputFile">Output file</param>
        static void GenerateDocumentation(Dictionary <string, ScriptTask> NameToTask, FileReference OutputFile)
        {
            // Find all the assemblies containing tasks
            Assembly[] TaskAssemblies = NameToTask.Values.Select(x => x.ParametersClass.Assembly).Distinct().ToArray();

            // Read documentation for each of them
            Dictionary <string, XmlElement> MemberNameToElement = new Dictionary <string, XmlElement>();

            foreach (Assembly TaskAssembly in TaskAssemblies)
            {
                string XmlFileName = Path.ChangeExtension(TaskAssembly.Location, ".xml");
                if (File.Exists(XmlFileName))
                {
                    // Read the document
                    XmlDocument Document = new XmlDocument();
                    Document.Load(XmlFileName);

                    // Parse all the members, and add them to the map
                    foreach (XmlElement Element in Document.SelectNodes("/doc/members/member"))
                    {
                        string Name = Element.GetAttribute("name");
                        MemberNameToElement.Add(Name, Element);
                    }
                }
            }

            // Create the output directory
            DirectoryReference.CreateDirectory(OutputFile.Directory);
            FileReference.MakeWriteable(OutputFile);
            Log("Writing {0}...", OutputFile);

            // Parse the engine version
            BuildVersion Version;

            if (!BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
            {
                throw new AutomationException("Couldn't read Build.version");
            }

            // Write the output file
            using (StreamWriter Writer = new StreamWriter(OutputFile.FullName))
            {
                Writer.WriteLine("Availability: NoPublish");
                Writer.WriteLine("Title: BuildGraph Predefined Tasks");
                Writer.WriteLine("Crumbs: %ROOT%, Programming, Programming/Development, Programming/Development/BuildGraph, Programming/Development/BuildGraph/BuildGraphScriptTasks");
                Writer.WriteLine("Description: This is a procedurally generated markdown page.");
                Writer.WriteLine("version: {0}.{1}", Version.MajorVersion, Version.MinorVersion);
                Writer.WriteLine("parent:Programming/Development/BuildGraph/BuildGraphScriptTasks");
                Writer.WriteLine();
                foreach (string TaskName in NameToTask.Keys.OrderBy(x => x))
                {
                    // Get the task object
                    ScriptTask Task = NameToTask[TaskName];

                    // Get the documentation for this task
                    XmlElement TaskElement;
                    if (MemberNameToElement.TryGetValue("T:" + Task.TaskClass.FullName, out TaskElement))
                    {
                        // Write the task heading
                        Writer.WriteLine("### {0}", TaskName);
                        Writer.WriteLine();
                        Writer.WriteLine(ConvertToMarkdown(TaskElement.SelectSingleNode("summary")));
                        Writer.WriteLine();

                        // Document the parameters
                        List <string[]> Rows = new List <string[]>();
                        foreach (string ParameterName in Task.NameToParameter.Keys)
                        {
                            // Get the parameter data
                            ScriptTaskParameter Parameter = Task.NameToParameter[ParameterName];

                            // Get the documentation for this parameter
                            XmlElement ParameterElement;
                            if (MemberNameToElement.TryGetValue("F:" + Parameter.FieldInfo.DeclaringType.FullName + "." + Parameter.Name, out ParameterElement))
                            {
                                string TypeName = Parameter.FieldInfo.FieldType.Name;
                                if (Parameter.ValidationType != TaskParameterValidationType.Default)
                                {
                                    StringBuilder NewTypeName = new StringBuilder(Parameter.ValidationType.ToString());
                                    for (int Idx = 1; Idx < NewTypeName.Length; Idx++)
                                    {
                                        if (Char.IsLower(NewTypeName[Idx - 1]) && Char.IsUpper(NewTypeName[Idx]))
                                        {
                                            NewTypeName.Insert(Idx, ' ');
                                        }
                                    }
                                    TypeName = NewTypeName.ToString();
                                }

                                string[] Columns = new string[4];
                                Columns[0] = ParameterName;
                                Columns[1] = TypeName;
                                Columns[2] = Parameter.bOptional? "Optional" : "Required";
                                Columns[3] = ConvertToMarkdown(ParameterElement.SelectSingleNode("summary"));
                                Rows.Add(Columns);
                            }
                        }

                        // Always include the "If" attribute
                        string[] IfColumns = new string[4];
                        IfColumns[0] = "If";
                        IfColumns[1] = "Condition";
                        IfColumns[2] = "Optional";
                        IfColumns[3] = "Whether to execute this task. It is ignored if this condition evaluates to false.";
                        Rows.Add(IfColumns);

                        // Get the width of each column
                        int[] Widths = new int[4];
                        for (int Idx = 0; Idx < 4; Idx++)
                        {
                            Widths[Idx] = Rows.Max(x => x[Idx].Length);
                        }

                        // Format the markdown table
                        string Format = String.Format("| {{0,-{0}}} | {{1,-{1}}} | {{2,-{2}}} | {{3,-{3}}} |", Widths[0], Widths[1], Widths[2], Widths[3]);
                        Writer.WriteLine(Format, "", "", "", "");
                        Writer.WriteLine(Format, new string('-', Widths[0]), new string('-', Widths[1]), new string('-', Widths[2]), new string('-', Widths[3]));
                        for (int Idx = 0; Idx < Rows.Count; Idx++)
                        {
                            Writer.WriteLine(Format, Rows[Idx][0], Rows[Idx][1], Rows[Idx][2], Rows[Idx][3]);
                        }

                        // Blank line before next task
                        Writer.WriteLine();
                    }
                }
            }
        }
Пример #17
0
    public SpaceNav3D(ReadOnlyTargetRules Target) : base(Target)
    {
        // tanis - start faster compile time for small projects
        MinFilesUsingPrecompiledHeaderOverride = 1;
        bFasterWithoutUnity = true;
        // tanis - end

        PublicIncludePaths.AddRange(
            new string[] {
            "SpaceNav3D/Public"
        }
            );

        PrivateIncludePaths.AddRange(
            new string[] {
            "SpaceNav3D/Private"
        }
            );

        BuildVersion Version;

        // Have to use GetDefaultFileName() here because UE 4.18 removed the TryRead member that took one argument from UE 4.17.
        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
        {
            if (Version.MajorVersion == 4 && Version.MinorVersion <= 17)
            {
                PublicDependencyModuleNames.AddRange(
                    new string[]
                {
                    "Core",
                    "CoreUObject",
                    "Engine",
                    "SlateCore",
                    "Slate",
                    "InputCore",
                    "InputDevice"
                    // ... add other public dependencies that you statically link with here ...
                }
                    );
            }
            else
            {
                PublicDependencyModuleNames.AddRange(
                    new string[]
                {
                    "Core",
                    "ApplicationCore",
                    "CoreUObject",
                    "Engine",
                    "SlateCore",
                    "Slate",
                    "InputCore",
                    "InputDevice"
                    // ... add other public dependencies that you statically link with here ...
                }
                    );
            }

            if (Target.Type == TargetType.Editor)
            {
                PublicDependencyModuleNames.AddRange(
                    new string[]
                {
                    "UnrealEd",
                }
                    );
            }
        }

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            // ... add private dependencies that you statically link with here ...
        }
            );

        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );

        // Load the 3DxWare SDK
        Load3DxWareSDK(Target);
    }
Пример #18
0
    public HotPatcherRuntime(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicIncludePaths.AddRange(
            new string[] {
            Path.Combine(EngineDirectory, "Source/Runtime/Launch"),
            Path.Combine(ModuleDirectory, "Public"),
            Path.Combine(ModuleDirectory, "Public/BaseTypes")
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            // ... add other private include paths required here ...
        }
            );

        if (Target.bBuildEditor)
        {
            PublicDependencyModuleNames.Add("TargetPlatform");
        }

        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "RHI",
            "Core",
            "Projects",
            "Json",
            "JsonUtilities",
            "PakFile",
            "AssetRegistry",
            "BinariesPatchFeature"
            // ... add other public dependencies that you statically link with here ...
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore"
            // ... add private dependencies that you statically link with here ...
        }
            );
        if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 21)
        {
            PrivateDependencyModuleNames.Add("RenderCore");
        }
        else
        {
            PrivateDependencyModuleNames.Add("ShaderCore");
        }

        BuildVersion Version;

        BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version);
        // PackageContext
        System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) =>
        {
            PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0));
            return(true);
        };

        AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24);

        bool bCustomAssetGUID = false;

        if (bCustomAssetGUID)
        {
            PublicDefinitions.Add("CUSTOM_ASSET_GUID");
        }

        bLegacyPublicIncludePaths = false;
        OptimizeCode = CodeOptimization.InShippingBuildsOnly;
    }
Пример #19
0
 /// <summary>
 /// Set's the build version with quality (e.g. version suffix).
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public static BuildVersion SetBuildVersionWithQuality(this ITaskContextInternal context, BuildVersion version)
 {
     context.Properties.Set(BuildProps.BuildVersionWithQuality, version);
     return(version);
 }
Пример #20
0
		public static List<string> StaticUpdateVersionFiles(int ChangelistNumber, int CompatibleChangelistNumber, string Branch, string Build, bool bIsLicenseeVersion, bool bDoUpdateVersionFiles)
		{
			string ChangelistString = (ChangelistNumber != 0 && bDoUpdateVersionFiles)? ChangelistNumber.ToString() : String.Empty;

			var Result = new List<String>();
			{
				string VerFile = BuildVersion.GetDefaultFileName();
				if (bDoUpdateVersionFiles)
				{
					LogLog("Updating {0} with:", VerFile);
					LogLog("  Changelist={0}", ChangelistNumber);
					LogLog("  CompatibleChangelist={0}", CompatibleChangelistNumber);
					LogLog("  IsLicenseeVersion={0}", bIsLicenseeVersion? 1 : 0);
					LogLog("  BranchName={0}", Branch);

					BuildVersion Version;
					if(!BuildVersion.TryRead(VerFile, out Version))
					{
						Version = new BuildVersion();
					}

					Version.Changelist = ChangelistNumber;
					Version.CompatibleChangelist = CompatibleChangelistNumber;
					Version.IsLicenseeVersion = bIsLicenseeVersion? 1 : 0;
					Version.BranchName = Branch;

					VersionFileUpdater.MakeFileWriteable(VerFile);

					Version.Write(VerFile);
				}
				else
				{
					LogVerbose("{0} will not be updated because P4 is not enabled.", VerFile);
				}
				Result.Add(VerFile);
			}

            string EngineVersionFile = CombinePaths(CmdEnv.LocalRoot, "Engine", "Source", "Runtime", "Launch", "Resources", "Version.h");
            {
                string VerFile = EngineVersionFile;
				if (bDoUpdateVersionFiles)
				{
					LogLog("Updating {0} with:", VerFile);
					LogLog(" #define	BRANCH_NAME  {0}", Branch);
					LogLog(" #define	BUILT_FROM_CHANGELIST  {0}", ChangelistString);
					if(CompatibleChangelistNumber > 0)
					{
						LogLog(" #define	ENGINE_COMPATIBLE_CL_VERSION  {0}", CompatibleChangelistNumber);
					}
					if (Build != null)
					{
						LogLog(" #define	BUILD_VERSION  {0}", Build);
					}
					LogLog(" #define   ENGINE_IS_LICENSEE_VERSION  {0}", bIsLicenseeVersion ? "1" : "0");

					VersionFileUpdater VersionH = new VersionFileUpdater(VerFile);
					VersionH.ReplaceLine("#define BRANCH_NAME ", "\"" + Branch + "\"");
					VersionH.ReplaceLine("#define BUILT_FROM_CHANGELIST ", ChangelistString);
					if (Build != null)
					{
						VersionH.ReplaceLine("#define BUILD_VERSION ", "L\"" + Build + "\"");
					}
					if(CompatibleChangelistNumber > 0)
					{
						VersionH.ReplaceLine("#define ENGINE_COMPATIBLE_CL_VERSION", CompatibleChangelistNumber.ToString(), bIsLicenseeVersion? 0 : 1);
					}
					VersionH.ReplaceLine("#define ENGINE_IS_LICENSEE_VERSION ", bIsLicenseeVersion ? "1" : "0");

                    VersionH.Commit();
                }
				else
				{
					LogVerbose("{0} will not be updated because P4 is not enabled.", VerFile);
				}
                Result.Add(VerFile);
            }

            {
                // Use Version.h data to update MetaData.cs so the assemblies match the engine version.
                string VerFile = CombinePaths(CmdEnv.LocalRoot, "Engine", "Source", "Programs", "DotNETCommon", "MetaData.cs");

				if (bDoUpdateVersionFiles)
                {
                    // Get the MAJOR/MINOR/PATCH from the Engine Version file, as it is authoritative. The rest we get from the P4Env.
                    string NewInformationalVersion = FEngineVersionSupport.FromVersionFile(EngineVersionFile, ChangelistNumber).ToString();

                    LogLog("Updating {0} with AssemblyInformationalVersion: {1}", VerFile, NewInformationalVersion);

                    VersionFileUpdater VersionH = new VersionFileUpdater(VerFile);
                    VersionH.SetAssemblyInformationalVersion(NewInformationalVersion);
                    VersionH.Commit();
                }
                else
                {
                    LogVerbose("{0} will not be updated because P4 is not enabled.", VerFile);
                }
                Result.Add(VerFile);
            }

			return Result;
		}
Пример #21
0
    public Scene3DUI(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
        BuildVersion version = EngineVersion;


        PublicIncludePaths.AddRange(
            new string[] {
            // ... add public include paths required here ...
        }
            );

        var EngineDir = Path.GetFullPath(Target.RelativeEnginePath);

        PrivateIncludePaths.AddRange(
            new string[] {
            "Scene3DUI/Private",
            "Scene3DUI/Public",
            Path.Combine(EngineDir, @"Source\Runtime\Renderer\Private"),
            Path.Combine(EngineDir, @"Source\Runtime\Launch"),
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore",
            "RHI",
            "Renderer",
            "RenderCore",
            "InputCore",
            "UMG",
            "LevelSequence",
            "Projects",
            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore",
            "RHI",
            "Renderer",
            "RenderCore",
            // ... add private dependencies that you statically link with here ...
        }
            );

        if (version.MinorVersion < 22)
        {
            PublicDependencyModuleNames.AddRange(new string[] { "ShaderCore", });
            PrivateDependencyModuleNames.AddRange(new string[] { "ShaderCore", });
        }



        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );
    }
Пример #22
0
    public override void Setup(Context context)
    {
        context.Target        = context.Argument("target", "Default");
        context.Configuration = context.Argument("configuration", "Release");
        context.LinkSources   = context.Argument("linkSources", false);
        context.FormatCode    = context.Argument("formatCode", false);

        context.Artifacts    = "./packaging/";
        context.CodeCoverage = "./coverage-results/";

        // Build system information.
        var buildSystem = context.BuildSystem();

        context.IsLocalBuild = buildSystem.IsLocalBuild;

        context.GitHubActions = buildSystem.GitHubActions.IsRunningOnGitHubActions;
        context.AppVeyor      = buildSystem.AppVeyor.IsRunningOnAppVeyor;
        context.IsTagged      = IsBuildTagged(buildSystem);

        if (context.AppVeyor)
        {
            context.IsPullRequest  = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
            context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.AppVeyor.Environment.Repository.Name);
            context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch);
        }
        else if (context.GitHubActions)
        {
            context.IsPullRequest  = buildSystem.GitHubActions.Environment.PullRequest.IsPullRequest;
            context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.GitHubActions.Environment.Workflow.Repository);
            context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.GitHubActions.Environment.Workflow.Ref);
        }

        // Force publish?
        context.ForcePublish = context.Argument <bool>("forcepublish", false);

        // Setup projects.
        context.Projects = new Project[]
        {
            new Project {
                Name = "Octokit", Path = "./Octokit/Octokit.csproj", Publish = true
            },
            new Project {
                Name = "Octokit.Reactive", Path = "./Octokit.Reactive/Octokit.Reactive.csproj", Publish = true
            },
            new Project {
                Name = "Octokit.Tests", Path = "./Octokit.Tests/Octokit.Tests.csproj", UnitTests = true
            },
            new Project {
                Name = "Octokit.Tests.Conventions", Path = "./Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj", ConventionTests = true
            },
            new Project {
                Name = "Octokit.Tests.Integration", Path = "./Octokit.Tests.Integration/Octokit.Tests.Integration.csproj", IntegrationTests = true
            }
        };

        context.DotNetFormatToolPath = ToolInstaller.DotNetCoreToolInstall(context, "dotnet-format", "3.1.37601", "dotnet-format");
        context.GitVersionToolPath   = ToolInstaller.DotNetCoreToolInstall(context, "GitVersion.Tool", "5.1.3", "dotnet-gitversion");

        // Calculate semantic version.
        context.Version        = BuildVersion.Calculate(context);
        context.Version.Prefix = context.Argument <string>("version", context.Version.Prefix);
        context.Version.Suffix = context.Argument <string>("suffix", context.Version.Suffix);

        context.Information("Version:        {0}", context.Version.Prefix);
        context.Information("Version suffix: {0}", context.Version.Suffix);
        context.Information("Configuration:  {0}", context.Configuration);
        context.Information("LinkSources:    {0}", context.LinkSources);
        context.Information("Target:         {0}", context.Target);
        context.Information("AppVeyor:       {0}", context.AppVeyor);
        context.Information("GitHub Actions: {0}", context.GitHubActions);
    }
Пример #23
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="assembly"></param>
 public ApplicationStatus(Assembly assembly)
 {
     BuildDate    = GetBuildDate(assembly);
     BuildVersion = new BuildVersion(assembly);
 }
Пример #24
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (RepoSource.Length != 0)
            {
                hash ^= RepoSource.GetHashCode();
            }
            if (RepoOwner.Length != 0)
            {
                hash ^= RepoOwner.GetHashCode();
            }
            if (RepoName.Length != 0)
            {
                hash ^= RepoName.GetHashCode();
            }
            if (RepoBranch.Length != 0)
            {
                hash ^= RepoBranch.GetHashCode();
            }
            if (RepoRevision.Length != 0)
            {
                hash ^= RepoRevision.GetHashCode();
            }
            if (BuildVersion.Length != 0)
            {
                hash ^= BuildVersion.GetHashCode();
            }
            if (BuildStatus.Length != 0)
            {
                hash ^= BuildStatus.GetHashCode();
            }
            hash ^= labels_.GetHashCode();
            hash ^= releaseTargets_.GetHashCode();
            if (Manifest.Length != 0)
            {
                hash ^= Manifest.GetHashCode();
            }
            if (ManifestWithDefaults.Length != 0)
            {
                hash ^= ManifestWithDefaults.GetHashCode();
            }
            hash ^= commits_.GetHashCode();
            hash ^= triggers_.GetHashCode();
            hash ^= events_.GetHashCode();
            if (insertedAtTime_ != null)
            {
                hash ^= InsertedAtTime.GetHashCode();
            }
            if (updatedAtTime_ != null)
            {
                hash ^= UpdatedAtTime.GetHashCode();
            }
            if (duration_ != null)
            {
                hash ^= Duration.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #25
0
 private void FillESXInfo(ICollection<PSObject> data)
 {
     try {
         foreach (PSObject vmHost in data) {
             BuildVersion _bv = new BuildVersion();
             VMHostImpl vmHostImpl = (VMHostImpl)vmHost.BaseObject;
             _bv.Build = vmHostImpl.Build;
             _bv.Version = vmHostImpl.Version;
             _bv.Name = vmHostImpl.Name;
             _bv.hostType = HostType.ESX;
             alEsxHostInfo.Add(_bv);
         }
     }
     catch (Exception e) {
         Console.Error.WriteLine("Stack Trace: {0}, Message: {1}", e.StackTrace, e.Message);
     }
 }
 public static BuildVersion CreateBuildVersion(byte systemInformationID, string database_Version, global::System.DateTime versionDate, global::System.DateTime modifiedDate)
 {
     BuildVersion buildVersion = new BuildVersion();
     buildVersion.SystemInformationID = systemInformationID;
     buildVersion.Database_Version = database_Version;
     buildVersion.VersionDate = versionDate;
     buildVersion.ModifiedDate = modifiedDate;
     return buildVersion;
 }
Пример #27
0
    public override void Setup(Context context)
    {
        // Arguments
        context.Target                            = context.Argument <string>("target", "Default");
        context.BuildConfiguration                = context.Argument <string>("configuration", "Release");
        context.ForcePublish                      = context.Argument <bool>("forcepublish", false);
        context.AzureArtifactsSourceUrl           = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_URL", "azureartifactssourceurl");
        context.AzureArtifactsPersonalAccessToken = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN", "mygetapikey");
        context.AzureArtifactsSourceName          = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_NAME", "azureartifactssourcename");
        context.AzureArtifactsSourceUserName      = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_USER_NAME", "azureartifactssourceusername");
        context.GitHubToken                       = GetEnvironmentValueOrArgument(context, "FROSTING_GITHUB_TOKEN", "githubtoken");

        // Directories
        context.Artifacts = new DirectoryPath("./artifacts");

        // Build system information.
        var buildSystem = context.BuildSystem();

        context.AppVeyor          = buildSystem.AppVeyor.IsRunningOnAppVeyor;
        context.IsLocalBuild      = buildSystem.IsLocalBuild;
        context.IsPullRequest     = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
        context.PrimaryBranchName = "master";
        context.RepositoryOwner   = "cake-build";
        context.RepositoryName    = "frosting";
        context.IsOriginalRepo    = StringComparer.OrdinalIgnoreCase.Equals(string.Concat(context.RepositoryOwner, "/", context.RepositoryName), buildSystem.AppVeyor.Environment.Repository.Name);
        context.IsTagged          = IsBuildTagged(buildSystem);
        context.IsPrimaryBranch   = StringComparer.OrdinalIgnoreCase.Equals(context.PrimaryBranchName, buildSystem.AppVeyor.Environment.Repository.Branch);
        context.BuildSystem       = buildSystem;

        // Install Global .Net Tools
        context.Information("Installing .Net Global Tools...");
        context.DotNetCoreToolInstall("GitReleaseManager.Tool", "0.11.0", "dotnet-gitreleasemanager");
        context.DotNetCoreToolInstall("SignClient", "1.2.109", "SignClient");
        context.DotNetCoreToolInstall("GitVersion.Tool", "5.1.2", "dotnet-gitversion");

        // Calculate semantic version.
        context.Version            = BuildVersion.Calculate(context);
        context.Version.Version    = context.Argument <string>("version", context.Version.Version);
        context.Version.SemVersion = context.Argument <string>("suffix", context.Version.SemVersion);

        // MSBuild Settings
        context.MSBuildSettings = new DotNetCoreMSBuildSettings()
                                  .WithProperty("Version", context.Version.SemVersion)
                                  .WithProperty("AssemblyVersion", context.Version.Version)
                                  .WithProperty("FileVersion", context.Version.Version);

        if (context.AppVeyor)
        {
            context.MSBuildSettings.WithProperty("ContinuousIntegrationBuild", "true");
        }

        if (!context.IsRunningOnWindows())
        {
            var frameworkPathOverride = context.Environment.Runtime.IsCoreClr
                                        ?   new [] {
                new DirectoryPath("/Library/Frameworks/Mono.framework/Versions/Current/lib/mono"),
                new DirectoryPath("/usr/lib/mono"),
                new DirectoryPath("/usr/local/lib/mono")
            }
            .Select(directory => directory.Combine("4.5"))
            .FirstOrDefault(directory => context.FileSystem.Exist(directory))
            ?.FullPath + "/"
                                        : new FilePath(typeof(object).Assembly.Location).GetDirectory().FullPath + "/";

            // Use FrameworkPathOverride when not running on Windows.
            context.Information("Build will use FrameworkPathOverride={0} since not building on Windows.", frameworkPathOverride);
            context.MSBuildSettings.WithProperty("FrameworkPathOverride", frameworkPathOverride);
        }

        context.Information("Version: {0}", context.Version);
        context.Information("Sem version: {0}", context.Version.SemVersion);
        context.Information("Configuration: {0}", context.BuildConfiguration);
        context.Information("Target: {0}", context.Target);
        context.Information("AppVeyor: {0}", context.AppVeyor);
    }
    public UnrealEnginePython(TargetInfo Target)
#endif
    {
        PublicIncludePaths.AddRange(
            new string[] {
            "UnrealEnginePython/Public",
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            "UnrealEnginePython/Private",
            PythonHome,
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Sockets",
            "Networking",
            "Projects"
            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "InputCore",
            "Slate",
            "SlateCore",
            "MovieScene",
            "LevelSequence",
            "HTTP",
            "UMG",
            "AppFramework",
            "RHI",
            "Voice",
            "RenderCore",
            "MovieSceneCapture",
            "Landscape",
            "Foliage",
            // ... add private dependencies that you statically link with here ...
        }
            );


#if WITH_FORWARDED_MODULE_RULES_CTOR
        BuildVersion Version;
        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
        {
            if (Version.MinorVersion >= 18)
            {
                PrivateDependencyModuleNames.Add("ApplicationCore");
            }
        }
#endif


        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );

#if WITH_FORWARDED_MODULE_RULES_CTOR
        if (Target.bBuildEditor)
#else
        if (UEBuildConfiguration.bBuildEditor)
#endif
        {
            PrivateDependencyModuleNames.AddRange(new string[] {
                "UnrealEd",
                "LevelEditor",
                "BlueprintGraph",
                "Projects",
                "Sequencer",
                "SequencerWidgets",
                "AssetTools",
                "LevelSequenceEditor",
                "MovieSceneTools",
                "MovieSceneTracks",
                "CinematicCamera",
                "EditorStyle",
                "GraphEditor",
                "UMGEditor",
                "AIGraph",
                "RawMesh",
                "DesktopWidgets",
                "EditorWidgets",
                "FBX",
                "Persona",
                "PropertyEditor",
                "LandscapeEditor",
                "MaterialEditor"
            });
        }

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            if (UseThirdPartyPython)
            {
                PythonHome = ThirdPartyPythonHome;

                System.Console.WriteLine("Using Embedded Python at: " + PythonHome);
                PublicIncludePaths.Add(PythonHome);
                string libPath = Path.Combine(PythonHome, "Lib", string.Format("{0}.lib", PythonType.ToLower()));

                System.Console.WriteLine("full lib path: " + libPath);
                PublicLibraryPaths.Add(Path.GetDirectoryName(libPath));
                PublicAdditionalLibraries.Add(libPath);

                string dllPath = Path.Combine(BinariesPath, "Win64", string.Format("{0}.dll", PythonType.ToLower()));
                RuntimeDependencies.Add(new RuntimeDependency(dllPath));
            }
            else if (PythonHome == "")
            {
                PythonHome = DiscoverPythonPath(windowsKnownPaths);
                if (PythonHome == "")
                {
                    throw new System.Exception("Unable to find Python installation");
                }

                System.Console.WriteLine("Using Python at: " + PythonHome);
                PublicIncludePaths.Add(PythonHome);
                string libPath = GetWindowsPythonLibFile(PythonHome);
                PublicLibraryPaths.Add(Path.GetDirectoryName(libPath));
                PublicAdditionalLibraries.Add(libPath);
            }
        }

        //other platforms
        else
        {
            if (PythonHome == "")
            {
                PythonHome = DiscoverPythonPath(macKnownPaths);
                if (PythonHome == "")
                {
                    throw new System.Exception("Unable to find Python installation");
                }
                System.Console.WriteLine("Using Python at: " + PythonHome);
                PublicIncludePaths.Add(PythonHome);
                PublicAdditionalLibraries.Add(Path.Combine(PythonHome, "Lib", string.Format("{0}.lib", PythonType)));
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                string includesPath = DiscoverLinuxPythonIncludesPath();
                if (includesPath == null)
                {
                    throw new System.Exception("Unable to find Python includes, please add a search path to linuxKnownIncludesPaths");
                }
                string libsPath = DiscoverLinuxPythonLibsPath();
                if (libsPath == null)
                {
                    throw new System.Exception("Unable to find Python libs, please add a search path to linuxKnownLibsPaths");
                }
                PublicIncludePaths.Add(includesPath);
                PublicAdditionalLibraries.Add(libsPath);
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                string[] items = PythonHome.Split(';');
                PublicIncludePaths.Add(items[0]);
                PublicAdditionalLibraries.Add(items[1]);
            }
        }

        /*string enableThreads = System.Environment.GetEnvironmentVariable("UEP_ENABLE_THREADS");
         * if (!string.IsNullOrEmpty(enableThreads))
         * {
         *  Definitions.Add("UEPY_THREADING");
         *  System.Console.WriteLine("*** Enabled Python Threads support ***");
         * }*/
    }
    public Smartsuit(ReadOnlyTargetRules Target) : base(Target)
    {
        //MinFilesUsingPrecompiledHeaderOverride = 1;
        //bFasterWithoutUnity = true;

        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));
        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));
        //     PublicIncludePaths.AddRange(
        //         new string[] {
        //             "Smartsuit/Public",
        //             "LiveLink/Public",
        //	// ... add public include paths required here ...
        //}
        //         );


        //     PrivateIncludePaths.AddRange(
        //         new string[] {
        //             "Smartsuit/Private",
        //             "LiveLink/Private",

        //	// ... add other private include paths required here ...
        //}
        //         );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            //"Core",
            //"Core", "AnimGraph", "BlueprintGraph", "AnimGraphRuntime", "CoreUObject", "Engine", "Sockets", "Networking",
            "Core", "CoreUObject", "Engine", "Sockets", "Http", "Networking", "AnimGraphRuntime", "Json", "JsonUtilities", "LiveLink", "RenderCore", "InputCore"    /*, "LiveLinkInterface"*/
            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            //"LiveLinkEditor", "LiveLinkInterface", "LiveLinkMessageBusFramework",
            //"Core",
            //"CoreUObject",
            //"Engine",
            //"MovieScene",
            //"MovieSceneTracks",
            //"Projects",

            "Messaging",
            "LiveLink",
            "LiveLinkInterface",
            "LiveLinkMessageBusFramework",
            "HeadMountedDisplay",
            "TimeManagement",
            "SlateCore",
            "Slate"
            //"CoreUObject",
            //"Engine",
            //"InputCore",
            //"AnimGraph",
            //"BlueprintGraph",
            //"Networking",
            //"Sockets",
            //"AnimGraphRuntime",
            // ... add private dependencies that you statically link with here ...
        }
            );


        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );

        BuildVersion version;

        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out version))
#if UE_4_19_OR_LATER
        { PublicDefinitions.Add(string.Format("BUILT_MINOR_VERSION={0}", version.MinorVersion)); }
#else
        { Definitions.Add(string.Format("BUILT_MINOR_VERSION={0}", version.MinorVersion)); }
#endif

        LoadSmartsuitMagic(Target);

        //PublicDefinitions.Add("LZ4F_STATIC_LINKING_ONLY");

        LoadLZ4(Target);
    }
        /// <summary>
        /// Serializes the given build.
        /// </summary>
        /// <remarks>
        /// Folders have to be serialized right after being changed to update parent information in time.
        ///
        /// The folder builds are moved to has to be serialized before their old folder.
        /// </remarks>
        public void SerializeBuild(IBuild build)
        {
            string oldName;

            _names.TryGetValue(build, out oldName);
            var name = build.Name;

            _names[build] = name;

            var path    = PathFor(build, true);
            var oldPath = path.Remove(path.Length - SerializationUtils.EncodeFileName(name).Length)
                          + SerializationUtils.EncodeFileName(oldName);
            var poeBuild = build as PoEBuild;

            if (poeBuild != null)
            {
                SerializeBuild(path, poeBuild);
                if (oldName != null && oldName != name)
                {
                    File.Delete(oldPath + BuildFileExtension);
                }
            }
            else
            {
                if (oldName != null && oldName != name)
                {
                    Directory.Move(oldPath, path);
                }
                var folder = (BuildFolder)build;

                // Move builds that are in folder.Builds but have _parents set to another folder
                // from their old folder to this one.
                foreach (var b in folder.Builds)
                {
                    BuildFolder parent;
                    _parents.TryGetValue(b, out parent);
                    if (_markedForDeletion.ContainsKey(b) || (parent != null && parent != folder))
                    {
                        var    isBuild   = b is PoEBuild;
                        var    extension = isBuild ? BuildFileExtension : "";
                        string old;
                        if (_markedForDeletion.ContainsKey(b))
                        {
                            old = _markedForDeletion[b];
                            _markedForDeletion.Remove(b);
                        }
                        else
                        {
                            old = PathFor(b, true) + extension;
                        }

                        var newPath = Path.Combine(path,
                                                   SerializationUtils.EncodeFileName(_names[b]) + extension);
                        if (old == newPath)
                        {
                            continue;
                        }
                        if (isBuild)
                        {
                            File.Move(old, newPath);
                        }
                        else
                        {
                            Directory.Move(old, newPath);
                        }
                    }
                }

                // Mark builds that have folder as _parents entry but are no longer in folder.Builds.
                // These will either be moved when their new folder is saved or deleted when Delete is called.
                // Skip unsaved builds (those are not contained in _names)
                foreach (var parentsEntry in _parents)
                {
                    var b = parentsEntry.Key;
                    if (parentsEntry.Value != folder ||
                        !_names.ContainsKey(b) ||
                        folder.Builds.Contains(b))
                    {
                        continue;
                    }
                    var extension = b is PoEBuild ? BuildFileExtension : "";
                    _markedForDeletion[b] = PathFor(b, true) + extension;
                }

                var xmlFolder = new XmlBuildFolder
                {
                    Version    = BuildVersion.ToString(),
                    IsExpanded = folder.IsExpanded,
                    Builds     = folder.Builds.Select(b => b.Name).ToList()
                };
                Directory.CreateDirectory(path);
                SerializationUtils.XmlSerialize(xmlFolder, Path.Combine(path, BuildFolderFileName));
            }

            // Just recreate these. Easier than handling all edge cases.
            InitParents();
        }
Пример #31
0
    static void CopySharedCookedBuildForTarget(ProjectParams Params, TargetPlatformDescriptor TargetPlatform, string CookPlatform)
    {
        string ProjectPath = Params.RawProjectPath.FullName;
        var    LocalPath   = CombinePaths(GetDirectoryName(ProjectPath), "Saved", "SharedIterativeBuild", CookPlatform);

        // get network location
        ConfigHierarchy Hierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Params.RawProjectPath), TargetPlatform.Type);
        string          CookedBuildPath;

        if (Hierarchy.GetString("SharedCookedBuildSettings", "SharedCookedBuildPath", out CookedBuildPath) == false)
        {
            Log("Unable to copy shared cooked build: SharedCookedBuildPath not set in Engine.ini SharedCookedBuildSettings");
            return;
        }

        string BuildRoot = P4Enabled ? P4Env.BuildRootP4.Replace("/", "+") : "";
        int    RecentCL  = P4Enabled ? P4Env.Changelist : 0;

        BuildVersion Version;

        if (BuildVersion.TryRead(out Version))
        {
            RecentCL  = Version.Changelist;
            BuildRoot = Version.BranchName;
        }

        // check to see if we have already synced this build ;)
        var    SyncedBuildFile = CombinePaths(LocalPath, "SyncedBuild.txt");
        string BuildCL         = "Invalid";

        if (File.Exists(SyncedBuildFile))
        {
            BuildCL = File.ReadAllText(SyncedBuildFile);
        }

        if (RecentCL == 0 && CookedBuildPath.Contains("[CL]"))
        {
            Log("Unable to copy shared cooked build: Unable to determine CL number from P4 or UGS, and is required by SharedCookedBuildPath");
            return;
        }

        if (RecentCL == 0 && CookedBuildPath.Contains("[BRANCHNAME]"))
        {
            Log("Unable to copy shared cooked build: Unable to determine BRANCHNAME number from P4 or UGS, and is required by SharedCookedBuildPath");
            return;
        }


        CookedBuildPath = CookedBuildPath.Replace("[CL]", RecentCL.ToString());
        CookedBuildPath = CookedBuildPath.Replace("[BRANCHNAME]", BuildRoot);
        CookedBuildPath = CookedBuildPath.Replace("[PLATFORM]", CookPlatform);

        if (Directory.Exists(CookedBuildPath) == false)
        {
            Log("Unable to copy shared cooked build: Unable to find shared build at location {0} check SharedCookedBuildPath in Engine.ini SharedCookedBuildSettings is correct", CookedBuildPath);
            return;
        }

        Log("Attempting download of latest shared build CL {0} from location {1}", RecentCL, CookedBuildPath);

        if (BuildCL == RecentCL.ToString())
        {
            Log("Already downloaded latest shared build at CL {0}", RecentCL);
            return;
        }
        // delete all the stuff
        Log("Deleting previous shared build because it was out of date");
        CommandUtils.DeleteDirectory(LocalPath);
        Directory.CreateDirectory(LocalPath);


        // find all the files in the staged directory
        string CookedBuildStagedDirectory = Path.GetFullPath(Path.Combine(CookedBuildPath, "Staged"));
        string LocalBuildStagedDirectory  = Path.GetFullPath(Path.Combine(LocalPath, "Staged"));

        if (Directory.Exists(CookedBuildStagedDirectory))
        {
            foreach (string FileName in Directory.EnumerateFiles(CookedBuildStagedDirectory, "*.*", SearchOption.AllDirectories))
            {
                string SourceFileName = Path.GetFullPath(FileName);
                string DestFileName   = SourceFileName.Replace(CookedBuildStagedDirectory, LocalBuildStagedDirectory);
                Directory.CreateDirectory(Path.GetDirectoryName(DestFileName));
                File.Copy(SourceFileName, DestFileName);
            }
        }


        string CookedBuildCookedDirectory = Path.Combine(CookedBuildPath, "Cooked");

        CookedBuildCookedDirectory = Path.GetFullPath(CookedBuildCookedDirectory);
        string LocalBuildCookedDirectory = Path.Combine(LocalPath, "Cooked");

        LocalBuildCookedDirectory = Path.GetFullPath(LocalBuildCookedDirectory);
        if (Directory.Exists(CookedBuildCookedDirectory))
        {
            foreach (string FileName in Directory.EnumerateFiles(CookedBuildCookedDirectory, "*.*", SearchOption.AllDirectories))
            {
                string SourceFileName = Path.GetFullPath(FileName);
                string DestFileName   = SourceFileName.Replace(CookedBuildCookedDirectory, LocalBuildCookedDirectory);
                Directory.CreateDirectory(Path.GetDirectoryName(DestFileName));
                File.Copy(SourceFileName, DestFileName);
            }
        }
        File.WriteAllText(SyncedBuildFile, RecentCL.ToString());
        return;
    }
Пример #32
0
        /// <summary>
        /// Main entry point for the BuildGraph command
        /// </summary>
        public override ExitCode Execute()
        {
            // Parse the command line parameters
            string ScriptFileName        = ParseParamValue("Script", null);
            string TargetNames           = ParseParamValue("Target", null);
            string DocumentationFileName = ParseParamValue("Documentation", null);
            string SchemaFileName        = ParseParamValue("Schema", null);
            string ExportFileName        = ParseParamValue("Export", null);
            string PreprocessedFileName  = ParseParamValue("Preprocess", null);
            string SharedStorageDir      = ParseParamValue("SharedStorageDir", null);
            string SingleNodeName        = ParseParamValue("SingleNode", null);
            string TriggerName           = ParseParamValue("Trigger", null);

            string[] SkipTriggerNames          = ParseParamValue("SkipTrigger", "").Split(new char[] { '+', ';' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
            bool     bSkipTriggers             = ParseParam("SkipTriggers");
            string   TokenSignature            = ParseParamValue("TokenSignature", null);
            bool     bSkipTargetsWithoutTokens = ParseParam("SkipTargetsWithoutTokens");
            bool     bResume               = SingleNodeName != null || ParseParam("Resume");
            bool     bListOnly             = ParseParam("ListOnly");
            bool     bShowDiagnostics      = ParseParam("ShowDiagnostics");
            bool     bWriteToSharedStorage = ParseParam("WriteToSharedStorage") || CommandUtils.IsBuildMachine;
            bool     bPublicTasksOnly      = ParseParam("PublicTasksOnly");
            string   ReportName            = ParseParamValue("ReportName", null);

            GraphPrintOptions PrintOptions = GraphPrintOptions.ShowCommandLineOptions;

            if (ParseParam("ShowDeps"))
            {
                PrintOptions |= GraphPrintOptions.ShowDependencies;
            }
            if (ParseParam("ShowNotifications"))
            {
                PrintOptions |= GraphPrintOptions.ShowNotifications;
            }

            // Parse any specific nodes to clean
            List <string> CleanNodes = new List <string>();

            foreach (string NodeList in ParseParamValues("CleanNode"))
            {
                foreach (string NodeName in NodeList.Split('+', ';'))
                {
                    CleanNodes.Add(NodeName);
                }
            }

            // Set up the standard properties which build scripts might need
            Dictionary <string, string> DefaultProperties = new Dictionary <string, string>(StringComparer.InvariantCultureIgnoreCase);

            DefaultProperties["Branch"]                 = P4Enabled ? P4Env.Branch : "Unknown";
            DefaultProperties["EscapedBranch"]          = P4Enabled ? CommandUtils.EscapePath(P4Env.Branch) : "Unknown";
            DefaultProperties["Change"]                 = P4Enabled ? P4Env.Changelist.ToString() : "0";
            DefaultProperties["CodeChange"]             = P4Enabled ? P4Env.CodeChangelist.ToString() : "0";
            DefaultProperties["RootDir"]                = CommandUtils.RootDirectory.FullName;
            DefaultProperties["IsBuildMachine"]         = IsBuildMachine ? "true" : "false";
            DefaultProperties["HostPlatform"]           = HostPlatform.Current.HostEditorPlatform.ToString();
            DefaultProperties["RestrictedFolderNames"]  = String.Join(";", FileFilter.RestrictedFolderNames.Select(x => x.DisplayName));
            DefaultProperties["RestrictedFolderFilter"] = String.Join(";", FileFilter.RestrictedFolderNames.Select(x => String.Format(".../{0}/...", x.DisplayName)));

            // Attempt to read existing Build Version information
            BuildVersion Version;

            if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
            {
                DefaultProperties["EngineMajorVersion"]     = Version.MajorVersion.ToString();
                DefaultProperties["EngineMinorVersion"]     = Version.MinorVersion.ToString();
                DefaultProperties["EnginePatchVersion"]     = Version.PatchVersion.ToString();
                DefaultProperties["EngineCompatibleChange"] = Version.CompatibleChangelist.ToString();
            }

            // Add any additional custom arguments from the command line (of the form -Set:X=Y)
            Dictionary <string, string> Arguments = new Dictionary <string, string>(StringComparer.InvariantCultureIgnoreCase);

            foreach (string Param in Params)
            {
                const string Prefix = "set:";
                if (Param.StartsWith(Prefix, StringComparison.InvariantCultureIgnoreCase))
                {
                    int EqualsIdx = Param.IndexOf('=');
                    if (EqualsIdx >= 0)
                    {
                        Arguments[Param.Substring(Prefix.Length, EqualsIdx - Prefix.Length)] = Param.Substring(EqualsIdx + 1);
                    }
                    else
                    {
                        LogWarning("Missing value for '{0}'", Param.Substring(Prefix.Length));
                    }
                }
            }

            // Find all the tasks from the loaded assemblies
            Dictionary <string, ScriptTask> NameToTask = new Dictionary <string, ScriptTask>();

            if (!FindAvailableTasks(NameToTask, bPublicTasksOnly))
            {
                return(ExitCode.Error_Unknown);
            }

            // Generate documentation
            if (DocumentationFileName != null)
            {
                GenerateDocumentation(NameToTask, new FileReference(DocumentationFileName));
                return(ExitCode.Success);
            }

            // Create a schema for the given tasks
            ScriptSchema Schema = new ScriptSchema(NameToTask);

            if (SchemaFileName != null)
            {
                FileReference FullSchemaFileName = new FileReference(SchemaFileName);
                Log("Writing schema to {0}...", FullSchemaFileName.FullName);
                Schema.Export(FullSchemaFileName);
                if (ScriptFileName == null)
                {
                    return(ExitCode.Success);
                }
            }

            // Check there was a script specified
            if (ScriptFileName == null)
            {
                LogError("Missing -Script= parameter for BuildGraph");
                return(ExitCode.Error_Unknown);
            }

            // Read the script from disk
            Graph Graph;

            if (!ScriptReader.TryRead(new FileReference(ScriptFileName), Arguments, DefaultProperties, Schema, out Graph))
            {
                return(ExitCode.Error_Unknown);
            }

            // Create the temp storage handler
            DirectoryReference RootDir = new DirectoryReference(CommandUtils.CmdEnv.LocalRoot);
            TempStorage        Storage = new TempStorage(RootDir, DirectoryReference.Combine(RootDir, "Engine", "Saved", "BuildGraph"), (SharedStorageDir == null)? null : new DirectoryReference(SharedStorageDir), bWriteToSharedStorage);

            if (!bResume)
            {
                Storage.CleanLocal();
            }
            foreach (string CleanNode in CleanNodes)
            {
                Storage.CleanLocalNode(CleanNode);
            }

            // Convert the supplied target references into nodes
            HashSet <Node> TargetNodes = new HashSet <Node>();

            if (TargetNames == null)
            {
                if (!bListOnly)
                {
                    LogError("Missing -Target= parameter for BuildGraph");
                    return(ExitCode.Error_Unknown);
                }
                TargetNodes.UnionWith(Graph.Agents.SelectMany(x => x.Nodes));
            }
            else
            {
                foreach (string TargetName in TargetNames.Split(new char[] { '+', ';' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()))
                {
                    Node[] Nodes;
                    if (!Graph.TryResolveReference(TargetName, out Nodes))
                    {
                        LogError("Target '{0}' is not in graph", TargetName);
                        return(ExitCode.Error_Unknown);
                    }
                    TargetNodes.UnionWith(Nodes);
                }
            }

            // Try to acquire tokens for all the target nodes we want to build
            if (TokenSignature != null)
            {
                // Find all the lock files
                HashSet <FileReference> RequiredTokens = new HashSet <FileReference>(TargetNodes.SelectMany(x => x.RequiredTokens));

                // List out all the required tokens
                if (SingleNodeName == null)
                {
                    CommandUtils.Log("Required tokens:");
                    foreach (Node Node in TargetNodes)
                    {
                        foreach (FileReference RequiredToken in Node.RequiredTokens)
                        {
                            CommandUtils.Log("  '{0}' requires {1}", Node, RequiredToken);
                        }
                    }
                }

                // Try to create all the lock files
                List <FileReference> CreatedTokens = new List <FileReference>();
                if (!bListOnly)
                {
                    CreatedTokens.AddRange(RequiredTokens.Where(x => WriteTokenFile(x, TokenSignature)));
                }

                // Find all the tokens that we don't have
                Dictionary <FileReference, string> MissingTokens = new Dictionary <FileReference, string>();
                foreach (FileReference RequiredToken in RequiredTokens)
                {
                    string CurrentOwner = ReadTokenFile(RequiredToken);
                    if (CurrentOwner != null && CurrentOwner != TokenSignature)
                    {
                        MissingTokens.Add(RequiredToken, CurrentOwner);
                    }
                }

                // If we want to skip all the nodes with missing locks, adjust the target nodes to account for it
                if (MissingTokens.Count > 0)
                {
                    if (bSkipTargetsWithoutTokens)
                    {
                        // Find all the nodes we're going to skip
                        HashSet <Node> SkipNodes = new HashSet <Node>();
                        foreach (IGrouping <string, FileReference> MissingTokensForBuild in MissingTokens.GroupBy(x => x.Value, x => x.Key))
                        {
                            Log("Skipping the following nodes due to {0}:", MissingTokensForBuild.Key);
                            foreach (FileReference MissingToken in MissingTokensForBuild)
                            {
                                foreach (Node SkipNode in TargetNodes.Where(x => x.RequiredTokens.Contains(MissingToken) && SkipNodes.Add(x)))
                                {
                                    Log("    {0}", SkipNode);
                                }
                            }
                        }

                        // Write a list of everything left over
                        if (SkipNodes.Count > 0)
                        {
                            TargetNodes.ExceptWith(SkipNodes);
                            Log("Remaining target nodes:");
                            foreach (Node TargetNode in TargetNodes)
                            {
                                Log("    {0}", TargetNode);
                            }
                            if (TargetNodes.Count == 0)
                            {
                                Log("    None.");
                            }
                        }
                    }
                    else
                    {
                        foreach (KeyValuePair <FileReference, string> Pair in MissingTokens)
                        {
                            List <Node> SkipNodes = TargetNodes.Where(x => x.RequiredTokens.Contains(Pair.Key)).ToList();
                            LogError("Cannot run {0} due to previous build: {1}", String.Join(", ", SkipNodes), Pair.Value);
                        }
                        foreach (FileReference CreatedToken in CreatedTokens)
                        {
                            FileReference.Delete(CreatedToken);
                        }
                        return(ExitCode.Error_Unknown);
                    }
                }
            }

            // Cull the graph to include only those nodes
            Graph.Select(TargetNodes);

            // Collapse any triggers in the graph which are marked to be skipped
            HashSet <ManualTrigger> SkipTriggers = new HashSet <ManualTrigger>();

            if (bSkipTriggers)
            {
                SkipTriggers.UnionWith(Graph.NameToTrigger.Values);
            }
            else
            {
                foreach (string SkipTriggerName in SkipTriggerNames)
                {
                    ManualTrigger SkipTrigger;
                    if (!Graph.NameToTrigger.TryGetValue(TriggerName, out SkipTrigger))
                    {
                        LogError("Couldn't find trigger '{0}'", TriggerName);
                        return(ExitCode.Error_Unknown);
                    }
                    SkipTriggers.Add(SkipTrigger);
                }
            }
            Graph.SkipTriggers(SkipTriggers);

            // If a report for the whole build was requested, insert it into the graph
            if (ReportName != null)
            {
                Report NewReport = new Report(ReportName);
                NewReport.Nodes.UnionWith(Graph.Agents.SelectMany(x => x.Nodes));
                Graph.NameToReport.Add(ReportName, NewReport);
            }

            // Write out the preprocessed script
            if (PreprocessedFileName != null)
            {
                FileReference PreprocessedFileLocation = new FileReference(PreprocessedFileName);
                Log("Writing {0}...", PreprocessedFileLocation);
                Graph.Write(PreprocessedFileLocation, (SchemaFileName != null)? new FileReference(SchemaFileName) : null);
                return(ExitCode.Success);
            }

            // Find the triggers which we are explicitly running.
            ManualTrigger Trigger = null;

            if (TriggerName != null && !Graph.NameToTrigger.TryGetValue(TriggerName, out Trigger))
            {
                LogError("Couldn't find trigger '{0}'", TriggerName);
                return(ExitCode.Error_Unknown);
            }

            // If we're just building a single node, find it
            Node SingleNode = null;

            if (SingleNodeName != null && !Graph.NameToNode.TryGetValue(SingleNodeName, out SingleNode))
            {
                LogError("Node '{0}' is not in the trimmed graph", SingleNodeName);
                return(ExitCode.Error_Unknown);
            }

            // If we just want to show the contents of the graph, do so and exit.
            if (bListOnly)
            {
                HashSet <Node> CompletedNodes = FindCompletedNodes(Graph, Storage);
                Graph.Print(CompletedNodes, PrintOptions);
            }

            // Print out all the diagnostic messages which still apply, unless we're running a step as part of a build system or just listing the contents of the file.
            if (SingleNode == null || !bListOnly || bShowDiagnostics)
            {
                IEnumerable <GraphDiagnostic> Diagnostics = Graph.Diagnostics.Where(x => x.EnclosingTrigger == Trigger);
                foreach (GraphDiagnostic Diagnostic in Diagnostics)
                {
                    if (Diagnostic.EventType == LogEventType.Console)
                    {
                        CommandUtils.Log(Diagnostic.Message);
                    }
                    else if (Diagnostic.EventType == LogEventType.Warning)
                    {
                        CommandUtils.LogWarning(Diagnostic.Message);
                    }
                    else
                    {
                        CommandUtils.LogError(Diagnostic.Message);
                    }
                }
                if (Diagnostics.Any(x => x.EventType == LogEventType.Error))
                {
                    return(ExitCode.Error_Unknown);
                }
            }

            // Export the graph to a file
            if (ExportFileName != null)
            {
                HashSet <Node> CompletedNodes = FindCompletedNodes(Graph, Storage);
                Graph.Print(CompletedNodes, PrintOptions);
                Graph.Export(new FileReference(ExportFileName), Trigger, CompletedNodes);
                return(ExitCode.Success);
            }

            // Execute the command
            if (!bListOnly)
            {
                if (SingleNode != null)
                {
                    if (!BuildNode(new JobContext(this), Graph, SingleNode, Storage, bWithBanner: true))
                    {
                        return(ExitCode.Error_Unknown);
                    }
                }
                else
                {
                    if (!BuildAllNodes(new JobContext(this), Graph, Storage))
                    {
                        return(ExitCode.Error_Unknown);
                    }
                }
            }
            return(ExitCode.Success);
        }
Пример #33
0
 public RavenVersionAttribute()
 {
     MajorVersion       = _assemblyVersion.Major;
     MajorVersionAsChar = char.Parse(MajorVersion.ToInvariantString());
     MinorVersion       = _assemblyVersion.Minor;
     PatchVersion       = _assemblyVersion.Build;
     AssemblyVersion    = $"{MajorVersion.ToInvariantString()}.{MinorVersion.ToInvariantString()}.{PatchVersion.ToInvariantString()}.{BuildVersion.ToInvariantString()}";
 }
Пример #34
0
    public UnrealEnginePython(TargetInfo target)
#endif
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
        string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");

        bFasterWithoutUnity = string.IsNullOrEmpty(enableUnityBuild);

        PublicIncludePaths.AddRange(
            new string[] {
            "UnrealEnginePython/Public",
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            "UnrealEnginePython/Private",
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Sockets",
            "Networking"
            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "InputCore",
            "Slate",
            "SlateCore",
            "MovieScene",
            "LevelSequence",
            "HTTP",
            "UMG",
            "AppFramework",
            "RHI",
            "Voice",
            "RenderCore",
            "MovieSceneCapture",
            "Landscape",
            "Foliage",
            "AIModule"
            // ... add private dependencies that you statically link with here ...
        }
            );


#if WITH_FORWARDED_MODULE_RULES_CTOR
        BuildVersion Version;
        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
        {
            if (Version.MinorVersion >= 18)
            {
                PrivateDependencyModuleNames.Add("ApplicationCore");
            }
        }
#endif


        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );

#if WITH_FORWARDED_MODULE_RULES_CTOR
        if (Target.bBuildEditor)
#else
        if (UEBuildConfiguration.bBuildEditor)
#endif
        {
            PrivateDependencyModuleNames.AddRange(new string[] {
                "UnrealEd",
                "LevelEditor",
                "BlueprintGraph",
                "Projects",
                "Sequencer",
                "SequencerWidgets",
                "AssetTools",
                "LevelSequenceEditor",
                "MovieSceneTools",
                "MovieSceneTracks",
                "CinematicCamera",
                "EditorStyle",
                "GraphEditor",
                "UMGEditor",
                "AIGraph",
                "RawMesh",
                "DesktopWidgets",
                "EditorWidgets",
                "FBX",
                "Persona",
                "PropertyEditor",
                "LandscapeEditor",
                "MaterialEditor"
            });
        }

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            if (pythonHome == "")
            {
                pythonHome = DiscoverPythonPath(windowsKnownPaths, "Win64");
                if (pythonHome == "")
                {
                    throw new System.Exception("Unable to find Python installation");
                }
            }
            System.Console.WriteLine("Using Python at: " + pythonHome);
            PublicIncludePaths.Add(pythonHome);
            string libPath = GetWindowsPythonLibFile(pythonHome);
            PublicLibraryPaths.Add(Path.GetDirectoryName(libPath));
            PublicAdditionalLibraries.Add(libPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            if (pythonHome == "")
            {
                pythonHome = DiscoverPythonPath(macKnownPaths, "Mac");
                if (pythonHome == "")
                {
                    throw new System.Exception("Unable to find Python installation");
                }
            }
            System.Console.WriteLine("Using Python at: " + pythonHome);
            PublicIncludePaths.Add(pythonHome);
            string libPath = GetMacPythonLibFile(pythonHome);
            PublicLibraryPaths.Add(Path.GetDirectoryName(libPath));
            PublicDelayLoadDLLs.Add(libPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (pythonHome == "")
            {
                string includesPath = DiscoverLinuxPythonIncludesPath();
                if (includesPath == null)
                {
                    throw new System.Exception("Unable to find Python includes, please add a search path to linuxKnownIncludesPaths");
                }
                string libsPath = DiscoverLinuxPythonLibsPath();
                if (libsPath == null)
                {
                    throw new System.Exception("Unable to find Python libs, please add a search path to linuxKnownLibsPaths");
                }
                PublicIncludePaths.Add(includesPath);
                PublicAdditionalLibraries.Add(libsPath);
            }
            else
            {
                string[] items = pythonHome.Split(';');
                PublicIncludePaths.Add(items[0]);
                PublicAdditionalLibraries.Add(items[1]);
            }
        }
#if WITH_FORWARDED_MODULE_RULES_CTOR
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicDefinitions.Add("UEPY_THREADING");
            System.Console.WriteLine("*** Enabled Python Threads support ***");

            PublicIncludePaths.Add(System.IO.Path.Combine(ModuleDirectory, "../../android/python35/include"));
            PublicLibraryPaths.Add(System.IO.Path.Combine(ModuleDirectory, "../../android/armeabi-v7a"));
            PublicAdditionalLibraries.Add("python3.5m");

            string APLName    = "UnrealEnginePython_APL.xml";
            string RelAPLPath = Utils.MakePathRelativeTo(System.IO.Path.Combine(ModuleDirectory, APLName), Target.RelativeEnginePath);
            AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", RelAPLPath));
        }
#endif
    }
Пример #35
0
	void Awake()
	{
		instance = this;
	}