Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-33887] Added support for the Phing Plugin
- Loading branch information
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...sl-core/src/main/docs/examples/javaposse/jobdsl/dsl/helpers/step/StepContext/phing.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
job('example') { | ||
steps { | ||
phing { | ||
properties('KEY', 'VALUE') | ||
targets('test') | ||
options('--debug') | ||
buildFile('dir1/build.xml') | ||
phingInstallation('Phing 1.8') | ||
useModuleRoot(false) | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/step/PhingContext.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package javaposse.jobdsl.dsl.helpers.step | ||
|
||
import javaposse.jobdsl.dsl.Context | ||
|
||
class PhingContext implements Context { | ||
String phingName = '(Default)' | ||
boolean useModuleRoot = true | ||
String buildFile | ||
final List<String> targets = [] | ||
final Map<String, String> properties = [:] | ||
final List<String> options = [] | ||
|
||
/** | ||
* Specifies the name of the Phing installation to be used for this build step. Defaults to {@code '(Default)'}. | ||
*/ | ||
void phingInstallation(String phingInstallation) { | ||
this.phingName = phingInstallation | ||
} | ||
|
||
/** | ||
* If set to true, use ModuleRoot as working directory. | ||
* Defaults to {@code true}. | ||
*/ | ||
void useModuleRoot(boolean useModuleRoot = true) { | ||
this.useModuleRoot = useModuleRoot | ||
} | ||
|
||
/** | ||
* Specifies the custom buildfile directory. | ||
*/ | ||
void buildFile(String buildFile) { | ||
this.buildFile = buildFile | ||
} | ||
|
||
/** | ||
* Specifies a list of Phing targets to be invoked. Can be called multiple times to add more targets. | ||
*/ | ||
void targets(String targets) { | ||
this.targets << targets | ||
} | ||
|
||
/** | ||
* Specifies custom properties to be added to the Phing call. Can be called multiple times to add more properties. | ||
*/ | ||
void properties(String name, Object value) { | ||
this.properties[name] = value?.toString() | ||
} | ||
|
||
/** | ||
* Specifies options to be added to the Phing call. Can be called multiple times to add more options. | ||
*/ | ||
void options(String options) { | ||
this.options << options | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters