Skip to content

Commit 2e3a25f

Browse files
committed
removed XML examples in GroovyDoc, some GroovyDoc cleanup
1 parent ca376bf commit 2e3a25f

36 files changed

+108
-2413
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,6 @@ class FooContext {
128128
* We roughly follow the [Java](http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html) and [Groovy](http://groovy.codehaus.org/Groovy+style+and+language+feature+guidelines+for+Java+developers) style guidelines.
129129
* When using IntelliJ IDEA, use the default code style, but disable '*' imports for Java and Groovy.
130130
* Add a CRLF at the end of a file.
131-
* Include an example of the generated XML in the GroovyDoc comment of DSL methods.
132-
133-
```groovy
134-
/**
135-
* <project>
136-
* <buildWrappers>
137-
* <hudson.plugins.foo.FooWrapper>
138-
* <option>bar</option>
139-
* </hudson.plugins.foo.FooWrapper>
140-
* </buildWrappers>
141-
* </project>
142-
*/
143-
def foo(String optionArg) {
144-
...
145-
}
146-
```
147131

148132
## Documentation
149133
* Add an entry to the [Release Notes](docs/Home.md#release-notes).

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/AbstractJobManagement.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import static java.lang.Thread.currentThread
44
import static org.codehaus.groovy.runtime.StackTraceUtils.isApplicationClass
55

66
/**
7-
* Abstract version of JobManagement to minimize impact on future API changes
7+
* Abstract version of JobManagement to minimize impact on future API changes.
88
*/
99
abstract class AbstractJobManagement implements JobManagement {
1010
final PrintStream outputStream

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/DslFactory.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ interface DslFactory extends ViewFactory {
6565

6666
/**
6767
* Schedule a job to be run later. Validation of the job name isn't done until after the DSL has run.
68+
*
6869
* @param jobName the name of the job to be queued
6970
*/
7071
void queue(String jobName)
7172

7273
/**
7374
* Schedule a job to be run later.
75+
*
7476
* @param job the job to be queued
7577
*/
7678
void queue(Job job)

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Item.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ abstract class Item implements Context {
2727
/**
2828
* Postpone all xml processing until someone actually asks for the xml. That lets us execute everything in order,
2929
* even if the user didn't specify them in order.
30-
* @return
3130
*/
3231
String getXml() {
3332
Writer xmlOutput = new StringWriter()

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy

Lines changed: 7 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ abstract class Job extends Item {
2727

2828
/**
2929
* Creates a new job configuration, based on the job template referenced by the parameter and stores this.
30+
*
3031
* @param templateName the name of the template upon which to base the new job
3132
* @return a new graph of groovy.util.Node objects, representing the job configuration structure
3233
* @throws JobTemplateMissingException
@@ -60,7 +61,7 @@ abstract class Job extends Item {
6061

6162
/**
6263
* "Restrict where this project can be run"
63-
* <assignedNode>FullTools&amp;&amp;RPM&amp;&amp;DC</assignedNode>
64+
*
6465
* @param labelExpression Label of node to use, if null is passed in, the label is cleared out and it can roam
6566
* @return
6667
*/
@@ -78,19 +79,6 @@ abstract class Job extends Item {
7879

7980
/**
8081
* Add environment variables to the build.
81-
*
82-
* <project>
83-
* <properties>
84-
* <EnvInjectJobProperty>
85-
* <info>
86-
* <propertiesContent>TEST=foo BAR=123</propertiesContent>
87-
* <loadFilesFromMaster>false</loadFilesFromMaster>
88-
* </info>
89-
* <on>true</on>
90-
* <keepJenkinsSystemVariables>true</keepJenkinsSystemVariables>
91-
* <keepBuildVariables>true</keepBuildVariables>
92-
* <contributors/>
93-
* </EnvInjectJobProperty>
9482
*/
9583
void environmentVariables(@DslContext(EnvironmentVariableContext) Closure envClosure) {
9684
environmentVariables(null, envClosure)
@@ -116,21 +104,6 @@ abstract class Job extends Item {
116104
}
117105
}
118106

119-
/**
120-
* <project>
121-
* <properties>
122-
* <hudson.plugins.throttleconcurrents.ThrottleJobProperty>
123-
* <maxConcurrentPerNode>0</maxConcurrentPerNode>
124-
* <maxConcurrentTotal>0</maxConcurrentTotal>
125-
* <categories>
126-
* <string>CDH5-repo-update</string>
127-
* </categories>
128-
* <throttleEnabled>true</throttleEnabled>
129-
* <throttleOption>category</throttleOption>
130-
* </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
131-
* <properties>
132-
* </project>
133-
*/
134107
void throttleConcurrentBuilds(@DslContext(ThrottleConcurrentBuildsContext) Closure throttleClosure) {
135108
ThrottleConcurrentBuildsContext throttleContext = new ThrottleConcurrentBuildsContext()
136109
ContextHelper.executeInContext(throttleClosure, throttleContext)
@@ -154,17 +127,6 @@ abstract class Job extends Item {
154127
}
155128
}
156129

157-
/**
158-
* <project>
159-
* <properties>
160-
* <org.jenkins.plugins.lockableresources.RequiredResourcesProperty>
161-
* <resourceNames>lock-resource</resourceNames>
162-
* <resourceNamesVar>NAMES</resourceNamesVar>
163-
* <resourceNumber>0</resourceNumber>
164-
* </org.jenkins.plugins.lockableresources.RequiredResourcesProperty>
165-
* <properties>
166-
* </project>
167-
*/
168130
void lockableResources(String resources, @DslContext(LockableResourcesContext) Closure lockClosure = null) {
169131
LockableResourcesContext lockContext = new LockableResourcesContext()
170132
ContextHelper.executeInContext(lockClosure, lockContext)
@@ -182,24 +144,13 @@ abstract class Job extends Item {
182144
}
183145
}
184146

185-
/**
186-
* <disabled>true</disabled>
187-
*/
188147
void disabled(boolean shouldDisable = true) {
189148
withXmlActions << WithXmlAction.create { Node project ->
190149
Node node = methodMissing('disabled', shouldDisable)
191150
project / node
192151
}
193152
}
194153

195-
/**
196-
* <logRotator>
197-
* <daysToKeep>14</daysToKeep>
198-
* <numToKeep>50</numToKeep>
199-
* <artifactDaysToKeep>5</artifactDaysToKeep>
200-
* <artifactNumToKeep>20</artifactNumToKeep>
201-
* </logRotator>
202-
*/
203154
void logRotator(int daysToKeepInt = -1, int numToKeepInt = -1,
204155
int artifactDaysToKeepInt = -1, int artifactNumToKeepInt = -1) {
205156
withXmlActions << WithXmlAction.create { Node project ->
@@ -213,22 +164,16 @@ abstract class Job extends Item {
213164
}
214165

215166
/**
216-
* Block build if certain jobs are running
217-
* <properties>
218-
* <hudson.plugins.buildblocker.BuildBlockerProperty>
219-
* <useBuildBlocker>true</useBuildBlocker> <!-- Always true -->
220-
* <blockingJobs>JobA</blockingJobs>
221-
* </hudson.plugins.buildblocker.BuildBlockerProperty>
222-
* </properties>
167+
* Block build if certain jobs are running.
223168
*/
224169
void blockOn(Iterable<String> projectNames) {
225170
blockOn(projectNames.join('\n'))
226171
}
227172

228173
/**
229174
* Block build if certain jobs are running.
175+
*
230176
* @param projectName Can be regular expressions. Newline delimited.
231-
* @return
232177
*/
233178
void blockOn(String projectName) {
234179
withXmlActions << WithXmlAction.create { Node project ->
@@ -241,6 +186,7 @@ abstract class Job extends Item {
241186

242187
/**
243188
* Name of the JDK installation to use for this job.
189+
*
244190
* @param jdkArg name of the JDK installation to use for this job.
245191
*/
246192
void jdk(String jdkArg) {
@@ -254,12 +200,6 @@ abstract class Job extends Item {
254200
* Priority of this job. Requires the
255201
* <a href="https://wiki.jenkins-ci.org/display/JENKINS/Priority+Sorter+Plugin">Priority Sorter Plugin</a>.
256202
* Default value is 100.
257-
*
258-
* <properties>
259-
* <hudson.queueSorter.PrioritySorterJobProperty plugin="PrioritySorter@1.3">
260-
* <priority>100</priority>
261-
* </hudson.queueSorter.PrioritySorterJobProperty>
262-
* </properties>
263203
*/
264204
void priority(int value) {
265205
withXmlActions << WithXmlAction.create { Node project ->
@@ -337,9 +277,7 @@ abstract class Job extends Item {
337277
}
338278

339279
/**
340-
* Configures the keep Dependencies Flag which can be set in the Fingerprinting action
341-
*
342-
* <keepDependencies>true</keepDependencies>
280+
* Configures the keep Dependencies Flag which can be set in the Fingerprinting action.
343281
*/
344282
void keepDependencies(boolean keep = true) {
345283
withXmlActions << WithXmlAction.create { Node project ->
@@ -349,9 +287,7 @@ abstract class Job extends Item {
349287
}
350288

351289
/**
352-
* Configures the 'Execute concurrent builds if necessary' flag
353-
*
354-
* <concurrentBuild>true</concurrentBuild>
290+
* Configures the 'Execute concurrent builds if necessary' flag.
355291
*/
356292
void concurrentBuild(boolean allowConcurrentBuild = true) {
357293
withXmlActions << WithXmlAction.create { Node project ->
@@ -362,20 +298,6 @@ abstract class Job extends Item {
362298

363299
/**
364300
* Configures the Notification Plugin.
365-
*
366-
* <properties>
367-
* <com.tikal.hudson.plugins.notification.HudsonNotificationProperty>
368-
* <endpoints>
369-
* <com.tikal.hudson.plugins.notification.Endpoint>
370-
* <protocol>HTTP</protocol>
371-
* <format>JSON</format>
372-
* <url />
373-
* <event>all</event>
374-
* <timeout>30000</timeout>
375-
* </com.tikal.hudson.plugins.notification.Endpoint>
376-
* </endpoints>
377-
* </com.tikal.hudson.plugins.notification.HudsonNotificationProperty>
378-
* </properties>
379301
*/
380302
void notifications(@DslContext(NotificationContext) Closure notificationClosure) {
381303
NotificationContext notificationContext = new NotificationContext(jobManagement)
@@ -388,18 +310,6 @@ abstract class Job extends Item {
388310
}
389311
}
390312

391-
/**
392-
* <properties>
393-
* <hudson.plugins.batch__task.BatchTaskProperty>
394-
* <tasks>
395-
* <hudson.plugins.batch__task.BatchTask>
396-
* <name>Hello World</name>
397-
* <script>echo Hello World</script>
398-
* </hudson.plugins.batch__task.BatchTask>
399-
* </tasks>
400-
* </hudson.plugins.batch__task.BatchTaskProperty>
401-
* </properties>
402-
*/
403313
void batchTask(String name, String script) {
404314
withXmlActions << WithXmlAction.create { Node project ->
405315
Node batchTaskProperty = project / 'properties' / 'hudson.plugins.batch__task.BatchTaskProperty'
@@ -410,14 +320,6 @@ abstract class Job extends Item {
410320
}
411321
}
412322

413-
/**
414-
* <properties>
415-
* <se.diabol.jenkins.pipeline.PipelineProperty>
416-
* <taskName>integration-tests</taskName>
417-
* <stageName>qa</stageName>
418-
* </se.diabol.jenkins.pipeline.PipelineProperty>
419-
* </properties>
420-
*/
421323
void deliveryPipelineConfiguration(String stageName, String taskName = null) {
422324
if (stageName || taskName) {
423325
withXmlActions << WithXmlAction.create { Node project ->

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/JobManagement.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface JobManagement {
99
/**
1010
* Gets (loads) the job configuration for the Jenkins job with the specified name. If no name is supplied, an empty
1111
* configuration is returned.
12+
*
1213
* @param jobName the name of the job to look up
1314
* @return the job configuration as XML
1415
* @throws JobConfigurationNotFoundException
@@ -17,6 +18,7 @@ interface JobManagement {
1718

1819
/**
1920
* Creates or updates the job config for the named Jenkins job with the config provided.
21+
*
2022
* @param jobName the name of the new / updated job
2123
* @param config the new / updated job config
2224
* @param ignoreExisting do not update existing jobs
@@ -28,6 +30,7 @@ interface JobManagement {
2830

2931
/**
3032
* Creates or updates the view config for the named Jenkins view with the config provided.
33+
*
3134
* @param viewName the name of the new / updated view
3235
* @param config the new / updated view config
3336
* @param ignoreExisting do not update existing view
@@ -39,6 +42,7 @@ interface JobManagement {
3942

4043
/**
4144
* Creates or updates the managed config file.
45+
*
4246
* @param configFile the config file to create or update
4347
* @param ignoreExisting do not update existing config files
4448
* @return the id of the created or updated config file
@@ -71,7 +75,6 @@ interface JobManagement {
7175

7276
/**
7377
* Stream to write to, for stdout.
74-
* @return PrintWriter
7578
*/
7679
PrintStream getOutputStream()
7780

@@ -82,6 +85,7 @@ interface JobManagement {
8285

8386
/**
8487
* Returns the id of a Credentials object.
88+
*
8589
* @param credentialsDescription the description of the credentials to lookup
8690
* @return id of Credentials or <code>null</code> if no credentials could be found
8791
*/

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/MissingPropertyToStringDelegate.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MissingPropertyToStringDelegate {
1313
this.root = root
1414
}
1515
/**
16-
* Make string for div() to do lookup
16+
* Make string for div() to do lookup.
1717
*/
1818
String propertyMissing(String propertyName) {
1919
LOGGER.fine("Missing ${propertyName}")

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/View.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ abstract class View implements Context {
4545
/**
4646
* Postpone all xml processing until someone actually asks for the xml. That lets us execute everything in order,
4747
* even if the user didn't specify them in order.
48-
* @return
4948
*/
5049
String getXml() {
5150
Writer xmlOutput = new StringWriter()

0 commit comments

Comments
 (0)