本文整理汇总了Java中jetbrains.buildServer.serverSide.SBuildType类的典型用法代码示例。如果您正苦于以下问题:Java SBuildType类的具体用法?Java SBuildType怎么用?Java SBuildType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SBuildType类属于jetbrains.buildServer.serverSide包,在下文中一共展示了SBuildType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的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: showBuildScanInfo
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@SuppressWarnings("RedundantIfStatement")
@Override
public boolean showBuildScanInfo(@NotNull SBuild build) {
SBuildType buildType = build.getBuildType();
// note that buildType.getBuildRunners() returns all configured runners while
// buildType.getRunnerTypes() returns only the runners that are enabled,
// since the buildType instance always reflects the _current_ configuration rather
// than the configuration at the time the build was run, we need to be defensive here and
// show the info even when the runner could have been disabled in the given build
List<String> runnerTypes = buildType == null ? Collections.emptyList() : buildType.getBuildRunners()
.stream()
.map(r -> r.getRunType().getType())
.collect(Collectors.toList());
if (runnerTypes.contains(GRADLE_RUNNER)) {
return true;
} else if (runnerTypes.contains(SIMPLE_RUNNER) && !buildScanLookup.getBuildScansForBuild(build).isEmpty()) {
return true;
} else {
return false;
}
}
开发者ID:etiennestuder,项目名称:teamcity-build-scan-plugin,代码行数:24,代码来源:DefaultBuildScanDisplayArbiter.java
示例3: build
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的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: removePackage
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@Override
public boolean removePackage(DebPackage debPackage) {
DebPackageEntity entity = DebPackageEntity.copy(debPackage);
SBuildType sBuildType = myProjectManager.findBuildTypeById(entity.getBuildTypeId());
List<DebPackageStore> stores;
try {
stores = this.myDebRepositoryManager.getPackageStoresForBuildType(sBuildType.getBuildTypeId());
} catch (NonExistantRepositoryException e) {
Loggers.SERVER.warn("MapBackedDebRepositoryDatabase: No repo found for project: " + sBuildType.getProjectId());
Loggers.SERVER.debug(e);
return false;
}
for (DebPackageStore store : stores) {
store.remove(entity.buildKey());
this.myDebRepositoryManager.persist(store.getUuid());
}
return true;
}
示例5: getPackageStoresForBuildType
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的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;
}
示例6: setUp
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@BeforeMethod
public void setUp()
{
myCtx = new Mockery();
myServerExtensionHolder = myCtx.mock(ServerExtensionHolder.class);
myBuildDataStorage = myCtx.mock(BuildDataStorage.class);
myMetricComparer = myCtx.mock(MetricComparer.class);
myStatisticKeyFactory = myCtx.mock(StatisticKeyFactory.class);
myStatisticProvider = myCtx.mock(StatisticProvider.class);
myHistory = myCtx.mock(History.class);
myRunningBuild = myCtx.mock(SRunningBuild.class);
myBuildType = myCtx.mock(SBuildType.class);
buildMessage1 = new BuildMessage1("sourceId", "typeId", Status.NORMAL, new Date(1234567), "value", Arrays.asList("a", "b"));
myBuild1 = myCtx.mock(SFinishedBuild.class, "Build1");
myBuild2 = myCtx.mock(SFinishedBuild.class, "Build2");
myHistoryElement1 = myCtx.mock(HistoryElement.class, "HistoryElement1");
myHistoryElement2 = myCtx.mock(HistoryElement.class, "HistoryElement2");
}
示例7: fillModel
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@Override
protected void fillModel(@NotNull Map<String, Object> map,
@NotNull HttpServletRequest httpServletRequest,
@NotNull SBuildType sBuildType,
@NotNull SUser sUser) {
/*
* We need to send two things to the tab:
* 1) the list of historical builds
* 2) the parameters of the SinCity feature (if enabled)
*/
List<FinishedBuildWithChanges> buildsWithChanges = FinishedBuildWithChanges.getListFromBuildType(sBuildType);
map.put("buildsWithChanges", buildsWithChanges);
SBuildFeatureDescriptor sinCityFeature = SinCityBuildFeature.getSinCityFeature(sBuildType);
map.put("sinCityParameters", sinCityFeature == null ? null : sinCityFeature.getParameters());
}
示例8: SetUp
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@BeforeMethod
public void SetUp() {
mockery = new Mockery();
buildType = mockery.mock(SBuildType.class, "BuildType");
build1 = mockery.mock(SFinishedBuild.class, "Build1");
build2 = mockery.mock(SFinishedBuild.class, "Build2");
build3 = mockery.mock(SFinishedBuild.class, "Build3");
buildHistory = new ArrayList<SFinishedBuild>();
buildHistory.add(build3);
buildHistory.add(build2);
buildHistory.add(build1);
change1 = mockery.mock(SVcsModification.class, "change1");
change2 = mockery.mock(SVcsModification.class, "change2");
change3 = mockery.mock(SVcsModification.class, "change3");
change4 = mockery.mock(SVcsModification.class, "change4");
mockery.checking(new Expectations() {{
oneOf(buildType).getHistory(null, true, true); will(returnValue(buildHistory));
oneOf(build1).getCanceledInfo(); will(returnValue(null));
oneOf(build2).getCanceledInfo(); will(returnValue(null));
oneOf(build3).getCanceledInfo(); will(returnValue(null));
}});
}
示例9: findSQSInfos
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
/**
* @param buildType Build Configuration
* @return SQSInfo in the Build Configuration or null
*/
@NotNull
private List<SQSInfo> findSQSInfos(@Nullable final SBuildType buildType) {
if (buildType == null) {
return Collections.emptyList();
}
final List<SQSInfo> res = new LinkedList<SQSInfo>();
for (final SBuildRunnerDescriptor r : buildType.getBuildRunners()) {
final String serverId = r.getParameters().get(Constants.SONAR_SERVER_ID);
if (!Util.isEmpty(serverId)) {
final SQSInfo server = mySqsManager.getServer(buildType.getProject(), serverId);
if (server != null) {
res.add(server);
}
}
}
return res;
}
示例10: ProjectMonitorViewState
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的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));
}
示例11: build
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的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: getSoftToInstallDescriptors
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@NotNull
SortedSet<SoftDescriptor> getSoftToInstallDescriptors(final SBuildType bt)
{
final Set<String> names = getSoftToInstallList(bt);
if (names.isEmpty()) return NO_DESCRIPTORS;
SoftModel model = myModelHolder.getModel();
TreeSet<SoftDescriptor> set = new TreeSet<SoftDescriptor>();
for (String name : names) {
SoftDescriptor descriptor = model.getDescriptor(name);
if (descriptor != null) set.add(descriptor);
}
return set.isEmpty() ? NO_DESCRIPTORS : set;
}
示例13: ProjectMonitorViewState
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的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));
}
示例14: should_fail_syntax_error_file
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_syntax_error_file(@NotNull final PowerShellBitness bitness) throws Throwable {
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "callToSomeNonExistentFunction(param1, param2)");
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_LOG_ERR_TO_ERROR, "true");
getBuildType().setOption(SBuildType.BT_FAIL_ON_ANY_ERROR_MESSAGE, true);
final SFinishedBuild build = doTest(null);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isFailed());
}
示例15: should_fail_syntax_error_cmd
import jetbrains.buildServer.serverSide.SBuildType; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_syntax_error_cmd(@NotNull final PowerShellBitness bitness) throws Throwable {
setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "callToSomeNonExistentFunction(param1, param2)");
setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());
setRunnerParameter(PowerShellConstants.RUNNER_LOG_ERR_TO_ERROR, "true");
getBuildType().setOption(SBuildType.BT_FAIL_ON_ANY_ERROR_MESSAGE, true);
final SFinishedBuild build = doTest(null);
dumpBuildLogLocally(build);
Assert.assertTrue(build.getBuildStatus().isFailed());
}