[Anthill-pro] Passing stamps or properties between projects

Silgi, Nir nsilgi at shopping.com
Tue Jun 24 14:52:44 CDT 2008


I have the same scenario (if I understood correctly).

I have the script below which gets the latest stamp of the dependent
project's latest build.

Also I remember the UrbanCode guys set up a repository with useful user
scripts. I don't remember its address, maybe someone can post it again.

Hope this helps.


import com.urbancode.anthill3.domain.buildlife.*;
import com.urbancode.anthill3.runtime.scripting.helpers.*;
import
com.urbancode.codestation2.domain.buildlife.CodestationCompatableBuildLi
fe ;
import com.urbancode.codestation2.domain.project.*;
import java.util.ArrayList ;
import java.lang.Object;
import com.urbancode.anthill3.persistence.UnitOfWork;
import
com.urbancode.anthill3.domain.buildrequest.BuildRequestStatusEnum;
import com.urbancode.anthill3.domain.buildrequest.RequestSourceEnum ;
import com.urbancode.anthill3.domain.persistent.Handle;
import com.urbancode.anthill3.domain.persistent.Persistent;
import com.urbancode.anthill3.domain.buildrequest.*;
UnitOfWork uow = UnitOfWork.getCurrent ();
static final String PROJECT_NAME = "Mercury";

//Get most current buildlife.
BuildLife blife = BuildLifeLookup.getCurrent();
BuildRequest br = BuildRequestLookup.getCurrent();

//Get dependency Array
CodestationCompatableBuildLife[] dArray =
blife.getDependencyBuildLifeArray();

String stamp = null;
for (int i = 0; i < dArray.length && stamp == null; i++) { 
        if (dArray[i].getCodestationProject() != null &&
            dArray[i].getCodestationProject() instanceof AnthillProject)
{
            AnthillProject project = (AnthillProject)
dArray[i].getCodestationProject(); 
            String temp = project.getBuildProfile
().getProject().getName();
            if (temp.equals(PROJECT_NAME)){
                stamp = dArray[i].getLatestStampValue();
           }
    }

} 
br.setProperty("mercury-version", stamp);
uow.commit();

-----Original Message-----
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Heather
Wells
Sent: Tuesday, June 24, 2008 9:22 PM
To: anthill-pro at lists.urbancode.com
Subject: [Anthill-pro] Passing stamps or properties between projects

I have a push dependency relationship between two workflow in  
different projects, and I'd like to keep their version numbers in  
sync.  The main workflow gets its build stamp from a project  
property.  Is there a way to pass that stamp value to the dependent  
project when it builds?

Thanks,

Heather
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro


More information about the Anthill-pro mailing list