Skip to content

Commit

Permalink
Merge pull request #654 from daspilker/html-publisher
Browse files Browse the repository at this point in the history
added workaround for JENKINS-31366
  • Loading branch information
daspilker committed Nov 3, 2015
2 parents 7c42e4b + 1f6e144 commit 758361b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/Home.md
Expand Up @@ -41,12 +41,16 @@ Have a look at the [Jenkins Job DSL Gradle example](https://github.com/sheehan/j
* Added support for the [TestNG Plugin](https://wiki.jenkins-ci.org/display/JENKINS/testng-plugin)
([JENKINS-30895](https://issues.jenkins-ci.org/browse/JENKINS-30895))
* Added workaround for [GROOVY-6263](https://issues.apache.org/jira/browse/GROOVY-6263) to `WorkspaceCleanupContext`
* Added workaround for [JENKINS-31366](https://issues.jenkins-ci.org/browse/JENKINS-31366)
* Added support for the [SSH Plugin](https://wiki.jenkins-ci.org/display/JENKINS/SSH+plugin)
([JENKINS-30957](https://issues.jenkins-ci.org/browse/JENKINS-30957))
* Enhanced support for the [Gradle Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin)
([JENKINS-31264](https://issues.jenkins-ci.org/browse/JENKINS-31264))
* Support for older versions of the [Gradle Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin) is
deprecated, see [Migration](Migration#migrating-to-140)
* Support for older versions of the
[HTML Publisher Plugin](https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin) is deprecated, see
[Migration](Migration#migrating-to-140)
* Removed anything that has been deprecated in 1.33, see [Migration](Migration#migrating-to-133)
* 1.39 (October 05 2015)
* Increased the minimum supported Jenkins version to 1.596
Expand Down
6 changes: 6 additions & 0 deletions docs/Migration.md
Expand Up @@ -6,6 +6,12 @@ Support for versions older than 1.23 of the
[Gradle Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin) is [[deprecated|Deprecation-Policy]]
and will be removed.

### HTML Publisher

Support for versions older than 1.5 of the
[HTML Publisher Plugin](https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin) is
[[deprecated|Deprecation-Policy]] and will be removed.

## Migrating to 1.39

### MultiJob
Expand Down
Expand Up @@ -334,6 +334,8 @@ class PublisherContext extends AbstractExtensibleContext {
*/
@RequiresPlugin(id = 'htmlpublisher')
void publishHtml(@DslContext(HtmlReportContext) Closure htmlReportContext) {
jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')

HtmlReportContext reportContext = new HtmlReportContext(jobManagement)
ContextHelper.executeInContext(htmlReportContext, reportContext)

Expand All @@ -351,7 +353,9 @@ class PublisherContext extends AbstractExtensibleContext {
if (!jobManagement.getPluginVersion('htmlpublisher')?.isOlderThan(new VersionNumber('1.4'))) {
alwaysLinkToLastBuild(target.alwaysLinkToLastBuild)
}
wrapperName('htmlpublisher-wrapper.html')
if (jobManagement.getPluginVersion('htmlpublisher')?.isOlderThan(new VersionNumber('1.5'))) {
wrapperName('htmlpublisher-wrapper.html')
}
}
}
}
Expand Down
Expand Up @@ -679,15 +679,15 @@ class PublisherContextSpec extends Specification {
publisherHtmlNode.name() == 'htmlpublisher.HtmlPublisher'
!publisherHtmlNode.reportTargets.isEmpty()
def target = publisherHtmlNode.reportTargets[0].'htmlpublisher.HtmlPublisherTarget'[0]
target.children().size() == 7
target.children().size() == 6
target.reportName[0].value() == ''
target.reportDir[0].value() == 'build/*'
target.reportFiles[0].value() == 'index.html'
target.keepAll[0].value() == false
target.allowMissing[0].value() == false
target.alwaysLinkToLastBuild[0].value() == false
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling minimal html publisher closure, plugin version older than 1.3'() {
Expand All @@ -712,6 +712,7 @@ class PublisherContextSpec extends Specification {
target.keepAll[0].value() == false
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling minimal html publisher closure, plugin version older than 1.4'() {
Expand All @@ -737,6 +738,7 @@ class PublisherContextSpec extends Specification {
target.allowMissing[0].value() == false
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling html publisher closure with all options'() {
Expand All @@ -757,15 +759,15 @@ class PublisherContextSpec extends Specification {
publisherHtmlNode.name() == 'htmlpublisher.HtmlPublisher'
!publisherHtmlNode.reportTargets.isEmpty()
def target = publisherHtmlNode.reportTargets[0].'htmlpublisher.HtmlPublisherTarget'[0]
target.children().size() == 7
target.children().size() == 6
target.reportName[0].value() == 'foo'
target.reportDir[0].value() == 'build/*'
target.reportFiles[0].value() == 'test.html'
target.keepAll[0].value() == true
target.allowMissing[0].value() == true
target.alwaysLinkToLastBuild[0].value() == true
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling html publisher with multiple reports'() {
Expand All @@ -792,6 +794,7 @@ class PublisherContextSpec extends Specification {
target2.reportDir[0].value() == 'test/*'

1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'call Jabber publish with minimal args'() {
Expand Down

0 comments on commit 758361b

Please sign in to comment.