]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.agent/src/main/java/org/argeo/slc/ant/deploy/SlcDeployTask.java
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
;
6 import org
.argeo
.slc
.ant
.SlcAntConfig
;
7 import org
.argeo
.slc
.ant
.spring
.SpringArg
;
8 import org
.argeo
.slc
.ant
.structure
.SAwareTask
;
9 import org
.argeo
.slc
.core
.build
.Distribution
;
10 import org
.argeo
.slc
.core
.deploy
.Deployment
;
11 import org
.argeo
.slc
.core
.deploy
.DeploymentData
;
12 import org
.argeo
.slc
.core
.deploy
.TargetData
;
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 SpringArg
<DeploymentData
> deploymentDataArg
;
21 private SpringArg
<TargetData
> targetDataArg
;
22 private SpringArg
<Distribution
> distributionArg
;
25 public void executeActions(String mode
) throws BuildException
{
26 Deployment deployment
= (Deployment
) getContext().getBean(
29 // set overridden references
30 if (distributionArg
!= null) {
31 deployment
.setDistribution(distributionArg
.getBeanInstance());
32 log
.trace("Overrides distribution");
35 if (deploymentDataArg
!= null) {
36 deployment
.setDeploymentData(deploymentDataArg
.getBeanInstance());
37 log
.trace("Overrides deployment data");
40 if (targetDataArg
!= null) {
41 deployment
.setTargetData(targetDataArg
.getBeanInstance());
42 log
.trace("Overrides target data");
49 * The bean name of the test run to use. If not set the default is used.
53 public void setDeployment(String deploymentBean
) {
54 this.deploymentBean
= deploymentBean
;
57 /** Creates deployment data sub tag. */
58 public SpringArg
<DeploymentData
> createDeploymentData() {
59 deploymentDataArg
= new SpringArg
<DeploymentData
>();
60 return deploymentDataArg
;
63 /** Creates target data sub tag. */
64 public SpringArg
<TargetData
> createTargetData() {
65 targetDataArg
= new SpringArg
<TargetData
>();
69 public SpringArg
<Distribution
> createDistribution() {
70 distributionArg
= new SpringArg
<Distribution
>();
71 return distributionArg
;