Example #1
0
        public async Task <Object> ModifyBranch([FromBody] BranchInfo branch)
        {
            string userId = User.Claims.First(c => c.Type == "UserID").Value;
            var    user   = await _dataBase.Users.FindAsync(userId);

            if (user == null)
            {
                return(BadRequest("Not allowed to make modifications on Rent-A-Car service!"));
            }

            if (user.RentacarID != branch.RentacarId)
            {
                return(BadRequest("Not allowed to make modifications on given Rent-A-Car service"));
            }

            var res = await _dataBase.Branches.Include(b => b.Location).SingleOrDefaultAsync(obj => obj.Id == branch.BranchId);

            if (res == null)
            {
                return(NotFound("Branch not found!"));
            }

            res.NameOfBranch            = branch.BranchName;
            res.Location.NameOfCity     = branch.City;
            res.Location.NameOfStreet   = branch.Address;
            res.Location.NumberInStreet = branch.Number;
            res.Location.GeoWidth       = branch.GeoWidth;
            res.Location.GeoHeight      = branch.GeoHeight;
            _dataBase.SaveChanges();
            return(Ok());
        }
Example #2
0
        void IRefreshableView.Refresh()
        {
            BranchInfo workingBranch = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter(10);

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                workingBranch = OverlappedCalculator.GetWorkingBranch(
                    mWkInfo.ClientPath);
            },
                /*afterOperationDelegate*/ delegate
            {
                if (waiter.Exception != null)
                {
                    ExceptionsHandler.DisplayException(waiter.Exception);
                    return;
                }

                // No need for merge info if it's a label
                if (workingBranch == null)
                {
                    return;
                }

                mMergeController.UpdateMergeObjectInfoIfNeeded(workingBranch);
                mMergeViewLogic.Refresh();
            });
        }
Example #3
0
    public List <RoomInfo> GenerateRoomInfo()
    {
        List <RoomInfo> rooms = new List <RoomInfo>();

        /* Add the first room of the dungeon. */
        rooms.Add(new RoomInfo(0, 0, RoomTypes.START));

        /* Generate the different branches of the dungeon. */
        for (int i = 0; i < branchingInfo.Length; i++)
        {
            BranchInfo     branchInfo   = branchingInfo[i];
            int            branchLength = Random.Range(branchInfo.minLength, branchInfo.maxLength + 1);
            RoomTypes      goal         = branchInfo.goal;
            List <Vector2> occupied     = GetOccupiedCoordinates(rooms);
            /* Choose a random room to branch off. */
            RoomInfo        startRoom = rooms[Random.Range(0, rooms.Count)];
            List <RoomInfo> branch    = DungeonBranch.GenerateBranch(
                new Vector2(startRoom.x, startRoom.y),
                branchLength, goal, occupied);

            /* If the branch generation failed, try again. */
            if (branch == null)
            {
                i--;
                continue;
            }

            rooms.AddRange(branch);
        }
        /* Add connections between neighboring rooms. */
        AddRoomNeighbors(rooms);

        return(rooms);
    }
Example #4
0
        public List <SqlParameter> SetValuesInbranchInfo(BranchInfo branchInfo)
        {
            List <SqlParameter> sqlParam = new List <SqlParameter>();

            if (branchInfo.Id != 0)
            {
                sqlParam.Add(new SqlParameter("@BranchId", branchInfo.Id));
            }
            else
            {
                sqlParam.Add(new SqlParameter("@CreatedBy", branchInfo.CreatedBy));
            }

            sqlParam.Add(new SqlParameter("@Name", branchInfo.BranchName));

            sqlParam.Add(new SqlParameter("@GSTNumber", branchInfo.GSTNumber));

            sqlParam.Add(new SqlParameter("@Pan", branchInfo.PANNumber));

            sqlParam.Add(new SqlParameter("@CompanyId", branchInfo.CompanyId));

            sqlParam.Add(new SqlParameter("@IsActive", branchInfo.Active));

            sqlParam.Add(new SqlParameter("UpdatedBy", branchInfo.UpdatedBy));

            return(sqlParam);
        }
Example #5
0
        private void DoWarningBox(Rect rect, RepositoryInformation info, BranchInfo branch)
        {
            int?       behindBy = selectedBranch.TrackingDetails.BehindBy;
            GUIContent content  = GUIContent.none;

            if (info.CurrentOperation == CurrentOperation.Merge)
            {
                content = GitGUI.GetTempContent("Merging with remote branch in progress. You <b>must</b> do a merge commit before pushing.");
            }
            else if (behindBy != null && behindBy.Value > 0)
            {
                content = GitGUI.GetTempContent(string.Format("Branch <b>{0}</b> behind tracked branch <b>{1}</b>", selectedBranch.FriendlyName, selectedBranch.TrackedBranch));
            }
            else if (branch.IsRemote)
            {
                content = GitGUI.GetTempContent("Viewing a remote branch. Showing local history of remote branch.");
            }
            else if (!branch.IsCurrentRepositoryHead)
            {
                content = GitGUI.GetTempContent("Viewing a branch that is not the HEAD.");
            }

            GUI.Box(rect, content, styles.historyHelpBox);
            GUI.Box(rect, GUIContent.none, styles.historyHelpBoxLabel);
        }
        public HttpResponseMessage GetBranchInfoById(HttpRequestMessage reqObject)
        {
            string AccountStatusId = string.Empty;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _BranchInfo     = JsonConvert.DeserializeObject <BranchInfo>(_requestedDataObject.BusinessData);
                AccountStatusId = _BranchInfo.BranchId;
            }

            if (!string.IsNullOrWhiteSpace(AccountStatusId))
            {
                _BranchInfo = new BranchInfo();
                _BranchInfo = _IBranchInfoService.GetBranchInfoById(AccountStatusId);
            }
            if (_BranchInfo != null)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(_BranchInfo, "information has been fetched successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(_BranchInfo, "Account Status Setup Not Found...");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
Example #7
0
        public IEnumerable <SourceItemInfo> GetSourceItemsList(BranchInfo branchInfo, string path)
        {
            ThrowIfNotLoggedIn();
            ThrowIfNullOrInvalid(branchInfo);

            const string sourceItemTypeFile      = "FILE";
            const string sourceItemTypeDirectory = "DIRECTORY";

            var normPath = PathHelper.NormalizePath(path, '/');

            normPath = path != null ? $"/{path}" : string.Empty;

            var srcItemDtos = BitbucketServiceHelper.GetValues <SourceItemDto>(EncodedAuthString
                                                                               , $"{BaseUrl}/projects/{branchInfo.Repo.Project.Key}/repos/{branchInfo.Repo.Key}/browse{normPath}"
                                                                               , branchInfo.Key);

            // TODO: разобраться c contentId и node
            return(srcItemDtos.Select(
                       dto => new SourceItemInfo
            {
                Id = Constants.UndefinedId,
                Key = $"{path}/{dto.path.toString}",
                Name = dto.path.toString,
                FolderPath = path,
                Extension = dto.path.extension,
                //Parent = dto.path.parent,
                ContentId = dto.contentId,
                Node = dto.node,
                Type = dto.type == sourceItemTypeFile ? SourceItemTypes.File
                                                : dto.type == sourceItemTypeDirectory ? SourceItemTypes.Directory
                                                : SourceItemTypes.Unknown,
                Size = dto.size,
                Branch = branchInfo
            }));
        }
Example #8
0
        public string GetSourceFileContent(BranchInfo branchInfo, string path)
        {
            ThrowIfNotLoggedIn();
            ThrowIfNullOrInvalid(branchInfo);

            var normPath = PathHelper.NormalizePath(path, '/');

            if (string.IsNullOrWhiteSpace(normPath))
            {
                throw new ArgumentNullException(nameof(path));
            }

            try
            {
                var content = BitbucketServiceHelper.GetResponse(EncodedAuthString
                                                                 , $"{BaseUrl}/projects/{branchInfo.Repo.Project.Key}/repos/{branchInfo.Repo.Key}/raw/{normPath}"
                                                                 , $"at={branchInfo.Key}");

                return(content);
            }
            catch (WebException e)
            {
                if ((e?.Response as HttpWebResponse)?.StatusCode == HttpStatusCode.NotFound)
                {
                    throw new FileNotFoundException(e.Message);
                }

                throw;
            }
        }
        public ActionResult Save_Branch(string isOnlyDelete, string OrganizationCode, string BranchId, string BranchName, string Street1, string Street2, string City, string State, string Country, string PIN, string IsMainBranch, string IsActive)
        {
            if (Session["UserDetails"] != null && ((UserInfo)Session["UserDetails"]).UserType.ToString().Trim().ToUpper() == "R" && ((UserInfo)Session["UserDetails"]).OrganizationCode != null)
            {
                OrganizationCode = ((UserInfo)Session["UserDetails"]).OrganizationCode.Trim();
            }

            using (Master_Svc.MasterServiceClient iGstSvc = new Master_Svc.MasterServiceClient())
            {
                BranchInfo objBranch = new BranchInfo();

                objBranch.BranchID         = BranchId;
                objBranch.BranchName       = BranchName;
                objBranch.Street1          = Street1;
                objBranch.Street2          = Street2;
                objBranch.City             = City;
                objBranch.State            = State;
                objBranch.Country          = Country;
                objBranch.PIN              = PIN;
                objBranch.IsMainBranch     = IsMainBranch;
                objBranch.OrganizationCode = OrganizationCode;
                objBranch.IsActive         = IsActive.Trim().ToUpper() == "Y";

                if (iGstSvc.Save_Branch(isOnlyDelete.Trim().ToUpper() == "Y", objBranch, ((UserInfo)Session["UserDetails"]), out ErrorMessage))
                {
                    return(Json("Ok", JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(ErrorMessage, JsonRequestBehavior.AllowGet));
        }
Example #10
0
 public bool predictBranch(BranchInfo branch)
 {
     localPatternHistoryTableIndex  = (int)(branch.address & lowBranchAddressMask);
     globalPatternHistoryTableIndex = (int)(localPatternHistoryTable[localPatternHistoryTableIndex] & historyMask);
     prediction = (globalPatternHistoryTable[globalPatternHistoryTableIndex] >= 0);
     return(prediction);
 }
Example #11
0
        public BranchInfoActor()
        {
            Receive <GetBranchInfo>(message =>
            {
                Logger.WriteLine($"Starting Branch info {message.DirPath} -> {message.BranchName}");
                using (var repository = new Repository(message.RepositoryPath))
                {
                    var branch           = repository.Branches[message.BranchName];
                    var branchLastCommit = branch.Tip;
                    var branchInfo       = new BranchInfo
                    {
                        Name           = branch.Name,
                        CommitterDate  = branchLastCommit.Committer.When,
                        CommitterName  = branchLastCommit.Committer.Name,
                        CommitterEmail = branchLastCommit.Committer.Email,
                        Message        = branchLastCommit.Message,
                        Sha            = branchLastCommit.Sha,
                    };

                    var repoAndBranchInfo = new RepoAndBranchInfo(message.DirPath, branchInfo);

                    Context.ActorSelection(ActorSelectionRouting.BranchInfoAggregationActorPath)
                    .Tell(new RepositoryAndBranchInfo(repoAndBranchInfo));
                }
            });
        }
Example #12
0
        public List <BranchInfo> GetBranchList()
        {
            List <BranchInfo> branchInfoList = new List <BranchInfo>();

            BranchInfo branchInfo = new BranchInfo();

            List <SqlParameter> sqlParam = new List <SqlParameter>();

            sqlParam.Add(new SqlParameter("@CompanyId", DBNull.Value));

            sqlParam.Add(new SqlParameter("@BranchName", DBNull.Value));

            DataTable dt = _sqlHelper.ExecuteDataTable(sqlParam, StoredProcedureEnum.sp_Get_Branches.ToString(), CommandType.StoredProcedure);

            foreach (DataRow dr in dt.Rows)
            {
                branchInfo = new BranchInfo();

                branchInfo.Id = Convert.ToInt32(dr["Id"]);

                branchInfo.BranchName = Convert.ToString(dr["Name"]);

                branchInfoList.Add(branchInfo);
            }

            return(branchInfoList);
        }
        public HttpResponseMessage UpdateBranchInfo(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _BranchInfo = JsonConvert.DeserializeObject <BranchInfo>(_requestedDataObject.BusinessData);
                bool IsValid = ModelValidation.TryValidateModel(_BranchInfo, out _modelErrorMsg);
                if (IsValid)
                {
                    result = _IBranchInfoService.UpdateBranchInfo(_BranchInfo);
                }
            }

            if (!string.IsNullOrWhiteSpace(_modelErrorMsg))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, _modelErrorMsg);
            }
            else if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been updated successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been updated");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
Example #14
0
        public List <BranchInfo> GetAllBranch(SqlConnection connection, int position, int size)
        {
            var result = new List <BranchInfo>();

            using (var command = new SqlCommand("Select * " +
                                                " from tbl_Branch where  1 = 1 order by BranchID " +
                                                " OFFSET @position ROWS FETCH NEXT @size ROWS ONLY ", connection))
            {
                AddSqlParameter(command, "@position", position, System.Data.SqlDbType.Int);
                AddSqlParameter(command, "@size", size, System.Data.SqlDbType.Int);
                using (var reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var info = new BranchInfo();
                        info.BranchID      = GetDbReaderValue <int>(reader["BranchID"]);
                        info.BranchName    = GetDbReaderValue <string>(reader["BranchName"]);
                        info.BranchAddress = GetDbReaderValue <string>(reader["BranchAddress"]);
                        info.BranchPhone   = GetDbReaderValue <string>(reader["BranchPhone"]);
                        result.Add(info);
                    }
                }
                return(result);
            }
        }
Example #15
0
        public ActionMessage deleteBranch(int branchId)
        {
            ActionMessage        ret           = new ActionMessage();
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                try
                {
                    BranchInfo branchInfo = BranchDataLayer.GetInstance().GetBranchById(connection, branchId);
                    if (branchInfo == null)
                    {
                        ret.isSuccess   = false;
                        ret.err.msgCode = "Chi nhánh này không tồn tại";
                        return(ret);
                    }
                    BranchDataLayer.GetInstance().DeleteBranch(connection, branchId);
                    ret.isSuccess = true;
                }
                catch (Exception ex)
                {
                    ret.isSuccess     = false;
                    ret.err.msgCode   = "Internal Error";
                    ret.err.msgString = ex.ToString();
                }
            }
            return(ret);
        }
        public int AddBranchInfo(BranchInfo _BranchInfo)
        {
            try
            {
                var _max = _IUoW.Repository <BranchInfo>().GetMaxValue(x => x.BranchId) + 1;
                _BranchInfo.BranchId     = _max.ToString().PadLeft(3, '0');
                _BranchInfo.AuthStatusId = "A";
                _BranchInfo.LastAction   = "ADD";
                _BranchInfo.MakeDT       = System.DateTime.Now;
                _BranchInfo.MakeBy       = "mtaka";
                var result = _IUoW.Repository <BranchInfo>().Add(_BranchInfo);
                #region Auth Log
                if (result == 1)
                {
                    _IAuthLogService = new AuthLogService();
                    long _outMaxSlAuthLogDtl = 0;
                    result = _IAuthLogService.AddAuthLog(_IUoW, null, _BranchInfo, "ADD", "0001", "090101012", 1, "BranchInfo", "MTK_CP_BRANCH_INFO", "BranchId", _BranchInfo.BranchId, "mtaka", _outMaxSlAuthLogDtl, out _outMaxSlAuthLogDtl);
                }
                #endregion

                if (result == 1)
                {
                    _IUoW.Commit();
                }
                return(result);
            }
            catch (Exception ex)
            {
                _ObjErrorLogService = new ErrorLogService();
                _ObjErrorLogService.AddErrorLog(ex, string.Empty, "AddBranchInfo(obj)", string.Empty);
                return(0);
            }
        }
Example #17
0
    private void Split(BranchInfo info)
    {
        int     s   = info.start;
        Vector3 c   = (mesh.vertices[s + 4] + mesh.vertices[s + 7]) / 2f;
        Vector3 c1  = (mesh.vertices[s + 5] + mesh.vertices[s + 6]) / 2f;
        Vector3 dir = (info.endPos - info.startPos).normalized;

        float   dist = Mathf.Sqrt(3) / 2 * info.maxWidth;
        Vector3 v0   = c + dir * dist;
        Vector3 v1   = c1 + dir * dist;

        List <Vector3> vertices  = new List <Vector3>(mesh.vertices);
        List <int>     triangles = new List <int>(mesh.triangles);

        int newStart = vertices.Count;

        vertices.AddRange(new Vector3[] {
            mesh.vertices[s + 4],
            mesh.vertices[s + 5],
            mesh.vertices[s + 6],
            mesh.vertices[s + 7],
            v0,
            v1
        });
        s = newStart;

        //top/bottom triangles
        triangles.AddRange(new int[] { s + 0, s + 3, s + 4 });
        triangles.AddRange(new int[] { s + 1, s + 5, s + 2 });
        //right
        triangles.AddRange(new int[] { s + 0, s + 5, s + 1 });
        triangles.AddRange(new int[] { s + 0, s + 4, s + 5 });
        //left
        triangles.AddRange(new int[] { s + 5, s + 3, s + 2 });
        triangles.AddRange(new int[] { s + 5, s + 4, s + 3 });

        mesh.vertices  = vertices.ToArray();
        mesh.triangles = triangles.ToArray();
        mesh.MarkModified();

        //left / right center, new positions
        Vector3 s0 = (mesh.vertices[s + 2] + mesh.vertices[s + 3] + mesh.vertices[s + 4] + mesh.vertices[s + 5]) / 4;
        Vector3 s1 = (mesh.vertices[s + 0] + mesh.vertices[s + 1] + mesh.vertices[s + 5] + mesh.vertices[s + 4]) / 4;
        //left / right normals
        Vector3 n0 = (s0 - (c + c1) / 2).normalized;
        Vector3 n1 = (s1 - (c + c1) / 2).normalized;

        float maxWidth = info.width * 3 / 4f;
        float mC0      = Random.Range(0, 1f);
        float mC1      = Random.Range(0, 1f);

        if (Random.Range(0, 1f) > 0.15f)
        {
            CreateBranch(s0, n0, (int)(info.maxChildren * mC0), maxWidth * 0.5f, maxWidth);
        }
        if (Random.Range(0, 1f) > 0.05f)
        {
            CreateBranch(s1, n1, (int)(info.maxChildren * mC1), maxWidth * 0.5f, maxWidth);
        }
    }
Example #18
0
        public BranchInfo GetBranchInfoByID(int id)
        {
            BranchInfo branchInfo = new BranchInfo();

            branchInfo = Database.BranchInfos.Where(b => b.IID == id && b.IsRemoved == 0).FirstOrDefault();
            return(branchInfo);
        }
        public BranchInfoActor()
        {
            Receive<GetBranchInfo>(message =>
            {
                Logger.WriteLine($"Starting Branch info {message.DirPath} -> {message.BranchName}");
                using (var repository = new Repository(message.RepositoryPath))
                {
                    var branch = repository.Branches[message.BranchName];
                    var branchLastCommit = branch.Tip;
                    var branchInfo = new BranchInfo
                    {
                        Name = branch.Name,
                        CommitterDate = branchLastCommit.Committer.When,
                        CommitterName = branchLastCommit.Committer.Name,
                        CommitterEmail = branchLastCommit.Committer.Email,
                        Message = branchLastCommit.Message,
                        Sha = branchLastCommit.Sha,
                    };

                    var repoAndBranchInfo = new RepoAndBranchInfo(message.DirPath, branchInfo);

                    Context.ActorSelection(ActorSelectionRouting.BranchInfoAggregationActorPath)
                        .Tell(new RepositoryAndBranchInfo(repoAndBranchInfo));

                }
            });
        }
Example #20
0
    private void Grow(BranchInfo info)
    {
        Vector3[] vertices = mesh.vertices;
        Vector3   c0 = Vector3.zero, c1 = Vector3.zero;

        for (int i = info.start; i < info.start + 4; i++)
        {
            c0 += vertices[i];
            c1 += vertices[i + 4];
        }
        c0 /= 4;
        c1 /= 4;
        Vector3 dir   = (c1 - c0).normalized;
        Vector3 norm  = Vector3.Cross(dir, Vector3.up).normalized;
        Vector3 norm2 = Vector3.Cross(dir, norm).normalized;

        vertices[info.start]     = c0 + norm * info.width + norm2 * info.width;
        vertices[info.start + 1] = c0 + norm * info.width - norm2 * info.width;
        vertices[info.start + 2] = c0 - norm * info.width - norm2 * info.width;
        vertices[info.start + 3] = c0 - norm * info.width + norm2 * info.width;

        float w2 = info.width * 3 / 4f;

        vertices[info.start + 4] = c0 + norm * w2 + norm2 * w2 + dir * info.length;
        vertices[info.start + 5] = c0 + norm * w2 - norm2 * w2 + dir * info.length;
        vertices[info.start + 6] = c0 - norm * w2 - norm2 * w2 + dir * info.length;
        vertices[info.start + 7] = c0 - norm * w2 + norm2 * w2 + dir * info.length;
        mesh.vertices            = vertices;
        mesh.MarkModified();
    }
Example #21
0
        public static int Create(BranchInfo info)
        {
            //var retVal = CachingProvider.Instance().Get()
            var retVal = DataProvider.Instance().Branches_Insert(info.Code, info.Name, info.LocationID, info.Description, info.CreatedBy);

            return(retVal);
        }
        public void Reset(BranchInfo branch)
        {
            string strAblagePath = this.Convention.GetAblagePath(branch);

            if(this.FileSystemAdapter.Exists(strAblagePath)) this.FileSystemAdapter.EmptyDirectory(strAblagePath);
            else this.FileSystemAdapter.CreateDirectory(strAblagePath);
        }
Example #23
0
        public static BuildTargetResult GenerateVersions(BuildTargetContext c)
        {
            var commitCount = GitUtils.GetCommitCount();

            var commitHash = GitUtils.GetCommitHash();

            var branchInfo = new BranchInfo(Dirs.RepoRoot);

            var hostVersion = new HostVersion()
            {
                ReleaseSuffix = branchInfo.Entries["RELEASE_SUFFIX"],
                CommitCount   = commitCount
            };

            var buildVersion = new BuildVersion()
            {
                Major         = int.Parse(branchInfo.Entries["MAJOR_VERSION"]),
                Minor         = int.Parse(branchInfo.Entries["MINOR_VERSION"]),
                Patch         = int.Parse(branchInfo.Entries["PATCH_VERSION"]),
                ReleaseSuffix = branchInfo.Entries["RELEASE_SUFFIX"],
                CommitCount   = commitCount
            };

            c.BuildContext["BuildVersion"] = buildVersion;
            c.BuildContext["HostVersion"]  = hostVersion;
            c.BuildContext["CommitHash"]   = commitHash;
            c.BuildContext["SharedFrameworkNugetVersion"] = buildVersion.NetCoreAppVersion;

            c.Info($"Building Version: {hostVersion.LatestHostVersion.WithoutSuffix} (NuGet Packages: {hostVersion.LatestHostVersion})");
            c.Info($"From Commit: {commitHash}");

            return(c.Success());
        }
        public HttpResponseMessage DeleteBranchInfo(HttpRequestMessage reqObject)
        {
            int result = 0;

            _requestedDataObject = _IDataManipulation.GetRequestedDataObject(reqObject);
            if (_requestedDataObject != null && _requestedDataObject.BusinessData != null)
            {
                _BranchInfo = JsonConvert.DeserializeObject <BranchInfo>(_requestedDataObject.BusinessData);
            }

            if (_BranchInfo == null || string.IsNullOrWhiteSpace(_BranchInfo.BranchId))
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "Account Status Setup Id Not Found...");
                _response        = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
                return(_response);
            }

            result = _IBranchInfoService.DeleteBranchInfo(_BranchInfo);
            if (result == 1)
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information has been deleted successfully");
            }
            else
            {
                _serviceResponse = _IDataManipulation.SetResponseObject(result, "information hasn't been deleted");
            }
            _response = _IDataManipulation.CreateResponse(_serviceResponse, reqObject);
            return(_response);
        }
Example #25
0
 public BranchCoverageDetail(BranchInfo branchInfo, int coveredTimes, BranchInfo targetLocation, int targetCoveredTimes, string type)
 {
     BranchInfo              = branchInfo;
     CoveredTimes            = coveredTimes;
     TargetLocation          = targetLocation;
     this.targetCoveredTimes = targetCoveredTimes;
     Type = type;
 }
Example #26
0
 public bool predictBranch(BranchInfo branch)
 {
     if (state >= 0)
     {
         return true;
     }
     return false;
 }
Example #27
0
 public BoundaryProblem(string kind, string targetName, string message, BranchInfo flippedLocation, string flippedCondition)
 {
     Kind             = kind;
     TargetName       = targetName;
     Message          = message;
     FlippedLocation  = flippedLocation;
     FlippedCondition = flippedCondition;
 }
Example #28
0
 public BoundaryProblem(string kind, string targetName, string message, BranchInfo flippedLocation, string flippedCondition)
 {
     Kind = kind;
     TargetName = targetName;
     Message = message;
     FlippedLocation = flippedLocation;
     FlippedCondition = flippedCondition;
 }
 public BranchCoverageDetail(BranchInfo branchInfo, int coveredTimes, BranchInfo targetLocation, int targetCoveredTimes, string type)
 {
     BranchInfo = branchInfo;
     CoveredTimes = coveredTimes;
     TargetLocation = targetLocation;
     this.targetCoveredTimes = targetCoveredTimes;
     Type = type;
 }
Example #30
0
        public static BuildTargetResult GenerateVersions(BuildTargetContext c)
        {
            var commitCount = GitUtils.GetCommitCount();

            var commitHash = GitUtils.GetCommitHash();

            var branchInfo = new BranchInfo(Dirs.RepoRoot);

            // Read details from branchinfo.txt for our build configuration
            int    iMajor                   = int.Parse(branchInfo.Entries["MAJOR_VERSION"]);
            int    iMinor                   = int.Parse(branchInfo.Entries["MINOR_VERSION"]);
            int    iPatch                   = int.Parse(branchInfo.Entries["PATCH_VERSION"]);
            string sReleaseSuffix           = branchInfo.Entries["RELEASE_SUFFIX"];
            bool   fStabilizePackageVersion = bool.Parse(branchInfo.Entries["STABILIZE_PACKAGE_VERSION"]);
            bool   fValidateHostPackages    = bool.Parse(branchInfo.Entries["VALIDATE_HOST_PACKAGES"]);
            bool   fLockHostVersion         = bool.Parse(branchInfo.Entries["LOCK_HOST_VERSION"]);

            var hostVersion = new HostVersion()
            {
                Major               = iMajor,
                Minor               = iMinor,
                Patch               = iPatch,
                ReleaseSuffix       = sReleaseSuffix,
                EnsureStableVersion = fStabilizePackageVersion,
                IsLocked            = fLockHostVersion,
                CommitCount         = commitCount
            };

            var buildVersion = new BuildVersion()
            {
                Major         = iMajor,
                Minor         = iMinor,
                Patch         = iPatch,
                ReleaseSuffix = sReleaseSuffix,
                CommitCount   = commitCount
            };

            c.BuildContext["ValidateHostPackages"] = fValidateHostPackages;
            c.BuildContext["BuildVersion"]         = buildVersion;
            c.BuildContext["HostVersion"]          = hostVersion;
            c.BuildContext["CommitHash"]           = commitHash;
            c.BuildContext["BranchName"]           = branchInfo.Entries["BRANCH_NAME"];

            // Define the version string to be used based upon whether we are stabilizing the versions or not.
            if (!fStabilizePackageVersion)
            {
                c.BuildContext["SharedFrameworkNugetVersion"] = buildVersion.NetCoreAppVersion;
            }
            else
            {
                c.BuildContext["SharedFrameworkNugetVersion"] = buildVersion.ProductionVersion;
            }

            c.Info($"Building Version: {hostVersion.LatestHostVersion.WithoutSuffix} (NuGet Packages: {hostVersion.LatestHostVersion})");
            c.Info($"From Commit: {commitHash}");

            return(c.Success());
        }
Example #31
0
 public BranchInfo(BranchInfo previousBranch, int sourceIndex, int lastTargetIndex)
 {
     if (previousBranch == null)
     {
         throw new ArgumentNullException("previousBranch");
     }
     this.indexes         = previousBranch.indexes + sourceIndex.ToString(); //this one eat memory
     this.lastTargetIndex = lastTargetIndex;
 }
        public GUBPBranchConfig(IEnumerable<UnrealTargetPlatform> InHostPlatforms, string InBranchName, BranchInfo InBranch, GUBPBranchHacker.BranchOptions InBranchOptions, bool bInForceIncrementalCompile, JobInfo JobInfo)
		{
			HostPlatforms = new List<UnrealTargetPlatform>(InHostPlatforms);
			BranchName = InBranchName;
			Branch = InBranch;
			BranchOptions = InBranchOptions;
			bForceIncrementalCompile = bInForceIncrementalCompile;
			this.JobInfo = JobInfo;
		}
Example #33
0
        public void Ctor_PopulatesEmpty_Release()
        {
            // Arrange / Act
            var sut = new BranchInfo();

            // Assert
            sut.Release.Should().BeEmpty();
            sut.Overrides.Should().BeEmpty();
        }
Example #34
0
 public bool predictBranch(BranchInfo branch)
 {
     branchIndex = branch.address % numberOfBranchLocations;
     if (states[branchIndex] >= 0)
     {
         return(true);
     }
     return(false);
 }
        void IBranchMenuOperations.SwitchToBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            mBranchOperations.SwitchToBranch(
                repSpec,
                branchInfo,
                RefreshAsset.UnityAssetDatabase);
        }
		public GUBPBranchConfig(int InCL, IEnumerable<UnrealTargetPlatform> InHostPlatforms, string InBranchName, BranchInfo InBranch, GUBPBranchHacker.BranchOptions InBranchOptions, bool bInForceIncrementalCompile, bool bInPreflightBuild, string InPreflightMangleSuffix)
		{
			CL = InCL;
			HostPlatforms = new List<UnrealTargetPlatform>(InHostPlatforms);
			BranchName = InBranchName;
			Branch = InBranch;
			BranchOptions = InBranchOptions;
			bForceIncrementalCompile = bInForceIncrementalCompile;
			bPreflightBuild = bInPreflightBuild;
			PreflightMangleSuffix = InPreflightMangleSuffix;
		}
Example #37
0
 public static string StaticGetFullName(UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, string InAggregateName)
 {
     return InGameProj.GameName + "_" + InAggregateName + StaticGetHostPlatformSuffix(InHostPlatform);
 }
Example #38
0
        public GameAggregateNode(UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, string InAggregateName, List<string> Dependencies)
            : base(InHostPlatform)
        {
            GameProj = InGameProj;
            AggregateName = InAggregateName;

            foreach (var Dep in Dependencies)
            {
                AddDependency(Dep);
            }
        }
Example #39
0
        public static string StaticGetFullName(UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InTargetPlatform, bool WithXp = false, bool Precompiled = false)
        {
			string Name = InGameProj.GameName;
			if(WithXp)
			{
				Name += "_WinXP_Mono";
			}
			else
			{
				Name += "_" + InTargetPlatform + "_Mono";
			}
			if(Precompiled)
			{
				Name += "_Precompiled";
			}
			return Name + StaticGetHostPlatformSuffix(InHostPlatform);
        }
 public void InstallPackages(BranchInfo branch)
 {
     this.FileExecution.ExecuteInCmd(this.Settings.AdeNetExePath, string.Format("-workingdirectory {0} -deploy -development", this.Convention.GetLocalPath(branch)));
 }
 public void DeployTestData(BranchInfo branch, string strConnectionString)
 {
     this.FileExecution.ExecuteInCmd(this.Settings.AdeNetExePath,
                                     string.Format(@"-workingdirectory {0} -dd Test {1} -development -connectionstring ""{2}""", this.Convention.GetLocalPath(branch), branch.TeamProject,
                                                   strConnectionString));
 }
Example #42
0
        internal void FixupBranches(BlobBuilder srcBuilder, BlobBuilder dstBuilder)
        {
            int srcOffset = 0;
            var branch = _branches[0];
            int branchIndex = 0;
            int blobOffset = 0;
            foreach (Blob blob in srcBuilder.GetBlobs())
            {
                Debug.Assert(blobOffset == 0 || blobOffset == 1 && blob.Buffer[blobOffset - 1] == 0xff);

                while (true)
                {
                    // copy bytes preceding the next branch, or till the end of the blob:
                    int chunkSize = Math.Min(branch.ILOffset - srcOffset, blob.Length - blobOffset);
                    dstBuilder.WriteBytes(blob.Buffer, blobOffset, chunkSize);
                    srcOffset += chunkSize;
                    blobOffset += chunkSize;

                    // there is no branch left in the blob:
                    if (blobOffset == blob.Length)
                    {
                        blobOffset = 0;
                        break;
                    }

                    Debug.Assert(blob.Buffer[blobOffset] == branch.ShortOpCode && (blobOffset + 1 == blob.Length || blob.Buffer[blobOffset + 1] == 0xff));
                    srcOffset += sizeof(byte) + sizeof(sbyte);

                    // write actual branch instruction:
                    int branchDistance;
                    if (branch.IsShortBranchDistance(_labels, out branchDistance))
                    {
                        dstBuilder.WriteByte(branch.ShortOpCode);
                        dstBuilder.WriteSByte((sbyte)branchDistance);
                    }
                    else
                    {
                        dstBuilder.WriteByte((byte)((ILOpCode)branch.ShortOpCode).GetLongBranch());
                        dstBuilder.WriteInt32(branchDistance);
                    }

                    // next branch:
                    branchIndex++;
                    if (branchIndex == _branches.Count)
                    {
                        branch = new BranchInfo(int.MaxValue, default(LabelHandle), 0);
                    }
                    else
                    {
                        branch = _branches[branchIndex];
                    }

                    // the branch starts at the very end and its operand is in the next blob:
                    if (blobOffset == blob.Length - 1)
                    {
                        blobOffset = 1;
                        break;
                    }

                    // skip fake branch instruction:
                    blobOffset += sizeof(byte) + sizeof(sbyte);
                }
            }
        }
Example #43
0
        public FormalBuildNode(GUBP.GUBPBranchConfig InBranchConfig,
            BranchInfo.BranchUProject InGameProj,
            UnrealTargetPlatform InHostPlatform,
            List<UnrealTargetPlatform> InClientTargetPlatforms = null,
            List<UnrealTargetConfiguration> InClientConfigs = null,
            List<UnrealTargetPlatform> InServerTargetPlatforms = null,
            List<UnrealTargetConfiguration> InServerConfigs = null,
            bool InClientNotGame = false
            )
            : base(InHostPlatform)
        {
			BranchConfig = InBranchConfig;
            GameProj = InGameProj;
            ClientTargetPlatforms = InClientTargetPlatforms;
            ServerTargetPlatforms = InServerTargetPlatforms;
            ClientConfigs = InClientConfigs;
            ServerConfigs = InServerConfigs;
            ClientNotGame = InClientNotGame;

            GameOrClient = TargetRules.TargetType.Game;

            if (ClientNotGame)
            {
                GameOrClient = TargetRules.TargetType.Client;
            }
			if (InGameProj.GameName != BranchConfig.Branch.BaseEngineProject.GameName && GameProj.Properties.Targets.ContainsKey(TargetRules.TargetType.Editor))
			{
				bIsCode = true;
			}
			else
			{
				bIsCode = false;
			}

            // verify we actually built these
            var WorkingGameProject = InGameProj;
            if (!WorkingGameProject.Properties.Targets.ContainsKey(TargetRules.TargetType.Editor))
            {
                // this is a codeless project, use the base project
                WorkingGameProject = BranchConfig.Branch.BaseEngineProject;
            }

            var AllTargetPlatforms = new List<UnrealTargetPlatform>();					
            if (ClientTargetPlatforms != null)
            {
                if (!WorkingGameProject.Properties.Targets.ContainsKey(GameOrClient))
                {
                    throw new AutomationException("Can't make a game build for {0} because it doesn't have a {1} target.", WorkingGameProject.GameName, GameOrClient.ToString());
                }

                foreach (var Plat in ClientTargetPlatforms)
                {
                    if (!AllTargetPlatforms.Contains(Plat))
                    {
                        AllTargetPlatforms.Add(Plat);
                    }
                }
                if (ClientConfigs == null)
                {
                    ClientConfigs = new List<UnrealTargetConfiguration>() { UnrealTargetConfiguration.Development };
                }
                foreach (var Plat in ClientTargetPlatforms)
                {
                    if (!WorkingGameProject.Properties.Targets[GameOrClient].Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform).Contains(Plat))
                    {
                        throw new AutomationException("Can't make a game/client build for {0} because we didn't build platform {1}.", WorkingGameProject.GameName, Plat.ToString());
                    }
                    foreach (var Config in ClientConfigs)
                    {
                        if (!WorkingGameProject.Properties.Targets[GameOrClient].Rules.GUBP_GetConfigs_MonolithicOnly(HostPlatform, Plat).Contains(Config))
                        {
                            throw new AutomationException("Can't make a game/client build for {0} because we didn't build platform {1} config {2}.", WorkingGameProject.GameName, Plat.ToString(), Config.ToString());
                        }						
                    }
                }
            }
            if (ServerTargetPlatforms != null)
            {
                if (!WorkingGameProject.Properties.Targets.ContainsKey(TargetRules.TargetType.Server) && ServerTargetPlatforms != null)
                {
                    throw new AutomationException("Can't make a server build for {0} because it doesn't have a server target.", WorkingGameProject.GameName);
                }
                foreach (var Plat in ServerTargetPlatforms)
                {
                    if (!AllTargetPlatforms.Contains(Plat))
                    {
                        AllTargetPlatforms.Add(Plat);
                    }
                }
                if (ServerConfigs == null)
                {
                    ServerConfigs = new List<UnrealTargetConfiguration>() { UnrealTargetConfiguration.Development };
                }
                foreach (var Plat in ServerTargetPlatforms)
                {
                    if (!WorkingGameProject.Properties.Targets[TargetRules.TargetType.Server].Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform).Contains(Plat))
                    {
                        throw new AutomationException("Can't make a server build for {0} because we didn't build platform {1}.", WorkingGameProject.GameName, Plat.ToString());
                    }
                    foreach (var Config in ServerConfigs)
                    {
                        if (!WorkingGameProject.Properties.Targets[TargetRules.TargetType.Server].Rules.GUBP_GetConfigs_MonolithicOnly(HostPlatform, Plat).Contains(Config))
                        {
                            throw new AutomationException("Can't make a server build for {0} because we didn't build platform {1} config {2}.", WorkingGameProject.GameName, Plat.ToString(), Config.ToString());
                        }
                    }
                }
            }

            // add dependencies for cooked and compiled
            foreach (var Plat in AllTargetPlatforms)
            {
                AddDependency(GamePlatformCookedAndCompiledNode.StaticGetFullName(HostPlatform, GameProj, Plat));
            }
        }
Example #44
0
 public static string StaticGetFullName(UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InTargetPlatform)
 {
     return InGameProj.GameName + "_" + InTargetPlatform + "_CookedAndCompiled" + StaticGetHostPlatformSuffix(InHostPlatform);
 }
Example #45
0
        public GamePlatformCookedAndCompiledNode(GUBP.GUBPBranchConfig BranchConfig, UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InTargetPlatform, bool bCodeProject)
            : base(InHostPlatform)
        {
            GameProj = InGameProj;
            TargetPlatform = InTargetPlatform;

            foreach (var Kind in BranchInfo.MonolithicKinds)
            {
                if (bCodeProject)
                {
                    if (GameProj.Properties.Targets.ContainsKey(Kind))
                    {
                        var Target = GameProj.Properties.Targets[Kind];
                        var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform);
                        if (Platforms.Contains(TargetPlatform) && Target.Rules.SupportsPlatform(TargetPlatform))
                        {
                            //@todo how do we get the client target platform?
                            string CookedPlatform = Platform.Platforms[TargetPlatform].GetCookPlatform(Kind == TargetRules.TargetType.Server, Kind == TargetRules.TargetType.Client, "");
							if (Target.Rules.GUBP_AlternateCookPlatform(HostPlatform, CookedPlatform) != "")
							{
								CookedPlatform = Target.Rules.GUBP_AlternateCookPlatform(HostPlatform, CookedPlatform);
							}
                            AddDependency(CookNode.StaticGetFullName(HostPlatform, GameProj, CookedPlatform));
                            AddDependency(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, GameProj, TargetPlatform));
							if(Target.Rules.GUBP_BuildWindowsXPMonolithics())
							{
								AddDependency(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, GameProj, TargetPlatform, true));
							}
						}
					}
                }
                else
                {
                    if (Kind == TargetRules.TargetType.Game) //for now, non-code projects don't do client or server.
                    {
                        if (BranchConfig.Branch.BaseEngineProject.Properties.Targets.ContainsKey(Kind))
                        {
                            var Target = BranchConfig.Branch.BaseEngineProject.Properties.Targets[Kind];
                            var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform);
                            if (Platforms.Contains(TargetPlatform) && Target.Rules.SupportsPlatform(TargetPlatform))
                            {
                                //@todo how do we get the client target platform?
                                string CookedPlatform = Platform.Platforms[TargetPlatform].GetCookPlatform(Kind == TargetRules.TargetType.Server, Kind == TargetRules.TargetType.Client, "");
                                AddDependency(CookNode.StaticGetFullName(HostPlatform, GameProj, CookedPlatform));
                                AddDependency(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, TargetPlatform));
                            }
                        }
                    }
                }
            }
        }
Example #46
0
        public CookNode(GUBPBranchConfig BranchConfig, UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InTargetPlatform, string InCookPlatform)
            : base(InHostPlatform)
        {
            GameProj = InGameProj;
            TargetPlatform = InTargetPlatform;
            CookPlatform = InCookPlatform;
            bIsMassive = false;
            AddDependency(EditorAndToolsNode.StaticGetFullName(HostPlatform));
            bool bIsShared = false;
            // is this the "base game" or a non code project?
            if (InGameProj.GameName != BranchConfig.Branch.BaseEngineProject.GameName && GameProj.Properties.Targets.ContainsKey(TargetRules.TargetType.Editor))
            {
                var Options = InGameProj.Options(HostPlatform);
                bIsMassive = Options.bIsMassive;				
                AddDependency(EditorGameNode.StaticGetFullName(HostPlatform, GameProj));
                // add an arc to prevent cooks from running until promotable is labeled
                if (Options.bIsPromotable)
                {
                    if (!Options.bSeparateGamePromotion)
                    {
                        bIsShared = true;
                    }
                }
                else if (Options.bTestWithShared)
                {
                    bIsShared = true;
                }
				if (!BranchConfig.BranchOptions.bNoMonolithicDependenciesForCooks)
				{
					AddPseudodependency(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, GameProj, TargetPlatform));
				}
            }
            else
            {
                bIsShared = true;				
                AddPseudodependency(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, TargetPlatform));
            }
            if (bIsShared)
            {
                // add an arc to prevent cooks from running until promotable is labeled
                AddPseudodependency(WaitForTestShared.StaticGetFullName());
                AgentSharingGroup = "SharedCooks" + StaticGetHostPlatformSuffix(HostPlatform);

                // If the cook fails for the base engine, don't bother trying
                if (InGameProj.GameName != BranchConfig.Branch.BaseEngineProject.GameName && BranchConfig.HasNode(CookNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, CookPlatform)))
                {
                    AddPseudodependency(CookNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, CookPlatform));
                }

                // If the base cook platform fails, don't bother trying other ones
                string BaseCookedPlatform = Platform.Platforms[HostPlatform].GetCookPlatform(false, false, "");
                if (InGameProj.GameName == BranchConfig.Branch.BaseEngineProject.GameName && CookPlatform != BaseCookedPlatform &&
                    BranchConfig.HasNode(CookNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, BaseCookedPlatform)))
                {
                    AddPseudodependency(CookNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, BaseCookedPlatform));
                }
            }

			if(GamePlatformMonolithicsNode.IsSample(BranchConfig, GameProj))
			{
				AddDependency(WaitToPackageSamplesNode.StaticGetFullName());
				AgentSharingGroup = "SampleCooks" + StaticGetHostPlatformSuffix(HostPlatform);
			}
        }
Example #47
0
		public static string StaticGetBuildDependenciesPath(UnrealTargetPlatform HostPlatform, BranchInfo.BranchUProject GameProj, UnrealTargetPlatform TargetPlatform)
	{
			return CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "Engine", "Saved", "Precompiled", "BuildDependencies-" + StaticGetFullName(HostPlatform, GameProj, TargetPlatform) + ".xml");
		}
Example #48
0
		public static string StaticGetArchivedHeadersPath(UnrealTargetPlatform HostPlatform, BranchInfo.BranchUProject GameProj, UnrealTargetPlatform TargetPlatform)
		{
			return CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "Engine", "Saved", "Precompiled", "Headers-" + StaticGetFullName(HostPlatform, GameProj, TargetPlatform) + ".zip");
    }
Example #49
0
		public static bool HasPrecompiledTargets(BranchInfo.BranchUProject Project, UnrealTargetPlatform HostPlatform, UnrealTargetPlatform TargetPlatform)
		{
            foreach(TargetRules.TargetType Kind in BranchInfo.MonolithicKinds)
            {
                if (Project.Properties.Targets.ContainsKey(Kind))
                {
                    SingleTargetProperties Target = Project.Properties.Targets[Kind];
					if(Target.Rules.GUBP_GetConfigsForPrecompiledBuilds_MonolithicOnly(HostPlatform, TargetPlatform).Any())
					{
						return true;
					}
				}
			}
			return false;
		}
Example #50
0
		public static bool IsSample(GUBPBranchConfig BranchConfig, BranchInfo.BranchUProject GameProj)
		{
			return (GameProj.GameName != BranchConfig.Branch.BaseEngineProject.GameName && (GameProj.FilePath.Contains("Samples") || GameProj.FilePath.Contains("Templates")));
		}
        public bool Save(BaseInfo baseInfo, PageMode.Mode pageMode, bool saveLog, BranchInfo.BranchType branchType)
        {
            ApplyContainerInfo info = (ApplyContainerInfo)baseInfo;
            switch (pageMode)
            {
                case PageMode.Mode.CREATE:
                    Insert(info);
                    break;
                case PageMode.Mode.VIEW:
                case PageMode.Mode.TASK:
                case PageMode.Mode.EDIT:
                    Update(info);
                    break;

                default:
                    break;
            }

            if (saveLog)
            {
                SaveLog(info.ModuleID, info.ApplyContainerID);
            }
            // PLM_TODO mesure data is saved
            return true;
        }
Example #52
0
 public static string StaticGetFullName(BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InHostPlatform, List<UnrealTargetPlatform> InClientTargetPlatforms = null, List<UnrealTargetConfiguration> InClientConfigs = null, List<UnrealTargetPlatform> InServerTargetPlatforms = null, List<UnrealTargetConfiguration> InServerConfigs = null, bool InClientNotGame = false)
 {
     string Infix = "";
     if (InClientNotGame)
     {
         if (InClientTargetPlatforms != null && InClientTargetPlatforms.Count == 1)
         {
             Infix = "_Client_" + InClientTargetPlatforms[0].ToString();
         }
         if (InClientConfigs != null && InClientConfigs.Count == 1)
         {
             Infix += "_Client_" + InClientConfigs[0].ToString();
         }
     }
     else
     {
         if (InClientTargetPlatforms != null && InClientTargetPlatforms.Count == 1)
         {
             Infix = "_" + InClientTargetPlatforms[0].ToString();
         }
         if (InClientConfigs != null && InClientConfigs.Count == 1)
         {
             Infix += "_" + InClientConfigs[0].ToString();
         }
     }
     if (InServerTargetPlatforms != null && InServerTargetPlatforms.Count == 1)
     {
         Infix = "_Serv_" + InServerTargetPlatforms[0].ToString();
     }
     if (InServerConfigs != null && InServerConfigs.Count == 1)
     {
         Infix += "_Serv_" + InServerConfigs[0].ToString();
     }
     return InGameProj.GameName + Infix + "_MakeBuild" + HostPlatformNode.StaticGetHostPlatformSuffix(InHostPlatform);
 }
Example #53
0
		public static string GetArchiveDirectory(GUBP.GUBPBranchConfig BranchConfig, BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InHostPlatform, List<UnrealTargetPlatform> InClientTargetPlatforms = null, List<UnrealTargetConfiguration> InClientConfigs = null, List<UnrealTargetPlatform> InServerTargetPlatforms = null, List<UnrealTargetConfiguration> InServerConfigs = null, bool InClientNotGame = false)
        {
            string BaseDir = TempStorage.ResolveSharedBuildDirectory(InGameProj.GameName);
            string NodeName = StaticGetFullName(InGameProj, InHostPlatform, InClientTargetPlatforms, InClientConfigs, InServerTargetPlatforms, InServerConfigs, InClientNotGame);
            string Inner = P4Env.BuildRootEscaped + "-CL-" + P4Env.ChangelistString + BranchConfig.JobInfo.GetPreflightSuffix();
            string ArchiveDirectory = CombinePaths(BaseDir, NodeName, Inner);
            return ArchiveDirectory;
        }
Example #54
0
        public FormalBuildTestNode(GUBP.GUBPBranchConfig InBranchConfig,
            BranchInfo.BranchUProject InGameProj,
            UnrealTargetPlatform InHostPlatform,
            UnrealTargetPlatform InClientTargetPlatform,
            UnrealTargetConfiguration InClientConfig
            )
            : base(InHostPlatform)
        {
			BranchConfig = InBranchConfig;
            GameProj = InGameProj;
            ClientTargetPlatform = InClientTargetPlatform;
            ClientConfig = InClientConfig;
            GameOrClient = TargetRules.TargetType.Game;

            // verify we actually built these
            var WorkingGameProject = InGameProj;
            if (!WorkingGameProject.Properties.Targets.ContainsKey(TargetRules.TargetType.Editor))
            {
                // this is a codeless project, use the base project
                WorkingGameProject = BranchConfig.Branch.BaseEngineProject;
            }
            if (!WorkingGameProject.Properties.Targets.ContainsKey(GameOrClient))
            {
                throw new AutomationException("Can't make a game build for {0} because it doesn't have a {1} target.", WorkingGameProject.GameName, GameOrClient.ToString());
            }

            if (!WorkingGameProject.Properties.Targets[GameOrClient].Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform).Contains(ClientTargetPlatform))
            {
                throw new AutomationException("Can't make a game/client build for {0} because we didn't build platform {1}.", WorkingGameProject.GameName, ClientTargetPlatform.ToString());
            }
            if (!WorkingGameProject.Properties.Targets[GameOrClient].Rules.GUBP_GetConfigs_MonolithicOnly(HostPlatform, ClientTargetPlatform).Contains(ClientConfig))
            {
                throw new AutomationException("Can't make a game/client build for {0} because we didn't build platform {1} config {2}.", WorkingGameProject.GameName, ClientTargetPlatform.ToString(), ClientConfig.ToString());
            }
            AddDependency(FormalBuildNode.StaticGetFullName(GameProj, HostPlatform, new List<UnrealTargetPlatform>() { ClientTargetPlatform }, InClientConfigs: new List<UnrealTargetConfiguration>() { ClientConfig }, InClientNotGame: GameOrClient == TargetRules.TargetType.Client));
        }
 public void BuildWebConfig(BranchInfo branch)
 {
     this.FileExecution.ExecuteInCmd(this.Settings.AdeNetExePath, string.Format("-workingdirectory {0} -buildwebconfig -development", this.Convention.GetLocalPath(branch)));
 }
Example #56
0
 public static string StaticGetFullName(BranchInfo.BranchUProject InGameProj, UnrealTargetPlatform InHostPlatform, UnrealTargetPlatform InClientTargetPlatform, UnrealTargetConfiguration InClientConfig)
 {
     string Infix = "_" + InClientTargetPlatform.ToString();
     Infix += "_" + InClientConfig.ToString();
     return InGameProj.GameName + Infix + "_TestBuild" + HostPlatformNode.StaticGetHostPlatformSuffix(InHostPlatform);
 }
 public void InitializeIIS(BranchInfo branch)
 {
     this.FileExecution.ExecuteInCmd(this.Settings.AdeNetExePath, string.Format("-initializeiis {0} -development", this.Convention.GetLocalPath(branch)));
 }
Example #58
0
        public UATTestNode(GUBPBranchConfig BranchConfig, UnrealTargetPlatform InHostPlatform, BranchInfo.BranchUProject InGameProj, string InTestName, string InUATCommandLine, string InAgentSharingGroup, bool InDependsOnEditor = true, List<UnrealTargetPlatform> InDependsOnCooked = null, float InECPriority = 0.0f)
            : base(InHostPlatform)
        {
            AgentSharingGroup = InAgentSharingGroup;
            ECPriority = InECPriority;
            GameProj = InGameProj;
            TestName = InTestName;
            UATCommandLine = InUATCommandLine;
            bool bWillCook = InUATCommandLine.IndexOf("-cook") >= 0;
            DependsOnEditor = InDependsOnEditor || bWillCook;
            if (InDependsOnCooked != null)
            {
                DependsOnCooked = InDependsOnCooked;
            }
            else
            {
                DependsOnCooked = new List<UnrealTargetPlatform>();
            }
            if (DependsOnEditor)
            {
                AddDependency(EditorAndToolsNode.StaticGetFullName(HostPlatform));
                if (GameProj.GameName != BranchConfig.Branch.BaseEngineProject.GameName)
                {
                    if (GameProj.Properties.Targets.ContainsKey(TargetRules.TargetType.Editor))
                    {
                        AddDependency(EditorGameNode.StaticGetFullName(HostPlatform, GameProj));
                    }
                }
            }
            foreach (var Plat in DependsOnCooked)
            {
                AddDependency(GamePlatformCookedAndCompiledNode.StaticGetFullName(HostPlatform, GameProj, Plat));
            }         
           
            AddPseudodependency(WaitForTestShared.StaticGetFullName());
            // If the same test fails for the base engine, don't bother trying
            if (InGameProj.GameName != BranchConfig.Branch.BaseEngineProject.GameName)
            {
                if (BranchConfig.HasNode(UATTestNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, TestName)))
                {
                    AddPseudodependency(UATTestNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, InTestName));
                }
                else
                {
                    bool bFoundACook = false;
                    foreach (var Plat in DependsOnCooked)
                    {
                        var PlatTestName = "CookedGameTest_"  + Plat.ToString();
                        if (BranchConfig.HasNode(UATTestNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, PlatTestName)))
                        {
                            AddPseudodependency(UATTestNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, PlatTestName));
                            bFoundACook = true;
                        }
                    }

                    if (!bFoundACook && BranchConfig.HasNode(UATTestNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, "EditorTest")))
                    {
                        AddPseudodependency(UATTestNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, "EditorTest"));
                    }

                }
            }

            if (InGameProj.GameName == BranchConfig.Branch.BaseEngineProject.GameName)
            {
                ECPriority = ECPriority + 1.0f;
            }
            if (UATCommandLine.IndexOf("-RunAutomationTests", StringComparison.InvariantCultureIgnoreCase) >= 0)
            {
                ECPriority = ECPriority - 4.0f;
                if (UATCommandLine.IndexOf("-EditorTest", StringComparison.InvariantCultureIgnoreCase) >= 0)
                {
                    ECPriority = ECPriority - 4.0f;
                }
            }
            else if (UATCommandLine.IndexOf("-EditorTest", StringComparison.InvariantCultureIgnoreCase) >= 0)
            {
                ECPriority = ECPriority + 2.0f;
            }

        }
 public void MigrateDatabase(BranchInfo branch, string strConnectionString)
 {
     this.FileExecution.ExecuteInCmd(this.Settings.AdeNetExePath,
                                     string.Format(@"-workingdirectory {0} -migratedb -development -connectionstring ""{1}""", this.Convention.GetLocalPath(branch), strConnectionString));
 }
Example #60
0
		public static List<UnrealTargetPlatform> GetMonolithicPlatformsForUProject(UnrealTargetPlatform HostPlatform, List<UnrealTargetPlatform> ActivePlatforms, BranchInfo.BranchUProject GameProj, bool bIncludeHostPlatform, bool bNoIOSOnPC)
		{
			UnrealTargetPlatform AltHostPlatform = GUBP.GetAltHostPlatform(HostPlatform);
			var Result = new List<UnrealTargetPlatform>();
			foreach (var Kind in BranchInfo.MonolithicKinds)
			{
				if (GameProj.Properties.Targets.ContainsKey(Kind))
				{
					var Target = GameProj.Properties.Targets[Kind];
					var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform);
					var AdditionalPlatforms = Target.Rules.GUBP_GetBuildOnlyPlatforms_MonolithicOnly(HostPlatform);
					var AllPlatforms = Platforms.Union(AdditionalPlatforms);
					foreach (var Plat in AllPlatforms)
					{
						if (bNoIOSOnPC && Plat == UnrealTargetPlatform.IOS && HostPlatform == UnrealTargetPlatform.Win64)
						{
							continue;
						}

						if (ActivePlatforms.Contains(Plat) && Target.Rules.SupportsPlatform(Plat) &&
							((Plat != HostPlatform && Plat != AltHostPlatform) || bIncludeHostPlatform))
						{
							Result.Add(Plat);
						}
					}
				}
			}
			return Result;
		}