Beispiel #1
0
        /// <summary>
        ///		Builds the game using Volt Builder's <see cref="GameBuilder.BuildGame"/>
        /// </summary>
        public static void StartVoltBuilder()
        {
            Debug.Log("Build game started...");
            System.Console.WriteLine("Build game started...");

            ParseCommandLineArguments(out Dictionary <string, string> arguments);

            if (!arguments.ContainsKey("buildTarget"))
            {
                EditorApplication.Exit(-1);
            }

            bool currentZipBuild = false;

            if (SettingsManager.Instance.ContainsKey <bool>(ZipBuildKey))
            {
                currentZipBuild = SettingsManager.Instance.Get <bool>(ZipBuildKey);
            }
            SettingsManager.Instance.Set(ZipBuildKey, true);

            BuildTarget target   = (BuildTarget)Enum.Parse(typeof(BuildTarget), arguments["buildTarget"]);
            string      buildDir = $"{GameBuilder.GetBuildDirectory()}{target}-DevOpsBuild/{PlayerSettings.productName}";

            System.Console.WriteLine($"Building TC for {target} platform to {buildDir}");

            GameBuildOptions options = new GameBuildOptions(buildDir, target, BuildActions.GetBuildActions());

            AddressablesBuilder.BuildAddressables();
            GameBuilder.BuildGame(options);

            SettingsManager.Instance.Set(ZipBuildKey, currentZipBuild);
        }
Beispiel #2
0
 private InstallationComponent RemoveExistingBuilds()
 {
     return(new InstallationComponent("Removing any existing builds",
                                      OtherActions.DoNothing(),
                                      BuildActions.DeleteAllBuilds(),
                                      OtherActions.DoNothing()));
 }
Beispiel #3
0
        public bool Build(Project project, bool runOutput)
        {
            ipcName = Globals.MainForm.ProcessArgString("$(BuildIPC)");

            string compiler = null;

            if (project.NoOutput)
            {
                // get the compiler for as3 projects, or else the FDBuildCommand pre/post command in FDBuild will fail on "No Output" projects
                if (project.Language == "as3")
                {
                    compiler = ProjectManager.Actions.BuildActions.GetCompilerPath(project);
                }

                if (project.PreBuildEvent.Trim().Length == 0 && project.PostBuildEvent.Trim().Length == 0)
                {
                    // no output and no build commands
                    if (project is AS2Project || project is AS3Project)
                    {
                        //RunFlashIDE(runOutput);
                        //ErrorManager.ShowInfo(TextHelper.GetString("ProjectManager.Info.NoOutputAndNoBuild"));
                    }
                    else
                    {
                        //ErrorManager.ShowInfo("Info.InvalidProject");
                        ErrorManager.ShowInfo(TextHelper.GetString("ProjectManager.Info.NoOutputAndNoBuild"));
                    }
                    return(false);
                }
            }
            else
            {
                // Ask the project to validate itself
                string error;
                project.ValidateBuild(out error);

                if (error != null)
                {
                    ErrorManager.ShowInfo(TextHelper.GetString(error));
                    return(false);
                }

                // 出力先が空だったとき
                if (project.OutputPath.Length < 1)
                {
                    ErrorManager.ShowInfo(TextHelper.GetString("ProjectManager.Info.SpecifyValidOutputSWF"));
                    return(false);
                }

                compiler = BuildActions.GetCompilerPath(project);
                if (compiler == null || (!Directory.Exists(compiler) && !File.Exists(compiler)))
                {
                    string info = TextHelper.GetString("ProjectManager.Info.InvalidCustomCompiler");
                    MessageBox.Show(info, TextHelper.GetString("ProjectManager.Title.ConfigurationRequired"), MessageBoxButtons.OK);
                    return(false);
                }
            }

            return(FDBuild(project, runOutput, compiler));
        }
Beispiel #4
0
        public GlobalJsonResult <Build> UpdateBuild([FromBody] UpdateBuildRequest request)
        {
            var build = request.Map();

            dataAccessDispatcher.Dispatch(BuildActions.UpdateBuild(build));

            return(GlobalJsonResult <Build> .Success(System.Net.HttpStatusCode.OK, build));
        }
Beispiel #5
0
        public void AddBuildAction(BuildAction action)
        {
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            BuildActions.Enqueue(action);
        }
        public void OnGUI()
        {
            //Main title
            EditorGUILayout.Space(2f);
            EditorGUILayout.LabelField("Volt Unity Builder", GUIStyles.TitleStyle);
            EditorGUILayout.Space(15f);

            BuildSettings.DrawOptions();
            BuildActions.DrawOptions();
            GameBuilder.DrawOptions();
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var actions = new BuildActions();

            var array = (JArray)JContainer.ReadFrom(reader);

            foreach (JProperty item in array.Where(x => x.HasValues && x.First != null).Select(x => x.First))
            {
                actions[item.Name] = serializer.Deserialize(item.Value.CreateReader());
            }

            return actions;
        }
Beispiel #8
0
        private static string GetActionName(BuildActions buildAction)
        {
            switch (buildAction)
            {
            case BuildActions.BuildActionRebuildAll:
                return(Resources.BuildActionRebuildAll);

            case BuildActions.BuildActionBuild:
                return(Resources.BuildActionBuild);

            case BuildActions.BuildActionClean:
                return(Resources.BuildActionClean);

            default:
                throw new ArgumentOutOfRangeException(nameof(buildAction));
            }
        }
Beispiel #9
0
        private static string GetBuildActionResourceKey(BuildActions buildAction)
        {
            switch (buildAction)
            {
            case BuildActions.BuildActionBuild:
                return("Build");

            case BuildActions.BuildActionRebuildAll:
                return("Rebuild");

            case BuildActions.BuildActionClean:
                return("Clean");

            case BuildActions.BuildActionDeploy:
                throw new InvalidOperationException();

            default:
                throw new ArgumentOutOfRangeException(nameof(buildAction));
            }
        }
Beispiel #10
0
        public BuildEventDialog(Project project)
        {
            InitializeComponent();
            InitializeLocalization();
            this.FormGuid = "ada69d37-2ec0-4484-b113-72bfeab2f239";
            this.Font     = PluginCore.PluginBase.Settings.DefaultFont;

            this.project = project;
            this.vars    = new BuildEventVars(project);

            // this operation requires a message to ASCompletion so we don't add it to the BuildEventVars
            string path = BuildActions.GetCompilerPath(project);

            if (File.Exists(path))
            {
                path = Path.GetDirectoryName(path);
            }
            vars.AddVar("CompilerPath", path);

            foreach (BuildEventInfo info in vars.GetVars())
            {
                Add(info);
            }
        }
Beispiel #11
0
 /// <summary>
 /// Adds a method to use to build the object.
 /// </summary>
 /// <param name="action">The action.</param>
 public IFixtureBuilder <TFixture> AddMethod(Modify <TFixture> action)
 {
     BuildActions.Add(action);
     return(this);
 }
Beispiel #12
0
 private void Awake()
 {
     active = this;
 }
Beispiel #13
0
        public void Initialize()
        {
            MainFormRef = MainForm;             // Mika: added

            Icons.Initialize(MainForm);
            Settings.Initialize(MainForm);
            PluginData.Load();

            showProjectClasspaths = Settings.ShowProjectClasspaths;
            showGlobalClasspaths  = Settings.ShowGlobalClasspaths;

            MainForm.IgnoredKeys.Add(Keys.F5);
            MainForm.IgnoredKeys.Add(Keys.F8);

            #region Actions and Event Listeners

            menus                                 = new FDMenus(MainForm);
            menus.View.Click                     += new EventHandler(OpenPanel);
            menus.GlobalClasspaths.Click         += new EventHandler(OpenGlobalClasspaths);
            menus.ProjectMenu.NewProject.Click   += new EventHandler(NewProject);
            menus.ProjectMenu.OpenProject.Click  += new EventHandler(OpenProject);
            menus.ProjectMenu.CloseProject.Click += new EventHandler(CloseProject);
            menus.ProjectMenu.TestMovie.Click    += new EventHandler(TestMovie);
            menus.ProjectMenu.BuildProject.Click += new EventHandler(BuildProject);
            menus.ProjectMenu.Properties.Click   += new EventHandler(OpenProjectProperties);
            menus.RecentComboBox.RequestProject  += new ProjectRequestHandler(GetProject);
            menus.RecentComboBox.OpenProject     += new ProjectOpenHandler(OpenProjectSilent);

            buildActions = new BuildActions(MainForm);
            buildActions.BuildComplete     += new BuildCompleteHandler(BuildComplete);
            buildActions.ClasspathsChanged += new EventHandler(ProjectClasspathsChanged);

            flashDevelopActions = new FlashDevelopActions(MainForm);

            fileActions              = new FileActions(pluginUI);
            fileActions.OpenFile    += new FileNameHandler(OpenFile);
            fileActions.FileDeleted += new FileNameHandler(FileDeleted);
            fileActions.FileMoved   += new FileMovedHandler(FileMoved);

            projectActions = new ProjectActions(pluginUI);

            // create our UI surface and a docking panel for it
            pluginUI                             = new PluginUI(this, menus, fileActions, projectActions);
            pluginUI.NewProject                 += new EventHandler(NewProject);
            pluginUI.OpenProject                += new EventHandler(OpenProject);
            pluginUI.Rename                     += new RenameEventHandler(fileActions.Rename);
            pluginUI.Tree.MovePath              += new DragPathEventHandler(fileActions.Move);
            pluginUI.Tree.CopyPath              += new DragPathEventHandler(fileActions.Copy);
            pluginUI.Menu.Open.Click            += new EventHandler(TreeOpenItems);
            pluginUI.Menu.Execute.Click         += new EventHandler(TreeExecuteItems);
            pluginUI.Menu.Insert.Click          += new EventHandler(TreeInsertItem);
            pluginUI.Menu.AddLibrary.Click      += new EventHandler(TreeAddLibraryItems);
            pluginUI.Menu.AlwaysCompile.Click   += new EventHandler(TreeAlwaysCompileItems);
            pluginUI.Menu.Cut.Click             += new EventHandler(TreeCutItems);
            pluginUI.Menu.Copy.Click            += new EventHandler(TreeCopyItems);
            pluginUI.Menu.Paste.Click           += new EventHandler(TreePasteItems);
            pluginUI.Menu.Delete.Click          += new EventHandler(TreeDeleteItems);
            pluginUI.Menu.LibraryOptions.Click  += new EventHandler(TreeLibraryOptions);
            pluginUI.Menu.Hide.Click            += new EventHandler(TreeHideItems);
            pluginUI.Menu.ShowHidden.Click      += new EventHandler(ToggleShowHidden);
            pluginUI.Menu.AddNewClass.Click     += new EventHandler(TreeAddNewClass);
            pluginUI.Menu.AddNewXml.Click       += new EventHandler(TreeAddXml);
            pluginUI.Menu.AddNewFile.Click      += new EventHandler(TreeAddFile);
            pluginUI.Menu.AddNewFolder.Click    += new EventHandler(TreeAddFolder);
            pluginUI.Menu.AddLibraryAsset.Click += new EventHandler(TreeAddAsset);
            pluginUI.Menu.AddExistingFile.Click += new EventHandler(TreeAddExistingFile);
            pluginUI.TreeBar.Refresh.Click      += new EventHandler(TreeRefreshNode);

            menus.RecentComboBox.Rebuild();

            #endregion

            pluginPanel = MainForm.CreateDockingPanel(pluginUI, Guid,
                                                      Icons.Project.Img, DockState.DockRight);

            // try to open the last opened project
            string lastProject = Settings.LastProject;

            if (Settings.LastProject != "" && File.Exists(Settings.LastProject))
            {
                OpenProjectSilent(lastProject);
                // if we open the last project right away, we need to give ASCompletion
                // some time before we can trust that it received our classpaths ok
                startupTimer          = new Timer();
                startupTimer.Tick    += new EventHandler(ProjectClasspathsChanged);
                startupTimer.Interval = 1000;
                startupTimer.Start();
            }
            else
            {
                Project = null;
            }

            try
            {
                ProjectIcon.Associate();                 // make sure .fdp points to this instance of FD
            }
            catch (UnauthorizedAccessException)
            {
                // silent
            }
            catch (Exception)
            {
                // silent?
            }
        }
Beispiel #14
0
        static bool BuildCodeSnippetsTxt(string SamplesDir, BuildActions Actions)
        {
            if ((Actions & BuildActions.Clean) != 0)
            {
                APISnippets.CleanAllFiles();
            }
            if ((Actions & BuildActions.Build) == 0)
            {
                return true;
            }

            //We should be able to trim this down further.
            DirectoryInfo Dir = new DirectoryInfo(SamplesDir);
            List<string> Files = new List<string>();
            foreach (string FileName in Directory.GetFiles(SamplesDir, "*.cpp", SearchOption.AllDirectories))
            {
                if (!FileName.EndsWith(".generated.cpp"))
                {
                    Files.Add(FileName);
                }
            }
            foreach (string FileName in Directory.GetFiles(SamplesDir, "*.h", SearchOption.AllDirectories))
            {
                if (!FileName.EndsWith(".generated.h"))
                {
                    Files.Add(FileName);
                }
            }

            //Do the harvesting work.
            {
                const string OpeningTag = "///CODE_SNIPPET_START:";
                const string ClosingTag = "///CODE_SNIPPET_END";
                APISnippets Snippets = new APISnippets();
                List<string> CurrentSnippetPageNames = new List<string>(4);		//Probably won't have a snippet that is shared by more than four different pages.
                string CurrentLine;
                char[] WhiteSpace = {' ', '\t'};		//Doubles as our token delimiter in one place - noted in comments.
                bool IsSnippetBeingProcessed = false;
                bool WasPreviousLineBlank = false;		//Two blank lines in a row will end a code block. Don't allow this to happen in a single snippet.

                foreach (string FileName in Files)
                {
                    // Read the file and display it line by line.
                    System.IO.StreamReader file = new System.IO.StreamReader(FileName);
                    while ((CurrentLine = file.ReadLine()) != null)
                    {
                        CurrentLine = CurrentLine.TrimStart(WhiteSpace);
                        if (!CurrentLine.StartsWith(OpeningTag))
                        {
                            continue;
                        }
                        CurrentSnippetPageNames = CurrentLine.Split(WhiteSpace).ToList<string>();		//Whitespace is used to delimit our API/snippet page names here.
                        CurrentSnippetPageNames.RemoveAt(0);											//Remove the opening tag, which is always in position 0 after empties have been cleared out.
                        CurrentSnippetPageNames.RemoveAll(entry => (entry.Length < 1));					//Blank entries can show up in the list. Remove them.
                        if (CurrentSnippetPageNames.Count < 1)
                        {
                            Console.WriteLine("Warning: OpeningTag for snippet harvesting found without any API pages specified.");
                            continue;
                        }

                        IsSnippetBeingProcessed = true;
                        foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
                        {
                            Snippets.AddSnippet(CurrentSnippetPageName);
                        }
                        while ((CurrentLine = file.ReadLine()) != null)
                        {
                            string TrimmedLine = CurrentLine.TrimStart(WhiteSpace);		//This is actually a C# same-line whitespace check, not our token delimiters.
                            if (TrimmedLine.StartsWith(OpeningTag))
                            {
                                //Snippets do not currently support overlapping. If they did, closing tags should be explicit about which entries are ending, and we'd need to skip lines with opening tags.
                                Console.WriteLine("Error: Nested OpeningTag found! This is not supported. Snippet harvesting process will fail.");
                                return false;
                            }
                            else if (TrimmedLine.StartsWith(ClosingTag))
                            {
                                //We're done with this snippet now. Mark that we can end cleanly.
                                IsSnippetBeingProcessed = false;
                                break;
                            }
                            if (CurrentLine.Trim().Length < 1)
                            {
                                if (WasPreviousLineBlank)
                                {
                                    //Two (or more) blank lines in a row! Not permitted.
                                    continue;
                                }
                                else
                                {
                                    WasPreviousLineBlank = true;
                                }
                            }
                            else
                            {
                                WasPreviousLineBlank = false;
                            }

                            //This line should be added to the snippet(s) named in the "CODE_SNIPPET_START" line. Capture it. We need to add our own newline.
                            foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
                            {
                                if (!Snippets.AddSnippetText(CurrentSnippetPageName, CurrentLine + Environment.NewLine))
                                {
                                    Console.WriteLine("Error adding text to snippet for " + CurrentSnippetPageName);
                                    return false;
                                }
                            }
                        }
                    }
                    //If we hit the end of the file while harvesting a snippet, we should fail or have a warning. We could also just ignore the failure to end cleanly and just store the text as-is.
                    //Opting for outright failure at the moment so that these errors don't go unnoticed.
                    if (IsSnippetBeingProcessed)
                    {
                        Console.WriteLine("Code snippet start tag not matched with code snippet end tag in " + FileName);
                        return false;
                    }
                    file.Close();
                }

                if (!Snippets.WriteSnippetsToFiles())
                {
                    Console.WriteLine("Error writing intermediate snippet files.");
                    return false;
                }
            }
            //Completed without error.
            return true;
        }
Beispiel #15
0
		static bool BuildCodeUdn(string EngineDir, string XmlDir, string UdnDir, string SitemapDir, string MetadataPath, string ArchivePath, string SitemapArchivePath, List<string> Filters, BuildActions Actions)
		{
			string ApiDir = Path.Combine(UdnDir, "API");
			if((Actions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", ApiDir);
				Utility.SafeDeleteDirectoryContents(ApiDir, true);
				Utility.SafeDeleteDirectoryContents(SitemapDir, true);
			}
			if ((Actions & BuildActions.Build) != 0)
			{
				Directory.CreateDirectory(ApiDir);
				Directory.CreateDirectory(SitemapDir);

				// Read the metadata
				MetadataLookup.Load(MetadataPath);

				// Read the list of modules
				List<string> InputModules = new List<string>(File.ReadAllLines(Path.Combine(XmlDir, "modules.txt")));

				// Build the doxygen modules
				List<DoxygenModule> Modules = new List<DoxygenModule>();
				foreach (string InputModule in InputModules)
				{
					Modules.Add(new DoxygenModule(Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(InputModule)), Path.GetDirectoryName(InputModule)));
				}

				// Find all the entities
				if (!bIndexOnly)
				{
					Console.WriteLine("Reading Doxygen output...");

					// Read the engine module and split it into smaller modules
					DoxygenModule RootModule = DoxygenModule.Read("UE4", EngineDir, Path.Combine(XmlDir, "xml"));
					foreach (DoxygenEntity Entity in RootModule.Entities)
					{
						DoxygenModule Module = Modules.Find(x => Entity.File.StartsWith(x.BaseSrcDir));
						Entity.Module = Module;
						Module.Entities.Add(Entity);
					}

					// Now filter all the entities in each module
					if (Filters != null && Filters.Count > 0)
					{
						FilterEntities(Modules, Filters);
					}

					// Remove all the empty modules
					Modules.RemoveAll(x => x.Entities.Count == 0);
				}

				// Create the index page, and all the pages below it
				APIIndex Index = new APIIndex(Modules);

				// Build a list of pages to output
				List<APIPage> OutputPages = new List<APIPage>(Index.GatherPages().OrderBy(x => x.LinkPath));

				// Remove any pages that don't want to be written
				int NumRemoved = OutputPages.RemoveAll(x => !x.ShouldOutputPage());
				Console.WriteLine("Removed {0} pages", NumRemoved);

				// Dump the output stats
				string StatsPath = Path.Combine(SitemapDir, "Stats.txt");
				Console.WriteLine("Writing stats to '" + StatsPath + "'");
				Stats NewStats = new Stats(OutputPages.OfType<APIMember>());
				NewStats.Write(StatsPath);

				// Setup the output directory 
				Utility.SafeCreateDirectory(UdnDir);

				// Build the manifest
				Console.WriteLine("Writing manifest...");
				UdnManifest Manifest = new UdnManifest(Index);
				Manifest.PrintConflicts();
				Manifest.Write(Path.Combine(UdnDir, APIFolder + "\\API.manifest"));

				// Write all the pages
				using (Tracker UdnTracker = new Tracker("Writing UDN pages...", OutputPages.Count))
				{
					foreach (int Idx in UdnTracker.Indices)
					{
						APIPage Page = OutputPages[Idx];

						// Create the output directory
						string MemberDirectory = Path.Combine(UdnDir, Page.LinkPath);
						if (!Directory.Exists(MemberDirectory))
						{
							Directory.CreateDirectory(MemberDirectory);
						}

						// Write the page
						Page.WritePage(Manifest, Path.Combine(MemberDirectory, "index.INT.udn"));
					}
				}

				// Write the sitemap contents
				Console.WriteLine("Writing sitemap contents...");
				Index.WriteSitemapContents(Path.Combine(SitemapDir, "API.hhc"));

				// Write the sitemap index
				Console.WriteLine("Writing sitemap index...");
				Index.WriteSitemapIndex(Path.Combine(SitemapDir, "API.hhk"));
			}
			if ((Actions & BuildActions.Archive) != 0)
			{
				Console.WriteLine("Creating archive '{0}'", ArchivePath);
				Utility.CreateTgzFromDir(ArchivePath, ApiDir);

				Console.WriteLine("Creating archive '{0}'", SitemapArchivePath);
				Utility.CreateTgzFromDir(SitemapArchivePath, SitemapDir);
			}
			return true;
		}
Beispiel #16
0
		static bool BuildCodeTargetInfo(string TargetInfoPath, string EngineDir, string ArchivePath, BuildActions Actions)
		{
			if ((Actions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", TargetInfoPath);
				Utility.SafeDeleteFile(TargetInfoPath);
			}
			if ((Actions & BuildActions.Build) != 0)
			{
				Console.WriteLine("Building target info...");
				Utility.SafeCreateDirectory(Path.GetDirectoryName(TargetInfoPath));

				string Arguments = String.Format("DocumentationEditor Win64 Debug -ignorejunk -noxge -project=\"{0}\"", Path.Combine(EngineDir, "Documentation\\Extras\\API\\Build\\Documentation.uproject"));
				if (!RunUnrealBuildTool(EngineDir, Arguments + " -clean"))
				{
					return false;
				}
				foreach (FileInfo Info in new DirectoryInfo(Path.Combine(EngineDir, "Intermediate\\Build")).EnumerateFiles("UBTEXport*.xml"))
				{
					File.Delete(Info.FullName);
				}
				if (!RunUnrealBuildTool(EngineDir, Arguments + " -disableunity -xgeexport"))
				{
					return false;
				}
				// Handle different versions of DocumentationEditor on the build system.
				if (File.Exists(Path.Combine(EngineDir, "Intermediate\\Build\\UBTExport.0.xge.xml")))
				{
					File.Copy(Path.Combine(EngineDir, "Intermediate\\Build\\UBTExport.0.xge.xml"), TargetInfoPath, true);
				}
				else if (File.Exists(Path.Combine(EngineDir, "Intermediate\\Build\\UBTExport.000.xge.xml")))
				{
					File.Copy(Path.Combine(EngineDir, "Intermediate\\Build\\UBTExport.000.xge.xml"), TargetInfoPath, true);
				}
				else
				{
					Console.WriteLine("Failed to find either UBTExport.0.xge.xml or UBTExport.000.xge.xml under %s", Path.Combine(EngineDir, "Intermediate\\Build\\"));
					return false;
				}
			}
			if ((Actions & BuildActions.Archive) != 0)
			{
				Console.WriteLine("Creating archive '{0}'", ArchivePath);
				Utility.CreateTgzFromDir(ArchivePath, Path.GetDirectoryName(TargetInfoPath));
			}
			return true;
		}
Beispiel #17
0
		static bool BuildHtml(string EngineDir, string DocToolPath, string HtmlDir, string HtmlSuffix, string ArchivePath, BuildActions Actions)
		{
			string HtmlSubDir = Path.Combine(HtmlDir, "INT", HtmlSuffix);
			if((Actions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", HtmlSubDir);
				Utility.SafeDeleteDirectoryContents(HtmlSubDir, true);
			}
			if ((Actions & BuildActions.Build) != 0)
			{
				Utility.SafeCreateDirectory(HtmlSubDir);

				using (Process DocToolProcess = new Process())
				{
					DocToolProcess.StartInfo.WorkingDirectory = EngineDir;
					DocToolProcess.StartInfo.FileName = DocToolPath;
					DocToolProcess.StartInfo.Arguments = Path.Combine(HtmlSuffix, "*") + " -lang=INT -t=DefaultAPI.html -v=warn";
					DocToolProcess.StartInfo.UseShellExecute = false;
					DocToolProcess.StartInfo.RedirectStandardOutput = true;
					DocToolProcess.StartInfo.RedirectStandardError = true;

					DocToolProcess.OutputDataReceived += new DataReceivedEventHandler(ProcessOutputReceived);
					DocToolProcess.ErrorDataReceived += new DataReceivedEventHandler(ProcessOutputReceived);

					try
					{
						DocToolProcess.Start();
						DocToolProcess.BeginOutputReadLine();
						DocToolProcess.BeginErrorReadLine();
						DocToolProcess.WaitForExit();
					}
					catch (Exception Ex)
					{
						Console.WriteLine(Ex.ToString() + "\n" + Ex.StackTrace);
						return false;
					}

					if (DocToolProcess.ExitCode != 0)
					{
						return false;
					}
				}
			}
			if ((Actions & BuildActions.Archive) != 0)
			{
				Console.WriteLine("Creating archive '{0}'", ArchivePath);

				List<string> InputFiles = new List<string>();
				Utility.FindFilesForTar(HtmlDir, "Include", InputFiles, true);
				Utility.FindFilesForTar(HtmlDir, "INT\\" + HtmlSuffix, InputFiles, true);
				Utility.FindFilesForTar(HtmlDir, "Images", InputFiles, false);

				Utility.CreateTgzFromFiles(ArchivePath, HtmlDir, InputFiles);
			}
			return true;
		}
Beispiel #18
0
        public GlobalJsonResult <IEnumerable <Build> > GetBuilds()
        {
            var result = dataAccessDispatcher.Dispatch(BuildActions.GetAllBuilds());

            return(GlobalJsonResult <IEnumerable <Build> > .Success(System.Net.HttpStatusCode.OK, result));
        }
Beispiel #19
0
        public GlobalJsonResult <Build> GetBuild(string id)
        {
            var result = dataAccessDispatcher.Dispatch(BuildActions.GetBuild(id));

            return(GlobalJsonResult <Build> .Success(System.Net.HttpStatusCode.OK, result));
        }
Beispiel #20
0
 /*
  * /// <summary>
  * /// Tworzy instancję obiektu
  * /// </summary>
  * public ProjectItem()
  * {
  * }
  *
  * Przykłady użycia
  *
  * implement INotifyPropertyChanged
  * implement INotifyPropertyChanged_Passive
  * implement ToString ##Name## ##SubItems## ##BuildAction##
  * implement ToString Name=##Name##, SubItems=##SubItems##, BuildAction=##BuildAction##
  * implement equals Name, SubItems, BuildAction
  * implement equals *
  * implement equals *, ~exclude1, ~exclude2
  */
 #region Constructors
 /// <summary>
 /// Tworzy instancję obiektu
 /// <param name="Name"></param>
 /// <param name="BuildAction"></param>
 /// </summary>
 public ProjectItem(string Name, BuildActions BuildAction)
 {
     this.Name        = Name;
     this.BuildAction = BuildAction;
 }
Beispiel #21
0
        public static void BuildGame(string buildDir, BuildTarget buildTarget, bool headLessBuild, bool devBuild = false, bool autoConnectProfiler = false,
                                     bool deepProfiling = false, bool scriptDebugging = false, bool copyPdbFiles = false, bool scriptsOnly = false)
        {
            Debug.Log($"Starting game build at {DateTime.Now:G}...");
            Stopwatch stopwatch = Stopwatch.StartNew();

            if (buildTarget == BuildTarget.StandaloneWindows || buildTarget == BuildTarget.StandaloneWindows64)
            {
                buildDir += ".exe";
            }

            Debug.Log($"Building to '{buildDir}'...");

            //Set target group
            #region Target Group

            BuildTargetGroup targetGroup;
            switch (buildTarget)
            {
            case BuildTarget.StandaloneLinux64:
            case BuildTarget.StandaloneWindows64:
            case BuildTarget.StandaloneOSX:
            case BuildTarget.StandaloneWindows:
                targetGroup = BuildTargetGroup.Standalone;
                break;

            case BuildTarget.iOS:
                targetGroup = BuildTargetGroup.iOS;
                break;

            case BuildTarget.Android:
                targetGroup = BuildTargetGroup.Android;
                break;

            case BuildTarget.WebGL:
                targetGroup = BuildTargetGroup.WebGL;
                break;

            case BuildTarget.WSAPlayer:
                targetGroup = BuildTargetGroup.WSA;
                break;

            case BuildTarget.PS4:
                targetGroup = BuildTargetGroup.PS4;
                break;

            case BuildTarget.XboxOne:
                targetGroup = BuildTargetGroup.XboxOne;
                break;

            case BuildTarget.tvOS:
                targetGroup = BuildTargetGroup.tvOS;
                break;

            case BuildTarget.Switch:
                targetGroup = BuildTargetGroup.Switch;
                break;

            case BuildTarget.Lumin:
                targetGroup = BuildTargetGroup.Lumin;
                break;

            case BuildTarget.Stadia:
                targetGroup = BuildTargetGroup.Stadia;
                break;

            case BuildTarget.CloudRendering:
                targetGroup = BuildTargetGroup.CloudRendering;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            #endregion

            //Setup build options
            BuildOptions options = BuildOptions.None;

            //Server/Headless mode
            if (headLessBuild)
            {
                options |= BuildOptions.EnableHeadlessMode;
            }

            //Copy PDB files
            string existingCopyPdbFilesOptions =
                EditorUserBuildSettings.GetPlatformSettings("Standalone", CopyPdbFilesEditorString);

            if (copyPdbFiles)
            {
                EditorUserBuildSettings.SetPlatformSettings("Standalone", CopyPdbFilesEditorString,
                                                            SettingsManager.CopyPdbFiles ? "true" : "false");
            }

            //Dev build
            if (devBuild)
            {
                options |= BuildOptions.Development;

                if (autoConnectProfiler)
                {
                    options |= BuildOptions.ConnectWithProfiler;
                }

                if (deepProfiling)
                {
                    options |= BuildOptions.EnableDeepProfilingSupport;
                }

                if (scriptDebugging)
                {
                    options |= BuildOptions.AllowDebugging;
                }
            }

            //Scripts only
            if (scriptsOnly)
            {
                options |= BuildOptions.BuildScriptsOnly;
            }

            //Run build action pre-build
            Debug.Log("Running build actions pre build...");
            try
            {
                BuildActions.RunPreActions(Path.GetDirectoryName(buildDir), buildTarget, ref options);
            }
            catch (Exception ex)
            {
                Debug.LogError($"An error occurred while running a build action's pre build! {ex}");
            }

            Debug.Log("Build actions pre build done!");

            Debug.Log("Building player...");

            //Build the player
            BuildReport report = BuildPipeline.BuildPlayer(new BuildPlayerOptions
            {
                locationPathName = buildDir,
                target           = buildTarget,
                options          = options,
                targetGroup      = targetGroup,
                scenes           = EditorBuildSettings.scenes.Select(scene => scene.path).ToArray()
            });

            //Set CopyPDBFiles to it's original setting
            EditorUserBuildSettings.SetPlatformSettings("Standalone", CopyPdbFilesEditorString,
                                                        existingCopyPdbFilesOptions);

            //If the build failed
            if (report.summary.result != BuildResult.Succeeded)
            {
                stopwatch.Stop();
                Debug.LogError($"Build failed for some reason! Completed in {stopwatch.ElapsedMilliseconds / 1000}s.");
                return;
            }

            //Run Build Action post build
            try
            {
                BuildActions.RunPostActions(Path.GetDirectoryName(buildDir), report);
            }
            catch (Exception ex)
            {
                Debug.LogError($"An error occurred while running a build action's post build! {ex}");
            }

            //End
            stopwatch.Stop();
            Debug.Log($"Build done in {stopwatch.ElapsedMilliseconds / 1000}s!");
        }
Beispiel #22
0
    static void InvokeUnitTest(ParsedProject project, PlatformTarget platformTarget, AnyUnitTestSettings settings)
    {
        if (settings == null)
        {
            throw new ArgumentNullException("settings");
        }
        if (project == null)
        {
            throw new ArgumentNullException("project");
        }
        var path = project.ProjectFile;
        var relativeProjectFile = Context.Environment.WorkingDirectory.GetRelativePath(path);

        // parse referenced dependencies. We assume that if you reference a unit-test dll in your project, then that project
        // in fact contains tests. But there are always exceptions, and thus we allow you to exclude projects as well.
        if (ExcludeFromUnitTests.Contains(project.Project.AssemblyName) ||
            ExcludeFromUnitTests.Contains(project.Project.ProjectGuid) ||
            ExcludeFromUnitTests.Contains(relativeProjectFile.ToString()))
        {
            Context.Log.Verbose(string.Format("    Skipping project {0} as it was explicitly excluded from testing.",
                                              relativeProjectFile));
            return;
        }

        Context.Log.Information(string.Format("Searching for tests in {0} with platform {1}",
                                              relativeProjectFile,
                                              platformTarget));

        var binDir  = BuildActions.ComputeProjectBinPath(project);
        var testDir = ComputeProjectUnitTestPath(project);
        var testDll = binDir.CombineWithFilePath(ComputeTargetFile(project));

        if (HasTestFramework(project, NUnit2Reference))
        {
            Context.Log.Verbose(string.Format("    Testing with NUnit 2: {0}.", relativeProjectFile));

            Context.CreateDirectory(testDir);
            Context.NUnit(new[] { testDll }, BuildNUnitSettings(project, settings, testDir));
        }
        else if (HasTestFramework(project, NUnit3Reference))
        {
            Context.Log.Verbose(string.Format("    Testing with NUnit 3: {0}.", relativeProjectFile));

            Context.CreateDirectory(testDir);
            Context.NUnit3(new[] { testDll }, BuildNUnit3Settings(project, settings, testDir));
        }
        else if (HasTestFramework(project, Xunit2Reference))
        {
            Context.Log.Verbose(string.Format("    Testing with XUnit 2: {0}.", relativeProjectFile));

            Context.CreateDirectory(testDir);
            Context.XUnit2(new[] { testDll }, BuildXUnit2Settings(project, settings, testDir));

            var inputFile  = testDir.CombineWithFilePath(project.Project.AssemblyName + ".xunit2.xml");
            var outputFile = testDir.CombineWithFilePath(project.Project.AssemblyName + ".nunit2.xml");
            Context.XmlTransform(Context.File("tools/xunit.runner.console/tools/NUnitXml.xslt"), inputFile, outputFile);
        }
        else if (HasTestFramework(project, Xunit1Reference))
        {
            Context.Log.Verbose(string.Format("    Testing with XUnit 1: {0}.", relativeProjectFile));

            Context.CreateDirectory(testDir);
            var xunitSettings = BuildXUnitSettings(project, settings, testDir);
            var xunitRunner   = new FixedXUnitRunner(Context.FileSystem, Context.Environment, Context.ProcessRunner,
                                                     Context.Tools);
            xunitRunner.Run(testDll, xunitSettings, settings.ForceX86 || project.Platform == PlatformTarget.x86);

            var inputFile  = testDir.CombineWithFilePath(project.Project.AssemblyName + ".xunit.xml");
            var outputFile = testDir.CombineWithFilePath(project.Project.AssemblyName + ".nunit2.xml");
            Context.XmlTransform(Context.File("tools/xunit.runners/tools/NUnitXml.xslt"), inputFile, outputFile);
        }
        else
        {
            Context.Log.Verbose(
                string.Format("    Skipping project {0} as it does not reference a supported unit-testing framework.",
                              relativeProjectFile));
        }
    }
Beispiel #23
0
		static bool BuildBlueprintJson(string JsonDir, string EngineDir, string EditorPath, string ArchivePath, bool bBuildMachine, BuildActions Actions)
		{
			if((Actions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", JsonDir);
				Utility.SafeDeleteDirectoryContents(JsonDir, true);
			}
			if ((Actions & BuildActions.Build) != 0)
			{
				// Create the output directory
				Utility.SafeCreateDirectory(JsonDir);

				string Arguments = "-run=GenerateBlueprintAPI -path=" + JsonDir + " -name=BlueprintAPI -stdout -FORCELOGFLUSH -CrashForUAT -unattended -AllowStdOutLogVerbosity" + (bBuildMachine? " -buildmachine" : "");
				Console.WriteLine("Running: {0} {1}", EditorPath, Arguments);

				using (Process JsonExportProcess = new Process())
				{
					JsonExportProcess.StartInfo.WorkingDirectory = EngineDir;
					JsonExportProcess.StartInfo.FileName = EditorPath;
					JsonExportProcess.StartInfo.Arguments = Arguments;
					JsonExportProcess.StartInfo.UseShellExecute = false;
					JsonExportProcess.StartInfo.RedirectStandardOutput = true;
					JsonExportProcess.StartInfo.RedirectStandardError = true;

					JsonExportProcess.OutputDataReceived += new DataReceivedEventHandler(ProcessOutputReceived);
					JsonExportProcess.ErrorDataReceived += new DataReceivedEventHandler(ProcessOutputReceived);

					try
					{
						JsonExportProcess.Start();
						JsonExportProcess.BeginOutputReadLine();
						JsonExportProcess.BeginErrorReadLine();
						JsonExportProcess.WaitForExit();
						if(JsonExportProcess.ExitCode != 0)
						{
							return false;
						}
					}
					catch (Exception Ex)
					{
						Console.WriteLine(Ex.ToString() + "\n" + Ex.StackTrace);
						return false;
					}
				}
			}
			if((Actions & BuildActions.Archive) != 0)
			{
				Console.WriteLine("Creating archive '{0}'", ArchivePath);
				Utility.CreateTgzFromDir(ArchivePath, JsonDir);
			}
			return true;
		}
Beispiel #24
0
		static bool BuildCodeSnippetsTxt(string SamplesDir, BuildActions Actions)
		{
			if ((Actions & BuildActions.Clean) != 0)
			{
				APISnippets.CleanAllFiles();
			}
			if ((Actions & BuildActions.Build) == 0)
			{
				return true;
			}

			//We should be able to trim this down further.
			DirectoryInfo Dir = new DirectoryInfo(SamplesDir);
			List<string> Files = new List<string>();
			foreach (string FileName in Directory.GetFiles(SamplesDir, "*.cpp", SearchOption.AllDirectories))
			{
				if (!FileName.EndsWith(".generated.cpp"))
				{
					Files.Add(FileName);
				}
			}
			foreach (string FileName in Directory.GetFiles(SamplesDir, "*.h", SearchOption.AllDirectories))
			{
				if (!FileName.EndsWith(".generated.h"))
				{
					Files.Add(FileName);
				}
			}

			//Do the harvesting work.
			{
				const string OpeningTag = "///CODE_SNIPPET_START:";
				const string ClosingTag = "///CODE_SNIPPET_END";
				const string SeeTag = "@see";
				APISnippets Snippets = new APISnippets();
				List<string> CurrentSnippetPageNames = new List<string>(4);		//Probably won't have a snippet that is shared by more than four different pages.
				List<string> SeePageNames = new List<string>(4);				//More than four of these on one line will probably not happen.
				string CurrentLine;
				char[] WhiteSpace = {' ', '\t'};		//Doubles as our token delimiter in one place - noted in comments.
				string[] ClassMemberDelimiters = new string[2] { "::", "()" };
				bool IsSnippetBeingProcessed = false;
				bool WasPreviousLineBlank = false;		//Two blank lines in a row will end a code block. Don't allow this to happen in a single snippet.

				foreach (string FileName in Files)
				{
					// Read the file and display it line by line.
					System.IO.StreamReader file = new System.IO.StreamReader(FileName);
					int LineNumber = 0;
					while ((CurrentLine = file.ReadLine()) != null)
					{
						++LineNumber;
						CurrentLine = CurrentLine.TrimStart(WhiteSpace);
						if (!CurrentLine.Contains(OpeningTag))
						{
							continue;
						}
						CurrentSnippetPageNames = CurrentLine.Split(WhiteSpace, StringSplitOptions.RemoveEmptyEntries).ToList<string>();		//Whitespace is used to delimit our API/snippet page names here.
						while ((CurrentSnippetPageNames.Count > 0) && (!CurrentSnippetPageNames[0].Contains(OpeningTag)))
						{
							CurrentSnippetPageNames.RemoveAt(0);											//Remove everything before the opening tag.
						}
						if (CurrentSnippetPageNames.Count > 0)
						{
							CurrentSnippetPageNames.RemoveAt(0);											//Remove the opening tag, which is always in position 0 by this point.
						}
						if (CurrentSnippetPageNames.Count < 1)
						{
							Console.WriteLine("Error: OpeningTag for snippet harvesting found without any API pages specified.");
							return false;
						}

						IsSnippetBeingProcessed = true;
						foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
						{
							Snippets.AddSnippet(CurrentSnippetPageName);
							if (!Snippets.AddSnippetText(CurrentSnippetPageName, "**" + Path.GetFileName(FileName) + "** at line " + LineNumber + ":" + Environment.NewLine + Environment.NewLine))
							{
								Console.WriteLine("Error: Failed to add header text to snippet for " + CurrentSnippetPageName + " from source file " + FileName + " at line " + LineNumber);
								return false;
							}
						}
						bool FinishSnippetAfterThisLine = false;
						while ((CurrentLine = file.ReadLine()) != null)
						{
							++LineNumber;
							string TrimmedLine = CurrentLine.TrimStart(WhiteSpace);		//This is actually a C# same-line whitespace check, not our token delimiters.
							string TrimmedLineLower = TrimmedLine.ToLower();
							if (TrimmedLine.Contains(OpeningTag))
							{
								//Snippets do not currently support overlapping. If they did, closing tags should be explicit about which entries are ending, and we'd need to skip lines with opening tags.
								Console.WriteLine("Error: Nested OpeningTag found in " + FileName + " at line " + LineNumber + "! This is not supported. Snippet harvesting process will fail.");
								return false;
							}
							else if (TrimmedLine.StartsWith(ClosingTag))
							{
								//We're done with this snippet now. Mark that we can end cleanly.
								IsSnippetBeingProcessed = false;
								foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
								{
									Snippets.FinishCurrentSnippet(CurrentSnippetPageName);
								}
								break;
							}
							else if (TrimmedLine.Contains(ClosingTag))
							{
								//We will be done this snippet once we add this line (minus the tag).
								FinishSnippetAfterThisLine = true;
								CurrentLine = CurrentLine.Replace(ClosingTag, "//");
							}
							for (int TrimmedLineStartingIndex = TrimmedLineLower.IndexOf(SeeTag); TrimmedLineStartingIndex >= 0; TrimmedLineStartingIndex = TrimmedLineLower.Substring(TrimmedLineStartingIndex + SeeTag.Length).Contains(SeeTag) ? (TrimmedLineStartingIndex + SeeTag.Length + TrimmedLineLower.Substring(TrimmedLineStartingIndex + SeeTag.Length).IndexOf(SeeTag)) : -2)
							{
								int FirstCharacter = TrimmedLineStartingIndex + SeeTag.Length;
								SeePageNames = TrimmedLine.Substring(FirstCharacter).Split(WhiteSpace, StringSplitOptions.RemoveEmptyEntries).ToList<string>();		//Whitespace is used to delimit our API/snippet page names here.

								if (SeePageNames.Count > 0)
								{
									string SeeText = SeePageNames[0];
									string[] SeeTextBreakdown = SeeText.Split(ClassMemberDelimiters, StringSplitOptions.RemoveEmptyEntries);
									foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
									{
										if (SeeTextBreakdown.Length == 2)
										{
											//This is considered "class::member" format.
											if (!Snippets.AddSeeText(CurrentSnippetPageName, "1. [](API:" + SeeText + ")" + Environment.NewLine))
											{
												Console.WriteLine("Error: Failed to add text to snippet's \"See Also\" portion for " + CurrentSnippetPageName + " from source file " + FileName + " at line " + LineNumber);
												return false;
											}
										}
										else
										{
											if (!Snippets.AddSeeText(CurrentSnippetPageName, "1. [](" + SeeText + ")" + Environment.NewLine))
											{
												Console.WriteLine("Error: Failed to add text to snippet's \"See Also\" portion for " + CurrentSnippetPageName + " from source file " + FileName + " at line " + LineNumber);
												return false;
											}
										}
									}
								}
							}

							if (CurrentLine.Trim().Length < 1)
							{
								if (WasPreviousLineBlank)
								{
									//Two (or more) blank lines in a row! Not permitted.
									continue;
								}
								else
								{
									WasPreviousLineBlank = true;
								}
							}
							else
							{
								WasPreviousLineBlank = false;
							}

							//This line should be added to the snippet(s) named in the "CODE_SNIPPET_START" line. Capture it. We need to add our own newline.
							foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
							{
								if (!Snippets.AddSnippetText(CurrentSnippetPageName, '\t' + CurrentLine + Environment.NewLine))
								{
									Console.WriteLine("Error: Failed to add text to snippet for " + CurrentSnippetPageName + " from source file " + FileName + " at line " + LineNumber);
									return false;
								}
							}
							if (FinishSnippetAfterThisLine)
							{
								IsSnippetBeingProcessed = false;
								foreach (string CurrentSnippetPageName in CurrentSnippetPageNames)
								{
									Snippets.FinishCurrentSnippet(CurrentSnippetPageName);
								}
								break;
							}
						}
					}
					//If we hit the end of the file while harvesting a snippet, we should fail or have a warning. We could also just ignore the failure to end cleanly and just store the text as-is.
					//Opting for outright failure at the moment so that these errors don't go unnoticed.
					if (IsSnippetBeingProcessed)
					{
						Console.WriteLine("Code snippet start tag not matched with code snippet end tag in " + FileName);
						return false;
					}
					file.Close();
				}

				if (!Snippets.WriteSnippetsToFiles())
				{
					Console.WriteLine("Error writing intermediate snippet files.");
					return false;
				}
			}
			//Completed without error.
			return true;
		}
Beispiel #25
0
		static bool BuildBlueprintUdn(string JsonDir, string UdnDir, string SitemapDir, string ArchivePath, string SitemapArchivePath, BuildActions ExecActions)
		{
			string ApiDir = Path.Combine(UdnDir, "BlueprintAPI");
			if ((ExecActions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", ApiDir);
				Utility.SafeDeleteDirectoryContents(ApiDir, true);
				Utility.SafeDeleteDirectoryContents(SitemapDir, true);
			}
			if ((ExecActions & BuildActions.Build) != 0)
			{
				Directory.CreateDirectory(ApiDir);
				Directory.CreateDirectory(SitemapDir);

				// Read the input json file
				string JsonFilePath = Path.Combine(JsonDir, "BlueprintAPI.json");
				var json = (Dictionary<string, object>)fastJSON.JSON.Instance.Parse(File.ReadAllText(JsonFilePath));

				APICategory.LoadTooltips((Dictionary<string, object>)json["Categories"]);

				// TODO: This path is clearly sketchy as hell, but we'll clean it up later maybe
				var Actions = (Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)json["Actor"])["Palette"])["ActionSet"])["Actions"];

				APICategory RootCategory = new APICategory(null, "BlueprintAPI", true);

				foreach (var Action in Actions)
				{
					var CategoryList = Action.Key.Split('|');
					var ActionCategory = RootCategory;

					Debug.Assert(CategoryList.Length > 0);
					Debug.Assert(CategoryList[0] == "Library");

					for (int CategoryIndex = 1; CategoryIndex < CategoryList.Length - 1; ++CategoryIndex)
					{
						ActionCategory = ActionCategory.GetSubCategory(CategoryList[CategoryIndex]);
					}

					ActionCategory.AddAction(new APIAction(ActionCategory, CategoryList.Last(), (Dictionary<string, object>)Action.Value));
				}

				// Build a list of pages to output
				List<APIPage> OutputPages = new List<APIPage>(RootCategory.GatherPages().OrderBy(x => x.LinkPath));

				// Create the output directory
				Utility.SafeCreateDirectory(UdnDir);
				Utility.SafeCreateDirectory(Path.Combine(UdnDir, APIFolder));

				// Build the manifest
				Console.WriteLine("Writing manifest...");
				UdnManifest Manifest = new UdnManifest(RootCategory);
				Manifest.PrintConflicts();
				Manifest.Write(Path.Combine(UdnDir, BlueprintAPIFolder + "\\API.manifest"));

				Console.WriteLine("Categories: " + OutputPages.Count(page => page is APICategory));
				Console.WriteLine("Actions: " + OutputPages.Count(page => page is APIAction));

				// Write all the pages
				using (Tracker UdnTracker = new Tracker("Writing UDN pages...", OutputPages.Count))
				{
					foreach (int Idx in UdnTracker.Indices)
					{
						APIPage Page = OutputPages[Idx];

						// Create the output directory
						string MemberDirectory = Path.Combine(UdnDir, Page.LinkPath);
						if (!Directory.Exists(MemberDirectory))
						{
							Directory.CreateDirectory(MemberDirectory);
						}

						// Write the page
						Page.WritePage(Manifest, Path.Combine(MemberDirectory, "index.INT.udn"));
					}
				}

				// Write the sitemap contents
				Console.WriteLine("Writing sitemap contents...");
				RootCategory.WriteSitemapContents(Path.Combine(SitemapDir, "BlueprintAPI.hhc"));

				// Write the sitemap index
				Console.WriteLine("Writing sitemap index...");
				RootCategory.WriteSitemapIndex(Path.Combine(SitemapDir, "BlueprintAPI.hhk"));
			}
			if ((ExecActions & BuildActions.Archive) != 0)
			{
				Console.WriteLine("Creating archive '{0}'", ArchivePath);
				Utility.CreateTgzFromDir(ArchivePath, ApiDir);

				Console.WriteLine("Creating archive '{0}'", SitemapArchivePath);
				Utility.CreateTgzFromDir(SitemapArchivePath, SitemapDir);
			}
			return true;
		}
Beispiel #26
0
        static bool BuildBlueprintJson(string JsonDir, string EngineDir, string EditorPath, string ArchivePath, BuildActions Actions)
        {
            if((Actions & BuildActions.Clean) != 0)
            {
                Console.WriteLine("Cleaning '{0}'", JsonDir);
                Utility.SafeDeleteDirectoryContents(JsonDir, true);
            }
            if ((Actions & BuildActions.Build) != 0)
            {
                // Create the output directory
                Utility.SafeCreateDirectory(JsonDir);

                using (Process JsonExportProcess = new Process())
                {
                    JsonExportProcess.StartInfo.WorkingDirectory = EngineDir;
                    JsonExportProcess.StartInfo.FileName = EditorPath;
                    JsonExportProcess.StartInfo.Arguments = "-run=GenerateBlueprintAPI -path=" + JsonDir + " -name=BlueprintAPI";
                    JsonExportProcess.StartInfo.UseShellExecute = false;
                    JsonExportProcess.StartInfo.RedirectStandardOutput = true;
                    JsonExportProcess.StartInfo.RedirectStandardError = true;

                    JsonExportProcess.OutputDataReceived += new DataReceivedEventHandler(ProcessOutputReceived);
                    JsonExportProcess.ErrorDataReceived += new DataReceivedEventHandler(ProcessOutputReceived);

                    try
                    {
                        JsonExportProcess.Start();
                        JsonExportProcess.BeginOutputReadLine();
                        JsonExportProcess.BeginErrorReadLine();
                        JsonExportProcess.WaitForExit();
                        return JsonExportProcess.ExitCode == 0;
                    }
                    catch (Exception Ex)
                    {
                        Console.WriteLine(Ex.ToString() + "\n" + Ex.StackTrace);
                        return false;
                    }
                }
            }
            if((Actions & BuildActions.Archive) != 0)
            {
                Console.WriteLine("Creating archive '{0}'", ArchivePath);
                Utility.CreateTgzFromDir(ArchivePath, JsonDir);
            }
            return true;
        }
Beispiel #27
0
		static bool BuildChm(string ChmCompilerPath, string ChmFileName, string ContentsFileName, string IndexFileName, string BaseHtmlDir, bool bBlueprint, BuildActions Actions)
		{
			if((Actions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", ChmFileName);
				Utility.SafeDeleteFile(ChmFileName);
				Utility.SafeDeleteDirectory(Path.Combine(Path.GetDirectoryName(ChmFileName), Path.GetFileNameWithoutExtension(ChmFileName)));
			}
			if ((Actions & BuildActions.Build) != 0)
			{
				string ProjectFileName = (bBlueprint ? "BlueprintAPI.hhp" : "API.hhp");
				Console.WriteLine("Searching for CHM input files...");

				// Build a list of all the files we want to copy
				List<string> FilePaths = new List<string>();
				List<string> DirectoryPaths = new List<string>();
				Utility.FindRelativeContents(BaseHtmlDir, "Include\\*", true, FilePaths, DirectoryPaths);

				// Find all the HTML files
				if (bBlueprint)
				{
					Utility.FindRelativeContents(BaseHtmlDir, "INT\\BlueprintAPI\\*.html", true, FilePaths, DirectoryPaths);
					CreateChm(ChmCompilerPath, ChmFileName, "UE4 Blueprint API Documentation", "INT\\BlueprintAPI\\index.html", ContentsFileName, IndexFileName, BaseHtmlDir, FilePaths);
				}
				else
				{
					Utility.FindRelativeContents(BaseHtmlDir, "Images\\api*", false, FilePaths, DirectoryPaths);
					Utility.FindRelativeContents(BaseHtmlDir, "INT\\API\\*.html", true, FilePaths, DirectoryPaths);
					CreateChm(ChmCompilerPath, ChmFileName, "UE4 API Documentation", "INT\\API\\index.html", ContentsFileName, IndexFileName, BaseHtmlDir, FilePaths);
				}
			}
			return true;
		}
Beispiel #28
0
        public GlobalJsonResult <EmptyResult> DeleteBuild([FromBody] DeleteBuildRequest request)
        {
            dataAccessDispatcher.Dispatch(BuildActions.DeleteBuild(request.Id));

            return(GlobalJsonResult <EmptyResult> .Success(System.Net.HttpStatusCode.NoContent));
        }
Beispiel #29
0
		static bool BuildCodeMetadata(string DoxygenPath, string EngineDir, string MetadataDir, string MetadataPath, string ArchivePath, BuildActions Actions)
		{
			if((Actions & BuildActions.Clean) != 0)
			{
				Console.WriteLine("Cleaning '{0}'", MetadataDir);
				Utility.SafeDeleteDirectoryContents(MetadataDir, true);
			}
			if((Actions & BuildActions.Build) != 0)
			{
				string MetadataInputPath = Path.Combine(EngineDir, "Source\\Runtime\\CoreUObject\\Public\\UObject\\ObjectBase.h");
				Console.WriteLine("Building metadata descriptions from '{0}'...", MetadataInputPath);

				DoxygenConfig Config = new DoxygenConfig("Metadata", new string[]{ MetadataInputPath }, MetadataDir);
				if (!Doxygen.Run(DoxygenPath, Path.Combine(EngineDir, "Source"), Config, true))
				{
					return false;
				}

				MetadataLookup.Reset();

				// Parse the xml output
				ParseMetadataTags(Path.Combine(MetadataDir, "xml\\namespace_u_c.xml"), MetadataLookup.ClassTags);
				ParseMetadataTags(Path.Combine(MetadataDir, "xml\\namespace_u_i.xml"), MetadataLookup.InterfaceTags);
				ParseMetadataTags(Path.Combine(MetadataDir, "xml\\namespace_u_f.xml"), MetadataLookup.FunctionTags);
				ParseMetadataTags(Path.Combine(MetadataDir, "xml\\namespace_u_p.xml"), MetadataLookup.PropertyTags);
				ParseMetadataTags(Path.Combine(MetadataDir, "xml\\namespace_u_s.xml"), MetadataLookup.StructTags);
				ParseMetadataTags(Path.Combine(MetadataDir, "xml\\namespace_u_m.xml"), MetadataLookup.MetaTags);

				// Rebuild all the reference names now that we've parsed a bunch of new tags
				MetadataLookup.BuildReferenceNameList();

				// Write it to a summary file
				MetadataLookup.Save(MetadataPath);
			}
			if ((Actions & BuildActions.Archive) != 0)
			{
				Console.WriteLine("Creating archive '{0}'", ArchivePath);
				Utility.CreateTgzFromDir(ArchivePath, MetadataDir);
			}
			return true;
		}
Beispiel #30
0
 /// <summary>
 ///     Tworzy instancję obiektu
 ///     <param name="name"></param>
 ///     <param name="buildAction"></param>
 /// </summary>
 public ProjectItem(string name, BuildActions buildAction)
 {
     Name        = name;
     BuildAction = buildAction;
 }
Beispiel #31
0
		static bool BuildCodeXml(string EngineDir, string TargetInfoPath, string DoxygenPath, string XmlDir, string ArchivePath, List<string> Filters, BuildActions Actions)
        {
            if ((Actions & BuildActions.Clean) != 0)
            {
                Console.WriteLine("Cleaning '{0}'", XmlDir);
                Utility.SafeDeleteDirectoryContents(XmlDir, true);
            }
            if ((Actions & BuildActions.Build) != 0)
            {
                Console.WriteLine("Building XML...");
                Utility.SafeCreateDirectory(XmlDir);

                // Read the target that we're building
                BuildTarget Target = new BuildTarget(Path.Combine(EngineDir, "Source"), TargetInfoPath);

                // Create an invariant list of exclude directories
                string[] InvariantExcludeDirectories = ExcludeSourceDirectories.Select(x => x.ToLowerInvariant()).ToArray();

                // Get the list of folders to filter against
                List<string> FolderFilters = new List<string>();
                if (Filters != null)
                {
                    foreach (string Filter in Filters)
                    {
                        int Idx = Filter.IndexOf('/');
                        if (Idx != -1)
                        {
                            FolderFilters.Add("\\" + Filter.Substring(0, Idx) + "\\");
                        }
                    }
                }

                // Flatten the target into a list of modules
                List<string> InputModules = new List<string>();
                foreach (string DirectoryName in Target.DirectoryNames)
                {
                    for (DirectoryInfo ModuleDirectory = new DirectoryInfo(DirectoryName); ModuleDirectory.Parent != null; ModuleDirectory = ModuleDirectory.Parent)
                    {
                        IEnumerator<FileInfo> ModuleFile = ModuleDirectory.EnumerateFiles("*.build.cs").GetEnumerator();
                        if (ModuleFile.MoveNext() && (FolderFilters.Count == 0 || FolderFilters.Any(x => ModuleFile.Current.FullName.Contains(x))))
                        {
                            InputModules.AddUnique(ModuleFile.Current.FullName);
                            break;
                        }
                    }
                }

                // Just use all the input modules
                if (!bIndexOnly)
                {
                    // Set our error mode so as to not bring up the WER dialog if Doxygen crashes (which it often does)
                    SetErrorMode(0x0007);

                    // Create the output directory
                    Utility.SafeCreateDirectory(XmlDir);

                    // Build all the modules
                    Console.WriteLine("Parsing source...");

                    // Build the list of definitions
                    List<string> Definitions = new List<string>();
                    foreach (string Definition in Target.Definitions)
                    {
                        if (!Definition.StartsWith("ORIGINAL_FILE_NAME="))
                        {
                            Definitions.Add(Definition.Replace("DLLIMPORT", "").Replace("DLLEXPORT", ""));
                        }
                    }

                    // Build a list of input paths
                    List<string> InputPaths = new List<string>();
                    foreach (string InputModule in InputModules)
                    {
                        foreach (string DirectoryName in Directory.EnumerateDirectories(Path.GetDirectoryName(InputModule), "*", SearchOption.AllDirectories))
                        {
                            // Find the relative path from the engine directory
                            string NormalizedDirectoryName = DirectoryName;
                            if (NormalizedDirectoryName.StartsWith(EngineDir))
                            {
                                NormalizedDirectoryName = NormalizedDirectoryName.Substring(EngineDir.Length);
                            }
                            if (!NormalizedDirectoryName.EndsWith("\\"))
                            {
                                NormalizedDirectoryName += "\\";
                            }

                            // Check we can include it
                            if (!ExcludeSourceDirectories.Any(x => NormalizedDirectoryName.Contains("\\" + x + "\\")))
                            {
                                if (FolderFilters.Count == 0 || FolderFilters.Any(x => NormalizedDirectoryName.Contains(x)))
                                {
                                    InputPaths.Add(DirectoryName);
                                }
                            }
                        }
                    }

                    // Build the configuration for this module
                    DoxygenConfig Config = new DoxygenConfig("UE4", InputPaths.ToArray(), XmlDir);
                    Config.Definitions.AddRange(Definitions);
                    Config.Definitions.AddRange(DoxygenPredefinedMacros);
                    Config.ExpandAsDefined.AddRange(DoxygenExpandedMacros);
                    Config.IncludePaths.AddRange(Target.IncludePaths);
                    Config.ExcludePatterns.AddRange(ExcludeSourceDirectories.Select(x => "*/" + x + "/*"));
                    Config.ExcludePatterns.AddRange(ExcludeSourceFiles);

                    // Run Doxygen
                    if (!Doxygen.Run(DoxygenPath, Path.Combine(EngineDir, "Source"), Config, true))
                    {
                        Console.WriteLine("  error: Doxygen crashed. Skipping.");
                        return false;
                    }
                }

                // Write the modules file
                File.WriteAllLines(Path.Combine(XmlDir, "modules.txt"), InputModules);
            }
            if ((Actions & BuildActions.Archive) != 0)
            {
                Console.WriteLine("Creating archive '{0}'", ArchivePath);
                Utility.CreateTgzFromDir(ArchivePath, XmlDir);
            }
            return true;
        }
Beispiel #32
0
        /*
        /// <summary>
        /// Tworzy instancję obiektu
        /// </summary>
        public ProjectItem()
        {
        }

        Przykłady użycia

        implement INotifyPropertyChanged
        implement INotifyPropertyChanged_Passive
        implement ToString ##Name## ##SubItems## ##BuildAction##
        implement ToString Name=##Name##, SubItems=##SubItems##, BuildAction=##BuildAction##
        implement equals Name, SubItems, BuildAction
        implement equals *
        implement equals *, ~exclude1, ~exclude2
        */
        #region Constructors
        /// <summary>
        /// Tworzy instancję obiektu
        /// <param name="Name"></param>
        /// <param name="BuildAction"></param>
        /// </summary>
        public ProjectItem(string Name, BuildActions BuildAction)
        {
            this.Name = Name;
            this.BuildAction = BuildAction;
        }