1 package org
.argeo
.slc
.ant
.deploy
;
3 import org
.apache
.commons
.logging
.Log
;
4 import org
.apache
.commons
.logging
.LogFactory
;
5 import org
.apache
.tools
.ant
.BuildException
;
7 import org
.argeo
.slc
.ant
.SlcAntConfig
;
8 import org
.argeo
.slc
.ant
.spring
.AbstractSpringArg
;
9 import org
.argeo
.slc
.ant
.structure
.SAwareTask
;
10 import org
.argeo
.slc
.core
.deploy
.DeploymentData
;
11 import org
.argeo
.slc
.core
.deploy
.TargetData
;
12 import org
.argeo
.slc
.core
.deploy
.WritableDeployment
;
14 /** Ant task wrapping a deployment. */
15 public class SlcDeployTask
extends SAwareTask
{
16 private Log log
= LogFactory
.getLog(SlcDeployTask
.class);
18 private String deploymentBean
= null;
20 private DeploymentDataArg deploymentDataArg
;
21 private TargetDataArg targetDataArg
;
24 public void executeActions(String mode
) throws BuildException
{
25 WritableDeployment deployment
= (WritableDeployment
) getContext()
26 .getBean(deploymentBean
);
28 // set overridden references
29 if (deploymentDataArg
!= null) {
30 deployment
.setDeploymentData(deploymentDataArg
.getDeploymentData());
31 log
.trace("Overrides deployment data");
34 if (targetDataArg
!= null) {
35 deployment
.setTargetData(targetDataArg
.getTargetData());
36 log
.trace("Overrides target data");
43 * The bean name of the test run to use. If not set the default is used.
47 public void setDeployment(String deploymentBean
) {
48 this.deploymentBean
= deploymentBean
;
51 public DeploymentDataArg
createDeploymentData() {
52 deploymentDataArg
= new DeploymentDataArg();
53 return deploymentDataArg
;
56 public TargetDataArg
createTargetData() {
57 targetDataArg
= new TargetDataArg();
62 class DeploymentDataArg
extends AbstractSpringArg
{
63 public DeploymentData
getDeploymentData() {
64 return (DeploymentData
) getBeanInstance();
69 class TargetDataArg
extends AbstractSpringArg
{
70 public TargetData
getTargetData() {
71 return (TargetData
) getBeanInstance();