Skip to content

Instantly share code, notes, and snippets.

@cowboyd
Forked from calavera/hello_world_builder.mirah
Created November 13, 2010 08:05
Show Gist options
  • Save cowboyd/675176 to your computer and use it in GitHub Desktop.
Save cowboyd/675176 to your computer and use it in GitHub Desktop.
import hudson.Launcher;
import hudson.Extension;
import hudson.util.FormValidation;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.AbstractProject;
import hudson.tasks.Builder;
import hudson.tasks.BuildStepDescriptor;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.QueryParameter;
import javax.servlet.ServletException;
import java.io.IOException;
class HelloWorldBuilder < Builder
def initialize(name:String)
@name = name
end
def perform(build:AbstractBuild, launcher:Launcher, listener:BuildListener)
true
end
class DescriptorImpl < BuildStepDescriptor
def configure(req:StaplerRequest, formData:JSONObject)
true
end
end
end
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.376</version>
</parent>
<artifactId>helloWorld</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>hpi</packaging>
<name>Hello plugin</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>never</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase><!--Change this to control when it runs -->
<configuration>
<tasks>
<property name="compile_classpath" refid="maven.compile.classpath"/>
<property name="mirah_classpath" value="../mirah/dist/mirah-complete.jar:../jruby/lib/jruby-complete.jar"/>
<taskdef name="mirah" classname="org.mirah.ant.Compile" classpath="${mirah_classpath}"/>
<mirah src="hello_world_builder.mirah" classpath="${compile_classpath}:${mirah_classpath}"/>
</tasks>
</configuration>
<goals>
<goal>run</goal><!-- this is to call antrun:run -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!--dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>1.5.5</version>
</dependency>
</dependencies-->
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment