Problem creating persistent Build Configuration

Hi,

I have a server-side plugin that is used to create projects and build configuration. Since 3.0, my build configuration no longer persist after a server restart.

This is my code:

public void createBuildConfig(String project, String name) {
SProject bproj = myServer.getProjectManager().findProjectByName(project);
if (bproj == null) {
logger.error("Could not find project: " + project);
return;
}

SBuildType btype = bproj.findBuildTypeByName(name);
if (btype != null) {
logger.warn("Build Configuration - " + name + " - already exists");
return;
}

SBuildType win32PreRelease = bproj.createBuildType(name, "test", -1, BuildTypeDescriptor.CheckoutType.ON_AGENT);
win32PreRelease.setRunType("Ant");
win32PreRelease.setMaximumNumberOfBuilds(1);
win32PreRelease.setCleanBuild(true);

}

The SProject class was changed in 3.0 to include a persist() method, but I cannot find such a method for SBuildType.

Thanks,

Scott

0
1 comment

Hello,

Since all build configurations of a particular project are stored in the one
file (project-config.xml) there is no way to persist a build configuration
alone, instead you should persist the whole project.

Before 3.0 to persist a project or build configuration you should be using
method ProjectManager.persist(SProject). In 3.0 release this method was
moved to SProject interface, see SProject.persist().

--
Pavel Sher
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"



"Scott Hebert" <no_reply@jetbrains.com> wrote in message
news:21884152.1203448152807.JavaMail.itn@is.intellij.net...

Hi,

>

I have a server-side plugin that is used to create projects and build
configuration. Since 3.0, my build configuration no longer persist after a
server restart.

>

This is my code:

>

public void createBuildConfig(String project, String name) {
SProject bproj = myServer.getProjectManager().findProjectByName(project);
if (bproj == null) {
logger.error("Could not find project: " + project);
return;
}

>

SBuildType btype = bproj.findBuildTypeByName(name);
if (btype != null) {
logger.warn("Build Configuration - " + name + " - already exists");
return;
}

>

SBuildType win32PreRelease = bproj.createBuildType(name, "test", -1,
BuildTypeDescriptor.CheckoutType.ON_AGENT);
win32PreRelease.setRunType("Ant");
win32PreRelease.setMaximumNumberOfBuilds(1);
win32PreRelease.setCleanBuild(true);

>

}

>

The SProject class was changed in 3.0 to include a persist() method, but I
cannot find such a method for SBuildType.

>

Thanks,

>

Scott



0

Please sign in to leave a comment.