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 /** Creates deployment data sub tag. */
52 public DeploymentDataArg
createDeploymentData() {
53 deploymentDataArg
= new DeploymentDataArg();
54 return deploymentDataArg
;
57 /** Creates target data sub tag. */
58 public TargetDataArg
createTargetData() {
59 targetDataArg
= new TargetDataArg();
64 class DeploymentDataArg
extends AbstractSpringArg
{
65 DeploymentData
getDeploymentData() {
66 return (DeploymentData
) getBeanInstance();
71 class TargetDataArg
extends AbstractSpringArg
{
72 TargetData
getTargetData() {
73 return (TargetData
) getBeanInstance();