]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.agent/src/main/java/org/argeo/slc/ant/deploy/SlcDeployTask.java
e6d42db9aed3f68bdb21490680f7652fcafcf4bf
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
.spring
.SpringArg
;
7 import org
.argeo
.slc
.ant
.structure
.SAwareTask
;
8 import org
.argeo
.slc
.core
.build
.Distribution
;
9 import org
.argeo
.slc
.core
.deploy
.Deployment
;
10 import org
.argeo
.slc
.core
.deploy
.DeploymentData
;
11 import org
.argeo
.slc
.core
.deploy
.TargetData
;
13 /** Ant task wrapping a deployment. */
14 public class SlcDeployTask
extends SAwareTask
{
15 private Log log
= LogFactory
.getLog(SlcDeployTask
.class);
17 private String deploymentBean
= null;
19 private SpringArg
<DeploymentData
> deploymentDataArg
;
20 private SpringArg
<TargetData
> targetDataArg
;
21 private SpringArg
<Distribution
> distributionArg
;
24 public void executeActions(String mode
) throws BuildException
{
25 Deployment deployment
= (Deployment
) getContext().getBean(
28 // set overridden references
29 if (distributionArg
!= null) {
30 deployment
.setDistribution(distributionArg
.getBeanInstance());
31 log
.trace("Overrides distribution");
34 if (deploymentDataArg
!= null) {
35 deployment
.setDeploymentData(deploymentDataArg
.getBeanInstance());
36 log
.trace("Overrides deployment data");
39 if (targetDataArg
!= null) {
40 deployment
.setTargetData(targetDataArg
.getBeanInstance());
41 log
.trace("Overrides target data");
48 * The bean name of the test run to use. If not set the default is used.
52 public void setDeployment(String deploymentBean
) {
53 this.deploymentBean
= deploymentBean
;
56 /** Creates deployment data sub tag. */
57 public SpringArg
<DeploymentData
> createDeploymentData() {
58 deploymentDataArg
= new SpringArg
<DeploymentData
>();
59 return deploymentDataArg
;
62 /** Creates target data sub tag. */
63 public SpringArg
<TargetData
> createTargetData() {
64 targetDataArg
= new SpringArg
<TargetData
>();
68 public SpringArg
<Distribution
> createDistribution() {
69 distributionArg
= new SpringArg
<Distribution
>();
70 return distributionArg
;