|
(→AHPSCRIPTS-76)
|
(→AHPSCRIPTS-75)
|
| Line 706: | |||
| uow.commitAndClose();</pre> | uow.commitAndClose();</pre> | ||
| + | = Erase ALL Dependencies For Project = | ||
| + | This Script will remove all dependencies for a List of Project Names. | ||
| + | ==== AHPSCRIPTS-74 ==== | ||
| + | <pre>import com.urbancode.anthill3.domain.*; | ||
| + | import com.urbancode.anthill3.domain.artifacts.*; | ||
| + | import com.urbancode.anthill3.domain.project.*; | ||
| + | import com.urbancode.anthill3.main.client.AnthillClient; | ||
| + | import com.urbancode.anthill3.persistence.UnitOfWork; | ||
| + | ///////////////////////////////////////////////// | ||
| + | String serverHost = "localhost"; | ||
| + | int serverPort = 4567; | ||
| + | String username = "admin"; | ||
| + | String password = "admin"; | ||
| + | AnthillClient ac = AnthillClient.connect(serverHost, serverPort, username, password); | ||
| + | UnitOfWork uow = ac.createUnitOfWork(); | ||
| + | ///////////////////////////////////////////////// | ||
| + | for(p : bsh.args) { | ||
| + | projectName = p; | ||
| + | print("Libraries for project " + projectName); | ||
| + | print("----------------------------------------------------"); | ||
| + | pdal = ProjectFactory.getInstance().restoreForName(projectName); | ||
| + | pdal_wf = pdal.getWorkflow("CommonModuleBuildWorkflow"); | ||
| + | pdal_bf = pdal_wf.getBuildProfile(); | ||
| + | deps = pdal_bf.getDependencyArray(); | ||
| + | for(dep : deps) { | ||
| + | print("Deleting " + dep.getDependency().getName()); | ||
| + | pdal_bf.removeDependency(dep); | ||
| + | dep.delete(); | ||
| + | } | ||
| + | pdal_bf.store(); | ||
| + | print(""); | ||
| + | } | ||
| + | //////////////////////////////////////// | ||
| + | uow.commitAndClose(); | ||
| + | uow = null; | ||
| + | ac = null; | ||
| + | ////////////////////////////////////////</pre> | ||