Skip to content
Permalink
Browse files

[FIXED JENKINS-13693] Add option to disable default excludes

  • Loading branch information...
bap2000 committed Jul 24, 2012
1 parent 9be8374 commit b07933909341ba95cbf5ca31c8b6b195c9383766
@@ -69,7 +69,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>publish-over</artifactId>
<version>0.13</version>
<version>0.15-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.samba.jcifs</groupId>
@@ -37,8 +37,8 @@

@DataBoundConstructor
public CifsTransfer(final String sourceFiles, final String excludes, final String remoteDirectory, final String removePrefix,
final boolean remoteDirectorySDF, final boolean flatten, final boolean cleanRemote) {
super(sourceFiles, excludes, remoteDirectory, removePrefix, remoteDirectorySDF, flatten, cleanRemote);
final boolean remoteDirectorySDF, final boolean flatten, final boolean cleanRemote, final boolean noDefaultExcludes) {
super(sourceFiles, excludes, remoteDirectory, removePrefix, remoteDirectorySDF, flatten, cleanRemote, noDefaultExcludes);
}

public boolean equals(final Object that) {
@@ -132,6 +132,9 @@ public FormValidation doCheckRetryDelay(@QueryParameter final String value) {
public boolean canUseExcludes() {
return BPTransfer.canUseExcludes();
}
public boolean canUseNoDefaultExcludes() {
return BPTransfer.canUseNoDefaultExcludes();

This comment has been minimized.

}
public String getDefaultMasterNodeName() {
return BPInstanceConfig.DEFAULT_MASTER_NODE_NAME;
}
@@ -41,18 +41,20 @@
private final boolean remoteDirectorySDF;
private final boolean flatten;
private final boolean cleanRemote;
private final boolean noDefaultExcludes;

@DataBoundConstructor
public CifsOverrideTransferDefaults(final String sourceFiles, final String excludes, final String removePrefix,
final String remoteDirectory, final boolean flatten, final boolean remoteDirectorySDF,
final boolean cleanRemote) {
final boolean cleanRemote, final boolean noDefaultExcludes) {
this.cleanRemote = cleanRemote;
this.excludes = excludes;
this.flatten = flatten;
this.remoteDirectory = remoteDirectory;
this.remoteDirectorySDF = remoteDirectorySDF;
this.removePrefix = removePrefix;
this.sourceFiles = sourceFiles;
this.noDefaultExcludes = noDefaultExcludes;
}

public String getSourceFiles() {
@@ -83,6 +85,10 @@ public boolean isCleanRemote() {
return cleanRemote;
}

public boolean isNoDefaultExcludes() {
return noDefaultExcludes;
}

public CifsOverrideTransferDefaultsDescriptor getDescriptor() {
return Hudson.getInstance().getDescriptorByType(CifsOverrideTransferDefaultsDescriptor.class);
}
@@ -99,6 +105,10 @@ public boolean canUseExcludes() {
return BPTransfer.canUseExcludes();
}

public boolean canUseNoDefaultExcludes() {
return BPTransfer.canUseNoDefaultExcludes();
}

public jenkins.plugins.publish_over.view_defaults.BPTransfer.Messages getCommonFieldNames() {
return new jenkins.plugins.publish_over.view_defaults.BPTransfer.Messages();
}
@@ -115,6 +115,12 @@
</f:entry>
</j:if>

<j:if test="${descriptor.publisherDescriptor.canUseNoDefaultExcludes()}">
<f:entry title="${m_trans.noDefaultExcludes()}" help="${descriptor.publisherDescriptor.getHelpFile('noDefaultExcludes')}">
<f:checkbox name="noDefaultExcludes" value="${transfer.noDefaultExcludes}" default="${defaults.transfer.noDefaultExcludes}"/>
</f:entry>
</j:if>

<f:entry title="${m_trans.flatten()}" help="${helpUrl}flatten.html">
<f:checkbox name="flatten" checked="${transfer.flatten}" default="${defaults.transfer.flatten}"/>
</f:entry>
@@ -56,7 +56,7 @@
<f:textbox name="_.port" value="${instance.port}" default="${defaultPort}" checkUrl="${descriptor.getCheckUrl('port')}"/>
</f:entry>
<f:entry title="${m.timeout()}" help="${helpUrl}timeout.html">
<f:textbox name="_.timeout" value="${instance.timeout}" default="${defaultTimeout}" checkUrl="${descriptor.getCheckUrl('timeout')}"/>
<f:textbox name="_.timeout" value="${instance.timeOut}" default="${defaultTimeout}" checkUrl="${descriptor.getCheckUrl('timeout')}"/>
</f:entry>
</f:advanced>
<f:validateButton
@@ -0,0 +1,39 @@
<?jelly escape-by-default='true'?>

<!--
~ The MIT License
~
~ Copyright (C) 2012 by Anthony Robinson
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->

<j:jelly xmlns:j="jelly:core">

Select this option to disable the default exclude patterns.
<p>The default exclude patterns are:
<j:invokeStatic var="defaultExcludes" method="getDefaultExcludes" className="org.apache.tools.ant.DirectoryScanner"/>
<pre>
<j:forEach var="pattern" items="${defaultExcludes}">
${pattern}<br/>
</j:forEach>
</pre>
</p>

</j:jelly>
@@ -42,6 +42,11 @@
<f:textbox default="${defaults.transfer.excludes}"/>
</f:entry>
</j:if>
<j:if test="${descriptor.canUseNoDefaultExcludes()}">
<f:entry title="${m.noDefaultExcludes()}" field="noDefaultExcludes">
<f:checkbox default="${defaults.transfer.noDefaultExcludes}"/>
</f:entry>
</j:if>
<f:entry title="${m.flatten()}" field="flatten">
<f:checkbox default="${defaults.transfer.flatten}"/>
</f:entry>
@@ -152,7 +152,7 @@

@Test public void testBeginTransfersFailIfNoSourceFiles() throws Exception {
try {
new CifsClient(buildInfo, TEST_ROOT_URL, null).beginTransfers(new CifsTransfer("", "", "", "", false, false, false));
new CifsClient(buildInfo, TEST_ROOT_URL, null).beginTransfers(new CifsTransfer("", "", "", "", false, false, false, false));
fail();
} catch (BapPublisherException bpe) {
assertEquals(Messages.exception_noSourceFiles(), bpe.getMessage());

0 comments on commit b079339

Please sign in to comment.
You can’t perform that action at this time.