本文整理汇总了Java中jetbrains.buildServer.serverSide.SProject类的典型用法代码示例。如果您正苦于以下问题:Java SProject类的具体用法?Java SProject怎么用?Java SProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SProject类属于jetbrains.buildServer.serverSide包,在下文中一共展示了SProject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public static ProjectMsTeamsNotificationsBean build(MsTeamsNotificationProjectSettings projSettings, SProject project, MsTeamsNotificationMainSettings mainSettings){
ProjectMsTeamsNotificationsBean bean = new ProjectMsTeamsNotificationsBean();
List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project);
bean.projectId = TeamCityIdResolver.getInternalProjectId(project);
bean.msTeamsNotificationList = new LinkedHashMap<String, MsTeamsnotificationConfigAndBuildTypeListHolder>();
/* Create a "new" config with blank stuff so that clicking the "new" button has a bunch of defaults to load in */
MsTeamsNotificationConfig newBlankConfig = new MsTeamsNotificationConfig("", true, new BuildState().setAllEnabled(), true, true, null, true, true);
newBlankConfig.setUniqueKey("new");
/* And add it to the list */
addMsTeamsNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings);
/* Iterate over the rest of the msteamsnotifications in this project and add them to the json config */
for (MsTeamsNotificationConfig config : projSettings.getMsTeamsNotificationsAsList()){
addMsTeamsNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings);
}
return bean;
}
示例2: getReposList
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
private List<DebRepositoryConfigProjectAndStatsWrapper> getReposList() {
List<DebRepositoryConfigProjectAndStatsWrapper> configs = new ArrayList<>();
for (DebRepositoryConfiguration config : myDebRepositoryConfigurationManager.getAllConfigurations()) {
SProject project = myBuildServer.getProjectManager().findProjectById(config.getProjectId());
boolean permissioned = AuthUtil.hasPermissionToManageProject(mySecurityContext.getAuthorityHolder(), project.getProjectId());
configs.add(
new DebRepositoryConfigProjectAndStatsWrapper(project,
config,
myDebRepositoryManager.getRepositoryStatistics(
config,
StringUtils.getDebRepoUrl(
myServer.getRootUrl(),
config.getRepoName(),
config.isRestricted())
),
permissioned)
);
}
return configs;
}
示例3: build
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public static EditDebRepositoryBean build(@NotNull ProjectManager projectManager, @NotNull final DebRepositoryConfiguration repoConfig, @NotNull SProject sproject) {
EditDebRepositoryBean bean = new EditDebRepositoryBean(repoConfig, sproject);
for (DebRepositoryBuildTypeConfig btConfig : repoConfig.getBuildTypes()) {
SBuildType sBuildType = projectManager.findBuildTypeById(btConfig.getBuildTypeId());
if (sBuildType != null) {
List<FilterAndBuildType> filterAndBuildTypes = new ArrayList<>();
for (Filter f : btConfig.getDebFilters()) {
filterAndBuildTypes.add(new FilterAndBuildType(sBuildType.getBuildTypeId(), f));
}
bean.filtersAndBuildTypes.put(new BuildTypeData(sBuildType.getExternalId(),
sBuildType.getName(),
sBuildType.getProjectExternalId(),
sBuildType.getProjectName(),
sBuildType.getFullName()
),
filterAndBuildTypes);
}
}
bean.defaultAllArchitectures = repoConfig.getDefaultArchitecturesRepresentedByAll();
bean.allArchitectures = repoConfig.getArchitecturesRepresentedByAll();
return bean;
}
示例4: getPackageStoresForBuildType
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
@Override
public List<DebPackageStore> getPackageStoresForBuildType(String buildTypeid) throws NonExistantRepositoryException {
SBuildType sBuildType = myProjectManager.findBuildTypeById(buildTypeid);
List<SProject> projectPathList = this.myProjectManager.findProjectById(sBuildType.getProjectId()).getProjectPath();
List<DebPackageStore> stores = new ArrayList<>();
//Collections.reverse(projectPathList);
for (SProject sProject : projectPathList) {
for (DebRepositoryConfiguration meta : repositoryMetaData.values()){
if (meta.getProjectId().equals(sProject.getProjectId()) && meta.containsBuildType(buildTypeid)){
if (repositories.containsKey(meta.getUuid())){
stores.add(repositories.get(meta.getUuid()));
} else {
throw new NonExistantRepositoryException();
}
}
}
}
return stores;
}
示例5: editServer
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
@NotNull
@Override
public SQSActionResult editServer(@NotNull SProject project, @NotNull SQSInfo sqsInfo) {
SQSInfo init = mySQSManagerProjectFeatures.getServer(project, sqsInfo.getId());
if (init == null) {
init = mySQSManagerImpl.getServer(project, sqsInfo.getId());
if (init != null) {
migrate(project, sqsInfo);
return new SQSActionResult(init, sqsInfo, "SonarQube Server '" + sqsInfo.getName() + "' updated and moved to project features");
} else {
return new SQSActionResult(null, null, "Cannot edit: SonarQube Server with id '" + sqsInfo.getId() + "' was not found", true);
}
} else {
return mySQSManagerProjectFeatures.editServer(project, sqsInfo);
}
}
示例6: removeServerInfo
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
private SQSInfo removeServerInfo(@NotNull final HttpServletRequest request,
@NotNull final SProject project,
@NotNull final Element ajaxResponse) throws IOException {
final String serverinfoId = getServerInfoId(request);
if (serverinfoId == null) {
ajaxResponse.setAttribute("error", "ID is not set");
} else {
final SQSManager.SQSActionResult result = mySqsManager.removeServer(project, serverinfoId);
if (!result.isError()) {
ajaxResponse.setAttribute("status", result.getReason());
return result.getBeforeAction();
} else {
ajaxResponse.setAttribute("error", result.getReason());
}
}
return null;
}
示例7: fillModel
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void fillModel(@NotNull final HttpServletRequest request,
@NotNull final BuildTypeForm form,
@NotNull final Map model) {
SProject project = form.getProject();
final List<SQSInfo> availableServers = mySqsManager.getAvailableServers(project);
model.put("servers", availableServers);
final String sonarServer = getSonarServer(form);
if (Util.isEmpty(sonarServer)) {
model.put("showSelectServer", Boolean.TRUE);
} else if (mySqsManager.getServer(form.getProject(), sonarServer) == null) {
model.put("showUnknownServer", Boolean.TRUE);
}
model.put("project", form.getProject());
}
示例8: setUp
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
myRoot = mock(SProject.class);
when(myRoot.getProjectId()).thenReturn(myRootProjectId);
when(myRoot.getParentProject()).thenReturn(null);
myProject = mock(SProject.class);
when(myProject.getProjectId()).thenReturn(myProjectId);
when(myProject.getParentProject()).thenReturn(myRoot);
mySettingsManager = mock(ProjectSettingsManager.class);
myServerInfo = mockSQSInfo(mySettingsManager, myServerId, myProjectId);
myRootServerInfo = mockSQSInfo(mySettingsManager, myRootServerId, myRootProjectId);
}
示例9: ProjectMonitorViewState
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public ProjectMonitorViewState(SProject project, UserGroup userGroup, PiazzaConfiguration piazzaConfiguration, PiazzaProjectSettings projectSettings, SUser user) {
this.project = project;
this.piazzaConfiguration = piazzaConfiguration;
this.projectSettings = projectSettings;
builds = new ArrayList<>();
for (SBuildType buildType : project.getBuildTypes()) {
if (hasAtLeastOneBuild(buildType)) {
if (buildType.isAllowExternalStatus()) {
builds.add(new BuildTypeMonitorViewState(buildType, userGroup, piazzaConfiguration.isShowOnFailureOnly()));
}
}
}
for (BuildTypeMonitorViewState build : builds) {
committers.addAll(build.getCommitters());
}
featureBranchesView = new FeatureBranchesMonitorViewState(project, projectSettings, getOrderedBuildTypesOfProjectAndSubprojects(project, user));
}
示例10: doHandle
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
@Override
protected ModelAndView doHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws Exception {
SProject project = getProject(request);
if (project != null) {
PiazzaProjectSettings projectSettings = (PiazzaProjectSettings) projectSettingsManager.getSettings(project.getProjectId(), PiazzaProjectSettings.PROJECT_SETTINGS_NAME);
projectSettings.setShowFeatureBranches(getShowFeatureBranchesValueFromView(request));
projectSettings.setMaxNumberOfFeatureBranchesToShow(getMaxNumberOfFeatureBranchesFromView(request));
projectSettings.setMaxAgeInDaysOfFeatureBranches(getMaxAgeInDaysOfFeatureBranchesFromView(request));
updateConfiguration(request, project);
} else {
addPiazzaMessage(request, "Save failed: project not found");
}
return null;
}
示例11: build
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings){
ProjectSlackNotificationsBean bean = new ProjectSlackNotificationsBean();
List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project);
bean.projectId = TeamCityIdResolver.getInternalProjectId(project);
bean.slackNotificationList = new LinkedHashMap<String, SlacknotificationConfigAndBuildTypeListHolder>();
/* Create a "new" config with blank stuff so that clicking the "new" button has a bunch of defaults to load in */
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true);
newBlankConfig.setUniqueKey("new");
/* And add it to the list */
addSlackNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings);
/* Iterate over the rest of the slacknotifications in this project and add them to the json config */
for (SlackNotificationConfig config : projSettings.getSlackNotificationsAsList()){
addSlackNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings);
}
return bean;
}
示例12: ProjectMonitorViewState
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public ProjectMonitorViewState(SProject project, UserGroup userGroup, PiazzaConfiguration configuration, PiazzaProjectSettings projectSettings, SUser user) {
this.project = project;
this.projectSettings = projectSettings;
builds = new ArrayList<>();
for (SBuildType buildType : project.getBuildTypes()) {
if (hasAtLeastOneBuild(buildType)) {
if (buildType.isAllowExternalStatus()) {
builds.add(new BuildTypeMonitorViewState(buildType, userGroup, configuration.isShowOnFailureOnly()));
}
}
}
for (BuildTypeMonitorViewState build : builds) {
committers.addAll(build.getCommitters());
}
featureBranchesView = new FeatureBranchesMonitorViewState(project, projectSettings, user.getOrderedBuildTypes(project));
}
示例13: getProjectId
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public static String getProjectId(SProject project){
try {
return project.getExternalId();
} catch (NoSuchMethodError ex) {
LOGGER.log(Level.INFO,ex.getMessage(),ex);
return project.getProjectId();
}
}
示例14: getExternalProjectId
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public static String getExternalProjectId(SProject project){
try {
return project.getExternalId();
} catch (NoSuchMethodError ex) {
LOGGER.log(Level.INFO,ex.getMessage(),ex);
return project.getProjectId();
}
}
示例15: getExternalProjectIdOrNull
import jetbrains.buildServer.serverSide.SProject; //导入依赖的package包/类
public static String getExternalProjectIdOrNull(SProject project){
try {
return project.getExternalId();
} catch (NoSuchMethodError ex) {
LOGGER.log(Level.INFO,ex.getMessage(),ex);
return null;
}
}