(→AHPSCRIPTS-70)
|
(→AHPSCRIPTS-69)
|
Line 80: | |||
} | } | ||
} </pre> | } </pre> | ||
+ | = Run if Project Has Particular Artifact Set = | ||
+ | ==== AHPSCRIPTS-85 ==== | ||
+ | * General case: | ||
+ | ** <pre>return new Criteria() { | ||
+ | public boolean matches(Object obj) { | ||
+ | return ProjectLookup.getCurrent().getLifeCycleModel().getArtifactSetGroup().getArtifactSet("artifacts") != null; | ||
+ | } | ||
+ | }</pre> | ||
+ | * If configured to publish artifact set: | ||
+ | ** <pre>import com.urbancode.anthill3.domain.profile.*; | ||
+ | return new Criteria() { | ||
+ | public boolean matches(Object obj) { | ||
+ | ArtifactDeliverPatterns[] patterns = BuildLifeLookup.getCurrent().getProfile().getArtifactConfigArray(); | ||
+ | for (int i=0; i<patterns.length; i++) { | ||
+ | if ("artifacts".equals(patterns[i].getArtifactSet().getName())) { | ||
+ | return true; | ||
+ | } | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | }</pre> | ||
+ | * If already has artifact set published | ||
+ | ** <pre>import com.urbancode.codestation2.server.*; | ||
+ | return new Criteria() { | ||
+ | public boolean matches(Object obj) { | ||
+ | return CodestationRepositoryFileHelper.getInstance().hasBuildLifeArtifactSet(BuildLifeLookup.getCurrent(), | ||
+ | ProjectLookup.getCurrent().getLifeCycleModel().getArtifactSetGroup().getArtifactSet("artifacts")); | ||
+ | } | ||
+ | }</pre> |