public void InitUPL(string ProjectName, DirectoryReference ProjectDirectory, UnrealTargetConfiguration Configuration)
        {
            string UE4BuildPath        = Path.Combine(ProjectDirectory.FullName, "Intermediate/Lumin/Mabu");
            string RelativeEnginePath  = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());
            string RelativeProjectPath = ProjectDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());            //.MakeRelativeTo(ProjectDirectory);

            UnrealTargetPlatform Platform = UnrealTargetPlatform.Lumin;
            string ConfigurationString    = Configuration.ToString();

            string        Architecture = "arm64-v8a";
            List <string> MLSDKArches  = new List <string>();

            MLSDKArches.Add(Architecture);

            // get the receipt
            FileReference ReceiptFilename = TargetReceipt.GetDefaultPath(ProjectDirectory, ProjectName, Platform, Configuration, "");

            if (!File.Exists(ReceiptFilename.ToString()))
            {
                ReceiptFilename = TargetReceipt.GetDefaultPath(UnrealBuildTool.EngineDirectory, "UE4Game", Platform, Configuration, "");
            }
            Log.TraceInformation("Receipt Filename: {0}", ReceiptFilename);
            SetLuminPluginData(MLSDKArches, CollectPluginDataPaths(TargetReceipt.Read(ReceiptFilename, UnrealBuildTool.EngineDirectory, ProjectDirectory)));

            //gather all of the xml
            UPL.Init(MLSDKArches, true, RelativeEnginePath, UE4BuildPath, RelativeProjectPath, ConfigurationString);
        }
示例#2
0
        public void InitUPL(TargetReceipt Receipt)
        {
            DirectoryReference ProjectDirectory = Receipt.ProjectDir ?? UnrealBuildTool.EngineDirectory;

            string UE4BuildPath        = Path.Combine(ProjectDirectory.FullName, "Intermediate/Lumin/Mabu");
            string RelativeEnginePath  = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());
            string RelativeProjectPath = ProjectDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());            //.MakeRelativeTo(ProjectDirectory);

            string ConfigurationString = Receipt.Configuration.ToString();

            IconDirectory = Path.Combine(ProjectDirectory.FullName, "Build/Lumin/Resources/");
            IconDirectory = IconDirectory.Replace('\\', '/').Replace("//", "/");

            string        Architecture = "arm64-v8a";
            List <string> MLSDKArches  = new List <string>();

            MLSDKArches.Add(Architecture);

            SetLuminPluginData(MLSDKArches, CollectPluginDataPaths(Receipt));

            bool bIsEmbedded = Receipt.HasValueForAdditionalProperty("CompileAsDll", "true");

            //gather all of the xml
            UPL.Init(MLSDKArches, true, RelativeEnginePath, UE4BuildPath, RelativeProjectPath, ConfigurationString, bIsEmbedded);
        }
 /// <summary>
 /// Resolve an individual wildcard to a set of files
 /// </summary>
 /// <param name="Pattern">The pattern to resolve</param>
 /// <returns>List of files matching the wildcard</returns>
 public static List <FileReference> ResolveWildcard(string Pattern)
 {
     for (int Idx = FindWildcardIndex(Pattern); Idx > 0; Idx--)
     {
         if (Pattern[Idx] == '/' || Pattern[Idx] == '\\')
         {
             return(ResolveWildcard(new DirectoryReference(Pattern.Substring(0, Idx)), Pattern.Substring(Idx + 1)));
         }
     }
     return(ResolveWildcard(DirectoryReference.GetCurrentDirectory(), Pattern));
 }
示例#4
0
        public void InitUPL(TargetReceipt Receipt)
        {
            DirectoryReference ProjectDirectory = Receipt.ProjectDir ?? UnrealBuildTool.EngineDirectory;

            string UE4BuildPath        = Path.Combine(ProjectDirectory.FullName, "Intermediate/Lumin/Mabu");
            string RelativeEnginePath  = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());
            string RelativeProjectPath = ProjectDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());            //.MakeRelativeTo(ProjectDirectory);

            string ConfigurationString = Receipt.Configuration.ToString();

            string        Architecture = "arm64-v8a";
            List <string> MLSDKArches  = new List <string>();

            MLSDKArches.Add(Architecture);

            SetLuminPluginData(MLSDKArches, CollectPluginDataPaths(Receipt));

            //gather all of the xml
            UPL.Init(MLSDKArches, true, RelativeEnginePath, UE4BuildPath, RelativeProjectPath, ConfigurationString);
        }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        public static bool SupportsIconCatalog(UnrealTargetConfiguration Config, DirectoryReference ProjectDirectory, bool bIsUE4Game, string ProjectName)
        {
            // get the receipt
            FileReference ReceiptFilename;

            if (bIsUE4Game)
            {
                ReceiptFilename = TargetReceipt.GetDefaultPath(UnrealBuildTool.EngineDirectory, "UE4Game", UnrealTargetPlatform.IOS, Config, "");
            }
            else
            {
                ReceiptFilename = TargetReceipt.GetDefaultPath(ProjectDirectory, ProjectName, UnrealTargetPlatform.IOS, Config, "");
            }

            string RelativeEnginePath = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());

            if (System.IO.File.Exists(ReceiptFilename.FullName))
            {
                TargetReceipt Receipt = TargetReceipt.Read(ReceiptFilename, UnrealBuildTool.EngineDirectory, ProjectDirectory);
                var           Results = Receipt.AdditionalProperties.Where(x => x.Name == "SDK");

                if (Results.Count() > 0)
                {
                    if (Single.Parse(Results.ElementAt(0).Value) >= 11.0f)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(false);
        }
示例#6
0
        public override bool PrepTargetForDeployment(TargetReceipt Receipt)
        {
            // Use the project name if possible - InTarget.AppName changes for 'Client'/'Server' builds
            string ProjectName = Receipt.ProjectFile != null?Receipt.ProjectFile.GetFileNameWithoutAnyExtensions() : Receipt.Launch.GetFileNameWithoutExtension();

            Log.TraceInformation("Prepping {0} for deployment to {1}", ProjectName, Receipt.Platform.ToString());
            System.DateTime PrepDeployStartTime = DateTime.UtcNow;

            // Note: TargetReceipt.Read now expands path variables internally.
            TargetReceipt NewReceipt      = null;
            FileReference ReceiptFileName = TargetReceipt.GetDefaultPath(Receipt.ProjectDir != null ? Receipt.ProjectDir : UnrealBuildTool.EngineDirectory, Receipt.TargetName, Receipt.Platform, Receipt.Configuration, "Multi");

            if (!TargetReceipt.TryRead(ReceiptFileName, UnrealBuildTool.EngineDirectory, out NewReceipt))
            {
                NewReceipt = new TargetReceipt(Receipt.ProjectFile, Receipt.TargetName, Receipt.TargetType, Receipt.Platform, Receipt.Configuration, Receipt.Version, "Multi");
            }

            AddWinMDReferencesFromReceipt(Receipt, Receipt.ProjectDir != null ? Receipt.ProjectDir : UnrealBuildTool.EngineDirectory, UnrealBuildTool.EngineDirectory.ParentDirectory.FullName);

            //PrepForUATPackageOrDeploy(InTarget.ProjectFile, InAppName, InTarget.ProjectDirectory.FullName, InTarget.OutputPath.FullName, TargetBuildEnvironment.RelativeEnginePath, false, "", false);
            List <UnrealTargetConfiguration> TargetConfigs = new List <UnrealTargetConfiguration> {
                Receipt.Configuration
            };
            List <string> ExePaths = new List <string> {
                Receipt.Launch.FullName
            };
            string RelativeEnginePath = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());

            WindowsArchitecture Arch = WindowsArchitecture.ARM64;

            if (Receipt.Architecture.ToLower() == "x64")
            {
                Arch = WindowsArchitecture.x64;
            }

            string SDK     = "";
            var    Results = Receipt.AdditionalProperties.Where(x => x.Name == "SDK");

            if (Results.Any())
            {
                SDK = Results.First().Value;
            }
            HoloLensExports.InitWindowsSdkToolPath(SDK);

            string AbsoluteExeDirectory         = Path.GetDirectoryName(ExePaths[0]);
            UnrealTargetPlatform Platform       = UnrealTargetPlatform.HoloLens;
            string        IntermediateDirectory = Path.Combine(Receipt.ProjectDir != null ? Receipt.ProjectDir.FullName : UnrealBuildTool.EngineDirectory.FullName, "Intermediate", "Deploy", WindowsExports.GetArchitectureSubpath(Arch));
            List <string> UpdatedFiles          = new HoloLensManifestGenerator().CreateManifest(Platform, Arch, AbsoluteExeDirectory, IntermediateDirectory, Receipt.ProjectFile, Receipt.ProjectDir != null ? Receipt.ProjectDir.FullName : UnrealBuildTool.EngineDirectory.FullName, TargetConfigs, ExePaths, WinMDReferences);

            PrepForUATPackageOrDeploy(Receipt.ProjectFile, ProjectName, Receipt.ProjectDir != null ? Receipt.ProjectDir.FullName : UnrealBuildTool.EngineDirectory.FullName, Arch, TargetConfigs, ExePaths, RelativeEnginePath, false, "", false);
            MakePackage(Receipt, NewReceipt, Arch, UpdatedFiles);
            CopyDataAndSymbolsBetweenReceipts(Receipt, NewReceipt, Arch);

            NewReceipt.Write(ReceiptFileName, UnrealBuildTool.EngineDirectory);

            // Log out the time taken to deploy...
            double PrepDeployDuration = (DateTime.UtcNow - PrepDeployStartTime).TotalSeconds;

            Log.TraceInformation("HoloLens deployment preparation took {0:0.00} seconds", PrepDeployDuration);

            return(true);
        }
示例#7
0
        private bool ExecuteBffFile(string BffFilePath)
        {
            string cacheArgument = "";

            if (bEnableCaching)
            {
                switch (CacheMode)
                {
                case eCacheMode.ReadOnly:
                    cacheArgument = "-cacheread";
                    break;

                case eCacheMode.WriteOnly:
                    cacheArgument = "-cachewrite";
                    break;

                case eCacheMode.ReadWrite:
                    cacheArgument = "-cache";
                    break;
                }
            }

            string distArgument = bEnableDistribution ? "-dist" : "";

            //Interesting flags for FASTBuild: -nostoponerror, -verbose, -monitor (if FASTBuild Monitor Visual Studio Extension is installed!)
            // Yassine: The -clean is to bypass the FastBuild internal dependencies checks (cached in the fdb) as it could create some conflicts with UBT.
            //			Basically we want FB to stupidly compile what UBT tells it to.
            string FBCommandLine = string.Format("-fastcancel -clean -monitor -summary {0} {1} -ide -config {2}", distArgument, cacheArgument, BffFilePath);

            ProcessStartInfo FBStartInfo = new ProcessStartInfo(FBuildExePath(), FBCommandLine);

            FBStartInfo.UseShellExecute  = false;
            FBStartInfo.WorkingDirectory = Path.Combine(UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory()), "Source");

            try
            {
                Process FBProcess = new Process();
                FBProcess.StartInfo = FBStartInfo;

                FBStartInfo.RedirectStandardError  = true;
                FBStartInfo.RedirectStandardOutput = true;
                FBProcess.EnableRaisingEvents      = true;

                DataReceivedEventHandler OutputEventHandler = (Sender, Args) =>
                {
                    if (Args.Data != null)
                    {
                        Console.WriteLine(Args.Data);
                    }
                };

                FBProcess.OutputDataReceived += OutputEventHandler;
                FBProcess.ErrorDataReceived  += OutputEventHandler;

                FBProcess.Start();

                FBProcess.BeginOutputReadLine();
                FBProcess.BeginErrorReadLine();

                FBProcess.WaitForExit();

                return(FBProcess.ExitCode == 0);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception launching fbuild process. Is it in your path?" + e.ToString());
                return(false);
            }
        }
示例#8
0
        public override bool PrepTargetForDeployment(UEBuildDeployTarget InTarget)
        {
            if ((InTarget.TargetType != TargetType.Editor && InTarget.TargetType != TargetType.Program) && (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win32 || BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64))
            {
                string InAppName = InTarget.AppName;
                Log.TraceInformation("Prepping {0} for deployment to {1}", InAppName, InTarget.Platform.ToString());
                System.DateTime PrepDeployStartTime = DateTime.UtcNow;

                List <UnrealTargetConfiguration> TargetConfigs = new List <UnrealTargetConfiguration> {
                    InTarget.Configuration
                };
                List <string> ExePaths = new List <string> {
                    InTarget.OutputPath.FullName
                };
                string RelativeEnginePath = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());
                PrepForUATPackageOrDeploy(InTarget.ProjectFile, InAppName, InTarget.ProjectDirectory.FullName, TargetConfigs, ExePaths, RelativeEnginePath);
            }
            return(true);
        }
示例#9
0
        public override bool PrepTargetForDeployment(UEBuildDeployTarget InTarget)
        {
            if ((InTarget.TargetType != TargetType.Editor && InTarget.TargetType != TargetType.Program) && (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win32 || BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64))
            {
                string InAppName = InTarget.AppName;
                if (InTarget.bUseIncrementalLinking)
                {
                    Log.TraceInformation("Skipping icon update for {0} due to incremental linking being enabled.", InAppName);
                }
                else
                {
                    Log.TraceInformation("Prepping {0} for deployment to {1}", InAppName, InTarget.Platform.ToString());
                    System.DateTime PrepDeployStartTime = DateTime.UtcNow;

                    List <UnrealTargetConfiguration> TargetConfigs = new List <UnrealTargetConfiguration> {
                        InTarget.Configuration
                    };
                    List <string> ExePaths = new List <string> {
                        InTarget.OutputPath.FullName
                    };
                    string RelativeEnginePath = UnrealBuildTool.EngineDirectory.MakeRelativeTo(DirectoryReference.GetCurrentDirectory());
                    SetApplicationIcon(InTarget.ProjectFile, InAppName, InTarget.ProjectDirectory.FullName, TargetConfigs, ExePaths, RelativeEnginePath);
                }
            }
            return(true);
        }