예제 #1
0
    private void CopyToDownloadPath()
    {
        var srcPath  = BuildConfiger.InterpretedOutputPath;
        var destPath = BMUtility.InterpretPath(BuildConfiger.CopyFolderStr, BuildConfiger.AutoBundleBuildtarget);

        if (Directory.Exists(destPath))
        {
            Directory.Delete(destPath, true);
        }
        BuildHelper.CopyFiles(srcPath, destPath);
    }
예제 #2
0
    void RebuildSelection()
    {
        foreach (string bundleName in m_Selections)
        {
            BundleBuildState buildState = BundleManager.GetBuildStateOfBundle(bundleName);
            buildState.lastBuildDependencies = null;
        }

        BuildHelper.BuildBundles(m_Selections.ToArray());
        BuildHelper.ExportBMDatasToOutput();
    }
    public static void ExportResources(List <BuildGroup> groups)
    {
        SetAssetBundleNames(false);
        foreach (BuildGroup group in groups)
        {
            Export(BuildHelper.GetBuildTarget(group.Platform));
        }
#if !RECOURCE_CLIENT
        AutoBuildGameLogic.AutoBuild();
#endif
    }
예제 #4
0
        public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements,
                           PrintElementNode elementNode)
        {
            elementNode.CanCut = BuildHelper.CanCut(elementNode);
            elementNode.Cut    = BuildHelper.Cut(elementNode);

            elementNode.CanCopy = BuildHelper.CanCopy(elementNode);
            elementNode.Copy    = BuildHelper.Copy(elementNode);

            builder.BuildElement(elements, elementNode, elementNode.ElementMetadata, "ListItems");
            builder.BuildElement(elements, elementNode, elementNode.ElementMetadata, "ListItemTemplate");
        }
예제 #5
0
        public object Create(PrintElementBuildContext buildContext, dynamic elementMetadata)
        {
            var element = new PrintElementPageBreak();

            BuildHelper.ApplyTextProperties(element, buildContext.ElementStyle);
            BuildHelper.ApplyTextProperties(element, elementMetadata);

            BuildHelper.ApplyBlockProperties(element, buildContext.ElementStyle);
            BuildHelper.ApplyBlockProperties(element, elementMetadata);

            return(element);
        }
예제 #6
0
 // 无需编译
 public CmResult Python(string path)
 {
     if (!FileHelper.IsExists(path))
     {
         return(CmResult.BuildFail("", "文件不存在"));
     }
     if (!path.EndsWith(".py"))
     {
         return(CmResult.BuildFail("", "文件类型不正确"));
     }
     return(BuildHelper.BuildCmm($"python {path}"));
 }
예제 #7
0
        public object Create(PrintElementBuildContext buildContext, dynamic elementMetadata)
        {
            PrintElementImage element = CreateBarcodeImage(buildContext, elementMetadata);

            BuildHelper.ApplyTextProperties(element, buildContext.ElementStyle);
            BuildHelper.ApplyTextProperties(element, elementMetadata);

            BuildHelper.ApplyInlineProperties(element, buildContext.ElementStyle);
            BuildHelper.ApplyInlineProperties(element, elementMetadata);

            return(element);
        }
예제 #8
0
 // 无需编译
 public CmResult Nodejs(string path)
 {
     if (!FileHelper.IsExists(path))
     {
         return(CmResult.BuildFail("", "文件不存在"));
     }
     if (!path.EndsWith(".js"))
     {
         return(CmResult.BuildFail("", "文件类型不正确"));
     }
     return(BuildHelper.BuildCmm($"node {path}"));
 }
        public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements,
                           PrintElementNode elementNode)
        {
            elementNode.CanCut = BuildHelper.CanCut(elementNode);
            elementNode.Cut    = BuildHelper.Cut(elementNode);

            elementNode.CanCopy = BuildHelper.CanCopy(elementNode);
            elementNode.Copy    = BuildHelper.Copy(elementNode);

            builder.BuildElement(elements, elementNode, elementNode.ElementMetadata, "TableColumns");
            builder.BuildElement(elements, elementNode, elementNode.ElementMetadata, "TableRows");
        }
        private void Create(string format)
        {
            try
            {
                if (string.IsNullOrEmpty(BuildHelper.BuilderPath))
                {
                    throw new Exception("Empty Builder Path");
                }

                var name = (NameText.Text ?? "").Trim();
                if (string.IsNullOrEmpty(name))
                {
                    name = "John Smith";
                }

                var company = (CompanyText.Text ?? "").Trim();
                if (string.IsNullOrEmpty(company))
                {
                    company = "ONLYOFFICE";
                }

                var title = (TitleText.Text ?? "").Trim();
                if (string.IsNullOrEmpty(title))
                {
                    title = "Commercial director";
                }

                var filePath = BuildHelper.CreateDocument(BuildHelper.BuilderPath, name, company, title, format);

                var fileName = Path.GetFileName(filePath) ?? "output..docx";
                fileName = "Sample" + fileName.Substring(fileName.IndexOf('.', 7));

                var mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                if (Path.GetExtension(fileName) == ".xlsx")
                {
                    mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                }
                else if (Path.GetExtension(fileName) == ".pdf")
                {
                    mime = "application/pdf";
                }

                Response.ContentType = mime;
                Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
                Response.TransmitFile(filePath);
                Response.End();
            }
            catch (Exception exception)
            {
                ErrorMessage = exception.Message;
            }
        }
예제 #11
0
        private void BuildStep(int step)
        {
            if (step == -1)
            {
                BuildHelper.DisplayLine("No steps selected.");
                OnStepSuccess();
                return;
            }
            GUIElementData stepData = GuiData.Where(x => x.DataKey == "step" + step).FirstOrDefault();

            BuildHelper.DisplayLine($"{stepData.Label}...");
            stepData.ExecuteAction(stepData);
        }
예제 #12
0
    public static void ExportResources(List <BuildGroup> groups)
    {
        UpdateResVersion();
#if !RECOURCE_CLIENT
        UIEditor.CreateUIAtlas();
        UIEditor.CreateUIIcons();
#endif
        SetAssetBundleNames(false);
        foreach (BuildGroup group in groups)
        {
            Export(BuildHelper.GetBuildTarget(group.Platform));
        }
        AutoBuildGameLogic.AutoBuild();
    }
        private static void ApplyReference(PrintElementHyperlink element, PrintElementBuildContext buildContext, dynamic elementMetadata)
        {
            string referenceSting = BuildHelper.FormatValue(buildContext, elementMetadata.Reference, elementMetadata.SourceFormat);

            if (!string.IsNullOrEmpty(referenceSting))
            {
                Uri referenceUri;

                if (Uri.TryCreate(referenceSting, UriKind.RelativeOrAbsolute, out referenceUri))
                {
                    element.Reference = referenceUri;
                }
            }
        }
예제 #14
0
    void CreateFolderNode()
    {
        string defFolderName     = "+Folder";
        string currentFolderName = defFolderName;
        int    index             = 0;

        while (BundleManager.GetBundleData(currentFolderName) != null)
        {
            currentFolderName = defFolderName + (++index);
        }

        BuildHelper.CreateFolderNode(currentFolderName);
        StartEditBundleName(currentFolderName);
    }
예제 #15
0
        private static void ApplyPagePadding(PrintViewDocument element, dynamic pagePadding)
        {
            // По умолчанию отступ на странице 1см
            const double pagePadding1Cm = 1.0 * SizeUnits.Cm;

            PrintElementThickness pagePaddingThickness;

            if (!BuildHelper.TryToThickness(pagePadding, out pagePaddingThickness))
            {
                pagePaddingThickness = new PrintElementThickness(pagePadding1Cm);
            }

            element.PagePadding = pagePaddingThickness;
        }
예제 #16
0
 private void Update()
 {
     if (buttonPressed)
     {
         buttonPressed = false;
         RefreshBundlesForUI();
         BuildHelper.BuildAll();
     }
     else
     {
         colorAnimationValue = Mathf.Sin(Time.realtimeSinceStartup * 10) * 0.5f + 0.5f;
         Repaint();
     }
 }
예제 #17
0
    private void ScanChangesForAllBundles()
    {
        UpdateDependenciesForAllBundles();
        var a = Time.realtimeSinceStartup;

        BMDataAccessor.AssetStates.Clear();
        foreach (BundleData bundle in BundleManager.bundles)
        {
            BuildHelper.RefreshBundleChanged(bundle);
        }
        var b = Time.realtimeSinceStartup - a;

        Debug.Log("Changed State Updated. Time Consumed:" + b);
    }
예제 #18
0
        public override IReadOnlyList <INode> GetNodes(ISqlLoader loader, IGeneratorOption option, MethodInfo mi)
        {
            var tableName = table ?? BuildHelper.GetTableNameOfType(option, type);

            if (String.IsNullOrEmpty(tableName))
            {
                throw new BuilderException($"Table name resolve failed. type=[{mi.DeclaringType.FullName}], method=[{mi.Name}]");
            }

            return(new[]
            {
                new SqlNode($"TRUNCATE TABLE {tableName}")
            });
        }
예제 #19
0
        public CmResult CPlusPlus(string path)
        {
            CmResult cr = build.CPlusPlus(path);

            if (!cr.Success)
            {
                return(cr);
            }
            if (!FileHelper.IsExists(cr.Message))
            {
                return(CmResult.BuildFail("", "编译文件不存在"));
            }
            return(BuildHelper.BuildCmm($"{cr.Message}"));
        }
        private static Func <PrintElementNode, bool> InsertTableRow(PrintElementNodeBuilder builder,
                                                                    ICollection <PrintElementNode> elements, PrintElementNode parentElementNode)
        {
            // Добавление строки добавляет в нее недостающие ячейки или удаляет из нее лишние

            var getColumnCountFunc  = GetTableColumnCount(parentElementNode);
            var getLastTableRowFunc = GetLastTableRow(parentElementNode);
            var insertChildFunc     = BuildHelper.InsertChildToCollection(builder, elements, parentElementNode, "Rows",
                                                                          false);

            return(rowElementNode =>
            {
                if (insertChildFunc(rowElementNode))
                {
                    var insertedRow = getLastTableRowFunc();

                    if (insertedRow != null)
                    {
                        var columnCount = getColumnCountFunc();
                        var insertedRowCellCount = insertedRow.Nodes.Count;

                        // Добавление недостающих ячеек
                        if (insertedRowCellCount < columnCount)
                        {
                            for (var i = insertedRowCellCount; i < columnCount; ++i)
                            {
                                var cellNode = new PrintElementNode(insertedRow, "TableCell", new DynamicWrapper());

                                insertedRow.InsertChild.TryInvoke(cellNode);
                            }
                        }
                        // Удаление лишних ячеек
                        else if (insertedRowCellCount > columnCount)
                        {
                            for (var i = insertedRowCellCount - 1; i >= columnCount; --i)
                            {
                                var cellNode = insertedRow.Nodes[i];

                                insertedRow.DeleteChild.TryInvoke(cellNode, false);
                            }
                        }
                    }

                    return true;
                }

                return false;
            });
        }
예제 #21
0
            public void WhenBuild_IfNoPhysicalDirectoryExist_ShouldThrow()
            {
                // Arrange
                var mock = new CoreMockGenerator()
                           .MockApplication()
                           .MockApplicationPhysicalDirectoryDoesNotExist();

                // Act, Assert
                var helper    = new BuildHelper(mock.FileSystem.Object, mock.EnvironmentSystem.Object, mock.ProcessRunner.Object);
                var exception = Assert.Throws <Exception>(() => helper.Build(
                                                              mock.MockApplicationPhysicalPath,
                                                              mock.MockApplicationName));

                Assert.Equal(string.Format("Application directory '{0}' does not exist.", mock.MockApplicationPhysicalPath), exception.Message);
            }
예제 #22
0
        public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements,
                           PrintElementNode elementNode)
        {
            elementNode.ElementChildrenTypes = BuildHelper.BlockTypes;
            elementNode.CanInsertChild       = BuildHelper.CanInsertChild(elementNode);
            elementNode.InsertChild          = BuildHelper.InsertChildToContainer(builder, elements, elementNode, "ItemTemplate");

            elementNode.CanDeleteChild = BuildHelper.CanDeleteChild(elementNode);
            elementNode.DeleteChild    = BuildHelper.DeleteChildFromContainer(elements, elementNode, "ItemTemplate");

            elementNode.CanPaste = BuildHelper.CanPaste(elementNode);
            elementNode.Paste    = BuildHelper.Paste(elementNode);

            builder.BuildElement(elements, elementNode, elementNode.ElementMetadata.ItemTemplate);
        }
예제 #23
0
        public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements,
                           PrintElementNode elementNode)
        {
            elementNode.ElementChildrenTypes = TableCells;
            elementNode.CanInsertChild       = BuildHelper.CanInsertChild(elementNode);
            elementNode.InsertChild          = BuildHelper.InsertChildToContainer(builder, elements, elementNode, "Header", false);

            elementNode.CanDeleteChild = BuildHelper.CanDeleteChild(elementNode);
            elementNode.DeleteChild    = BuildHelper.DeleteChildFromContainer(elements, elementNode, "Header", false);

            elementNode.CanPaste = BuildHelper.CanPaste(elementNode);
            elementNode.Paste    = BuildHelper.Paste(elementNode);

            builder.BuildElement(elements, elementNode, elementNode.ElementMetadata.Header, "TableCell");
        }
예제 #24
0
        private static Func <PrintElementNode, bool, bool> CanDeleteTableRowCell(PrintElementNode parentElementNode)
        {
            // Удаление ячейки из строки возможно, если количество ячеек в строке больше количества столбцов

            var getColumnCountFunc       = GetTableColumnCount(parentElementNode);
            var getTableRowCellCountFunc = GetTableRowCellCount(parentElementNode);
            var canDeleteChildFunc       = BuildHelper.CanDeleteChild(parentElementNode);

            return((cellElementNode, accept) =>
            {
                var columnCount = getColumnCountFunc();
                var rowCellCount = getTableRowCellCountFunc();
                return (rowCellCount > columnCount) && canDeleteChildFunc(cellElementNode, accept);
            });
        }
예제 #25
0
        private static Func <PrintElementNode, bool> CanInsertTableRowCell(PrintElementNode parentElementNode)
        {
            // Добавление ячейки в строку возможно, если количество ячеек в строке меньше количества столбцов

            var getColumnCountFunc       = GetTableColumnCount(parentElementNode);
            var getTableRowCellCountFunc = GetTableRowCellCount(parentElementNode);
            var canInsertChildFunc       = BuildHelper.CanInsertChild(parentElementNode);

            return(cellElementNode =>
            {
                var columnCount = getColumnCountFunc();
                var rowCellCount = getTableRowCellCountFunc();
                return (rowCellCount < columnCount) && canInsertChildFunc(cellElementNode);
            });
        }
예제 #26
0
        public JsonResult Create(UserInfo userInfo)
        {
            try
            {
                if (string.IsNullOrEmpty(Settings.BuilderPath))
                {
                    throw new Exception("Empty Builder Path");
                }

                if (userInfo == null)
                {
                    throw new ArgumentException("userInfo");
                }

                if (string.IsNullOrEmpty(userInfo.Name))
                {
                    throw new Exception("Empty Name");
                }

                if (string.IsNullOrEmpty(userInfo.Company))
                {
                    throw new Exception("Empty Company");
                }

                if (string.IsNullOrEmpty(userInfo.Title))
                {
                    throw new Exception("Empty Title");
                }

                var filePath = BuildHelper.CreateDocument(Settings.BuilderPath, userInfo);

                return(Json(new
                {
                    success = true,
                    message = filePath
                }));
            }
            catch (Exception ex)
            {
                LogHelper.Log.Error(ex.Message, ex);

                return(Json(new
                {
                    success = false,
                    message = ex.Message
                }));
            }
        }
        private static void CreateStaticTableRows(PrintElementBuildContext buildContext, PrintElementTable table, dynamic rows)
        {
            if (rows != null)
            {
                var rowIndex     = 0;
                var columnCount  = table.Columns.Count;
                var skippedCells = new List <int>();

                foreach (var rowMetadata in rows)
                {
                    var tableRow = new PrintElementTableRow();

                    if (rowMetadata != null)
                    {
                        var rowStyle = buildContext.FindStyle(rowMetadata.Style);

                        // Установка общих свойств для текста
                        BuildHelper.ApplyTextProperties(tableRow, rowStyle);
                        BuildHelper.ApplyTextProperties(tableRow, rowMetadata);

                        for (var columnIndex = 0; columnIndex < columnCount; ++columnIndex)
                        {
                            var cellOffset = GetCellOffset(columnCount, rowIndex, columnIndex);

                            // Если ячейку не нужно отображать (из-за настроек RowSpan или ColumnSpan)
                            if (!skippedCells.Contains(cellOffset))
                            {
                                var cellMetadata = (rowMetadata.Cells != null) ? Enumerable.ElementAtOrDefault(rowMetadata.Cells, columnIndex) : null;
                                var tableCell    = CreateTableCell(buildContext, table, columnIndex, cellMetadata, true);
                                tableRow.Cells.Add(tableCell);

                                AddSkippedCells(skippedCells, columnCount, rowIndex, columnIndex, cellMetadata);
                            }
                        }

                        // Пост-установка общих свойств для текста
                        BuildHelper.PostApplyTextProperties(tableRow, rowStyle);
                        BuildHelper.PostApplyTextProperties(tableRow, rowMetadata);
                    }

                    buildContext.MapElement(tableRow, rowMetadata);

                    table.Rows.Add(tableRow);

                    ++rowIndex;
                }
            }
        }
예제 #28
0
    void CreateAssetBundlesFromSelection()
    {
        if (Selection.objects == null || Selection.objects.Length == 0)
        {
            return;
        }

        string parent = string.Empty;

        if (m_Selections != null && m_Selections.Count > 0)
        {
            parent = m_Selections[0];
        }

        BuildHelper.CreateAssetBundlesFromSelection(Selection.objects, parent);
    }
예제 #29
0
        public void OnPreprocessBuild(BuildReport report)
        {
            if (report.summary.platform != BuildTarget.Android)
            {
                return;
            }

            EnsureARCoreSupportedIsNotChecked();
            EnsureGoogleARCoreIsNotPresent();
            EnsureMinSdkVersion();
            EnsureOnlyOpenGLES3IsUsed();
            EnsureGradleIsUsed();
            BuildImageTrackingAssets();

            BuildHelper.AddBackgroundShaderToProject(ARCoreCameraSubsystem.backgroundShaderName);
        }
예제 #30
0
 private void CopyLanguageData(GUIElementData stepData)
 {
     if (_currentGuiData.ContainsKey("language"))
     {
         CopyFilesArguments args = new CopyFilesArguments(StaticPaths.ConvertNameToBuiltOutputPath(this["game"], BuildHelper.BuildTarget, this["language"]), StaticPaths.ConvertNameToMainPath(BuildHelper.BuildTarget, this["language"]))
         {
             Include = "*",
             Exclude = $"{Path.DirectorySeparatorChar}xml{Path.DirectorySeparatorChar}"
         };
         BuildHelper.RunStep(StepType.CopyFiles, args);
     }
     else
     {
         BuildHelper.DisplayLine("No language selected.");
         BuildHelper.RunStep(StepType.StepOver, null);
     }
 }