Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
236 additions
and 6 deletions.
- +45 −3 src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
- +19 −1 src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java
- +58 −0 src/main/java/hudson/plugins/emailext/GroovyScriptPath.java
- +8 −0 src/main/resources/hudson/plugins/emailext/ExtendedEmailPublisher/config.groovy
- +8 −0 src/main/resources/hudson/plugins/emailext/ExtendedEmailPublisher/global.groovy
- +7 −0 src/main/webapp/help/globalConfig/defaultClasspath.html
- +7 −0 src/main/webapp/help/projectConfig/defaultClasspath.html
- +9 −0 src/test/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptorTest.java
- +68 −2 src/test/java/hudson/plugins/emailext/ExtendedEmailPublisherTest.java
- +7 −0 src/test/presend/hudson/plugins/emailext/ExtendedEmailPublisherTestHelper.groovy
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
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
@@ -0,0 +1,58 @@ | ||
package hudson.plugins.emailext; | ||
|
||
import java.io.File; | ||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
import hudson.Extension; | ||
import hudson.model.AbstractDescribableImpl; | ||
import hudson.model.Descriptor; | ||
|
||
/** | ||
* Model a classpath entry for Groovy pre script execution. | ||
* The syntax can be an URL, and if the syntax is invalid, defaults to a | ||
* file path. | ||
* This has been inspired by the Jenkins Postbuild plugin. | ||
* | ||
* @see <a href="https://github.com/jenkinsci/groovy-postbuild-plugin">https://github.com/jenkinsci/groovy-postbuild-plugin</a> | ||
* @see <a href="https://github.com/jenkinsci/groovy-postbuild-plugin/blob/master/src/main/java/org/jvnet/hudson/plugins/groovypostbuild/GroovyPostbuildRecorder.java">https://github.com/jenkinsci/groovy-postbuild-plugin/blob/master/src/main/java/org/jvnet/hudson/plugins/groovypostbuild/GroovyPostbuildRecorder.java</a> | ||
* | ||
*/ | ||
public class GroovyScriptPath extends AbstractDescribableImpl<GroovyScriptPath> { | ||
|
||
private String path; | ||
|
||
@DataBoundConstructor | ||
public GroovyScriptPath(String path) { | ||
this.path = path; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public URL asURL() { | ||
URL url = null; | ||
|
||
try { | ||
url = new URL(path); | ||
} | ||
catch (MalformedURLException e) { | ||
try { | ||
url = new File(path).toURI().toURL(); | ||
} catch (MalformedURLException e1) { | ||
} | ||
} | ||
return url; | ||
} | ||
|
||
@Extension | ||
public static class GroovyScriptPathDescriptor extends Descriptor<GroovyScriptPath> { | ||
This comment has been minimized.
This comment has been minimized.
jeffmaury
Member
|
||
@Override | ||
public String getDisplayName() { | ||
return ""; | ||
} | ||
} | ||
} |
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
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
@@ -0,0 +1,7 @@ | ||
<div> | ||
These pathes allow to extend the Groovy classpath when the | ||
presend script is run. The syntax of the path is either a | ||
full url or a simple file path (may be relative). | ||
These pathes are common to all projects when configured at | ||
the global scope. | ||
</div> |
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
@@ -0,0 +1,7 @@ | ||
<div> | ||
These pathes allow to extend the Groovy classpath when the | ||
presend script is run. The syntax of the path is either a | ||
full url or a simple file path (may be relative). | ||
These pathes are specific to this project and will be added | ||
to those of the global scope. | ||
</div> |
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
Oops, something went wrong.
Debug code?