jenkins-plugin-runtime 0.1.27 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -1
- data/lib/jenkins/cli.rb +4 -0
- data/lib/jenkins/extension.rb +1 -5
- data/lib/jenkins/listeners.rb +4 -0
- data/lib/jenkins/model.rb +13 -1
- data/lib/jenkins/model/action.rb +1 -2
- data/lib/jenkins/model/action_proxy.rb +23 -0
- data/lib/jenkins/model/describable.rb +2 -2
- data/lib/jenkins/model/describable_native.rb +21 -0
- data/lib/jenkins/model/describable_proxy.rb +21 -0
- data/lib/jenkins/model/descriptor.rb +10 -4
- data/lib/jenkins/model/environment_proxy.rb +1 -0
- data/lib/jenkins/model/root_action.rb +1 -2
- data/lib/jenkins/model/root_action_proxy.rb +7 -0
- data/lib/jenkins/plugin.rb +1 -1
- data/lib/jenkins/plugin/proxies.rb +1 -10
- data/lib/jenkins/plugin/runtime.rb +3 -19
- data/lib/jenkins/plugin/runtime/version.rb +1 -1
- data/lib/jenkins/slaves.rb +7 -0
- data/lib/jenkins/slaves/node_property.rb +1 -1
- data/lib/jenkins/slaves/node_property_proxy.rb +1 -1
- data/lib/jenkins/tasks.rb +12 -0
- data/lib/jenkins/tasks/build_step_proxy.rb +32 -0
- data/lib/jenkins/tasks/build_wrapper_proxy.rb +2 -3
- data/lib/jenkins/tasks/builder.rb +0 -2
- data/lib/jenkins/tasks/builder_proxy.rb +6 -0
- data/lib/jenkins/tasks/publisher_proxy.rb +6 -0
- data/spec/jenkins/extension_spec.rb +32 -12
- data/spec/jenkins/listeners/run_listener_proxy_spec.rb +2 -3
- data/spec/jenkins/model/describable_spec.rb +7 -2
- data/spec/jenkins/{plugin/proxies/root_action_spec.rb → model/root_action_proxy_spec.rb} +3 -3
- data/spec/jenkins/plugin/proxies/proxy_helper.rb +1 -1
- data/spec/jenkins/{plugin/proxies/builder_spec.rb → tasks/builder_proxy_spec.rb} +2 -2
- data/spec/jenkins/{plugin/proxies/publisher_spec.rb → tasks/publisher_proxy_spec.rb} +2 -2
- metadata +19 -14
- data/lib/jenkins/plugin/proxies/action.rb +0 -29
- data/lib/jenkins/plugin/proxies/build_step.rb +0 -33
- data/lib/jenkins/plugin/proxies/builder.rb +0 -13
- data/lib/jenkins/plugin/proxies/describable.rb +0 -23
- data/lib/jenkins/plugin/proxies/publisher.rb +0 -13
- data/lib/jenkins/plugin/proxies/root_action.rb +0 -13
data/Rakefile
CHANGED
data/lib/jenkins/cli.rb
ADDED
data/lib/jenkins/extension.rb
CHANGED
data/lib/jenkins/model.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module Jenkins
|
3
2
|
module Model
|
4
3
|
extend Plugin::Behavior
|
@@ -57,3 +56,16 @@ module Jenkins
|
|
57
56
|
end
|
58
57
|
end
|
59
58
|
end
|
59
|
+
|
60
|
+
require 'jenkins/model/descriptor'
|
61
|
+
require 'jenkins/model/describable'
|
62
|
+
require 'jenkins/model/describable_native'
|
63
|
+
require 'jenkins/model/describable_proxy'
|
64
|
+
require 'jenkins/model/environment'
|
65
|
+
require 'jenkins/model/environment_proxy'
|
66
|
+
require 'jenkins/model/action'
|
67
|
+
require 'jenkins/model/action_proxy'
|
68
|
+
require 'jenkins/model/root_action'
|
69
|
+
require 'jenkins/model/root_action_proxy'
|
70
|
+
require 'jenkins/model/build'
|
71
|
+
require 'jenkins/model/listener'
|
data/lib/jenkins/model/action.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
module Jenkins::Model
|
3
|
+
module ActionProxy
|
4
|
+
include Jenkins::Plugin::Proxy
|
5
|
+
implemented do |cls|
|
6
|
+
cls.class_eval do
|
7
|
+
include Java.hudson.model.Action
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def getDisplayName
|
12
|
+
@object.display_name
|
13
|
+
end
|
14
|
+
|
15
|
+
def getIconFileName
|
16
|
+
@object.icon
|
17
|
+
end
|
18
|
+
|
19
|
+
def getUrlName
|
20
|
+
@object.url_path
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -47,11 +47,11 @@ module Jenkins
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def describe_as_type
|
50
|
-
@describe_as_type ? @describe_as_type : (superclass.describe_as_type if superclass.respond_to?(:describe_as_type))
|
50
|
+
@describe_as_type ? @describe_as_type : (superclass.describe_as_type if superclass.respond_to?(:describe_as_type)) || verify_java_class(self)
|
51
51
|
end
|
52
52
|
|
53
53
|
def descriptor_is
|
54
|
-
@descriptor_is ? @descriptor_is : (superclass.descriptor_is if superclass.respond_to?(:descriptor_is))
|
54
|
+
@descriptor_is ? @descriptor_is : (superclass.descriptor_is if superclass.respond_to?(:descriptor_is)) || DefaultDescriptor
|
55
55
|
end
|
56
56
|
|
57
57
|
private
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Jenkins
|
2
|
+
module Model
|
3
|
+
module DescribableNative
|
4
|
+
include Describable
|
5
|
+
|
6
|
+
implemented do |cls|
|
7
|
+
cls.class_eval do
|
8
|
+
include Java.jenkins.ruby.Get
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def getDescriptor
|
13
|
+
Jenkins.plugin.descriptors[@object.class]
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(name)
|
17
|
+
@object.respond_to?(name) ? @object.send(name) : nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Jenkins
|
2
|
+
module Model
|
3
|
+
# mix-in on top of the subtypes of the Describable Java class
|
4
|
+
# to add standard behaviour as a proxy to Ruby object
|
5
|
+
module DescribableProxy
|
6
|
+
include Jenkins::Plugin::Proxy
|
7
|
+
implemented do |cls|
|
8
|
+
cls.class_eval do
|
9
|
+
include Java.jenkins.ruby.Get
|
10
|
+
end
|
11
|
+
end
|
12
|
+
def getDescriptor
|
13
|
+
@plugin.descriptors[@object.class]
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(name)
|
17
|
+
@object.respond_to?(name) ? @object.send(name) : nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -9,14 +9,20 @@ module Jenkins
|
|
9
9
|
#
|
10
10
|
# This class captures commonality of such "Ruby-specific behaviours" across different Descriptors
|
11
11
|
# so it can be mixed into the Descriptor subtypes
|
12
|
-
module
|
12
|
+
module Descriptor
|
13
13
|
def initialize(impl, plugin, java_type)
|
14
14
|
super(java_type)
|
15
15
|
@impl, @plugin, @java_type = impl, plugin, java_type
|
16
16
|
end
|
17
17
|
|
18
18
|
def getDisplayName
|
19
|
-
@impl.display_name
|
19
|
+
if @impl.respond_to?(:display_name)
|
20
|
+
@impl.display_name
|
21
|
+
elsif @impl.respond_to?(:getDisplayName)
|
22
|
+
@impl.getDisplayName()
|
23
|
+
else
|
24
|
+
@impl.name
|
25
|
+
end
|
20
26
|
end
|
21
27
|
|
22
28
|
def getId()
|
@@ -78,8 +84,8 @@ module Jenkins
|
|
78
84
|
end
|
79
85
|
end
|
80
86
|
|
81
|
-
class
|
82
|
-
include
|
87
|
+
class DefaultDescriptor < Java.hudson.model.Descriptor
|
88
|
+
include Descriptor
|
83
89
|
end
|
84
90
|
end
|
85
91
|
end
|
data/lib/jenkins/plugin.rb
CHANGED
@@ -129,7 +129,7 @@ module Jenkins
|
|
129
129
|
def register_describable(describable_class)
|
130
130
|
on.start do
|
131
131
|
fail "#{describable_class} is not an instance of Describable" unless describable_class < Model::Describable
|
132
|
-
descriptor_class = describable_class.descriptor_is
|
132
|
+
descriptor_class = describable_class.descriptor_is
|
133
133
|
descriptor = descriptor_class.new(describable_class, self, describable_class.describe_as_type.java_class)
|
134
134
|
@descriptors[describable_class] = descriptor
|
135
135
|
register_extension(descriptor)
|
@@ -169,13 +169,4 @@ module Jenkins
|
|
169
169
|
clear
|
170
170
|
end
|
171
171
|
end
|
172
|
-
end
|
173
|
-
|
174
|
-
require 'jenkins/model/describable'
|
175
|
-
["action", "builder", "publisher", "root_action"].each do |proxy|
|
176
|
-
require "jenkins/plugin/proxies/#{proxy}"
|
177
|
-
end
|
178
|
-
|
179
|
-
["cli/command"].each do |proxy|
|
180
|
-
require "jenkins/#{proxy}_proxy"
|
181
|
-
end
|
172
|
+
end
|
@@ -5,25 +5,9 @@ require 'jenkins/plugin/wrapper'
|
|
5
5
|
require 'jenkins/plugin/specification'
|
6
6
|
require 'jenkins/plugin/runtime/version'
|
7
7
|
require 'jenkins/plugin/proxy'
|
8
|
-
require 'jenkins/plugin/proxies/describable'
|
9
8
|
require 'jenkins/plugin/proxies'
|
10
|
-
require 'jenkins/cli
|
9
|
+
require 'jenkins/cli'
|
11
10
|
require 'jenkins/model'
|
12
|
-
require 'jenkins/
|
13
|
-
require 'jenkins/model/environment_proxy'
|
14
|
-
require 'jenkins/model/action'
|
15
|
-
require 'jenkins/model/root_action'
|
16
|
-
require 'jenkins/model/build'
|
17
|
-
require 'jenkins/model/descriptor'
|
18
|
-
require 'jenkins/model/listener'
|
19
|
-
require 'jenkins/slaves/cloud'
|
20
|
-
require 'jenkins/tasks/builder'
|
21
|
-
require 'jenkins/tasks/build_wrapper'
|
22
|
-
require 'jenkins/tasks/build_wrapper_proxy'
|
11
|
+
require 'jenkins/tasks'
|
23
12
|
require 'jenkins/launcher'
|
24
|
-
require 'jenkins/listeners
|
25
|
-
require 'jenkins/listeners/run_listener_proxy'
|
26
|
-
require 'jenkins/slaves/node_property'
|
27
|
-
require 'jenkins/slaves/node_property_proxy'
|
28
|
-
require 'jenkins/slaves/computer_listener'
|
29
|
-
require 'jenkins/slaves/computer_listener_proxy'
|
13
|
+
require 'jenkins/listeners'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Jenkins
|
2
|
+
module Tasks
|
3
|
+
require 'jenkins/tasks/build_step'
|
4
|
+
require 'jenkins/tasks/build_step_proxy'
|
5
|
+
require 'jenkins/tasks/builder'
|
6
|
+
require 'jenkins/tasks/builder_proxy'
|
7
|
+
require 'jenkins/tasks/publisher'
|
8
|
+
require 'jenkins/tasks/publisher_proxy'
|
9
|
+
require 'jenkins/tasks/build_wrapper'
|
10
|
+
require 'jenkins/tasks/build_wrapper_proxy'
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Jenkins
|
2
|
+
module Tasks
|
3
|
+
module BuildStepProxy
|
4
|
+
include Jenkins::Model::DescribableProxy
|
5
|
+
|
6
|
+
def prebuild(build, listener)
|
7
|
+
boolean_result(listener) do
|
8
|
+
@object.prebuild(import(build), import(listener))
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def perform(build, launcher, listener)
|
13
|
+
boolean_result(listener) do
|
14
|
+
@object.perform(import(build), import(launcher), import(listener))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def boolean_result(listener, &block)
|
21
|
+
begin
|
22
|
+
yield
|
23
|
+
true
|
24
|
+
rescue Exception => e
|
25
|
+
msg = "#{e.message} (#{e.class})\n" << (e.backtrace || []).join("\n")
|
26
|
+
listener.error(msg + "\n")
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module Jenkins::Tasks
|
2
2
|
class BuildWrapperProxy < Java.hudson.tasks.BuildWrapper
|
3
|
-
include Jenkins::
|
4
|
-
proxy_for Jenkins::Tasks::BuildWrapper
|
5
|
-
|
3
|
+
include Jenkins::Model::DescribableProxy
|
6
4
|
include Jenkins::Model::EnvironmentProxy
|
5
|
+
proxy_for Jenkins::Tasks::BuildWrapper
|
7
6
|
|
8
7
|
# BuildWrapper needs a custom Environment class, not sure why
|
9
8
|
environment_is Java.hudson.tasks.BuildWrapper::Environment do
|
@@ -1,21 +1,41 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Jenkins::Extension do
|
4
|
-
include SpecHelper
|
5
4
|
|
6
|
-
|
7
|
-
class
|
8
|
-
|
9
|
-
|
10
|
-
order 3
|
11
|
-
end
|
5
|
+
before do
|
6
|
+
@class = Class.new
|
7
|
+
@class.send(:include, Jenkins::Extension)
|
8
|
+
end
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
describe "when an order is not specified" do
|
11
|
+
it "uses 0" do
|
12
|
+
@class.order.should eql 0
|
13
|
+
end
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
describe "when an order is specified" do
|
17
|
+
before do
|
18
|
+
@class.order 3
|
19
|
+
end
|
20
|
+
it 'uses that order' do
|
21
|
+
@class.order.should eql 3
|
22
|
+
end
|
23
|
+
|
24
|
+
describe ". A subclass" do
|
25
|
+
before do
|
26
|
+
@subclass = Class.new @class
|
27
|
+
end
|
28
|
+
it 'does not inherit the parents order' do
|
29
|
+
@subclass.order.should eql 0
|
30
|
+
end
|
31
|
+
describe 'specifying its own order' do
|
32
|
+
before do
|
33
|
+
@subclass.order 5
|
34
|
+
end
|
35
|
+
it 'uses that order' do
|
36
|
+
@subclass.order.should eql 5
|
37
|
+
end
|
38
|
+
end
|
19
39
|
end
|
20
40
|
end
|
21
41
|
end
|
@@ -2,10 +2,9 @@ require 'spec_helper'
|
|
2
2
|
require 'rspec-spies'
|
3
3
|
|
4
4
|
describe Jenkins::Listeners::RunListenerProxy do
|
5
|
+
include ProxyHelper
|
5
6
|
before do
|
6
|
-
@
|
7
|
-
@proxy = Jenkins::Listeners::RunListenerProxy.new(mock(Jenkins::Plugin, :name => 'test-plugin'), @listener)
|
8
|
-
@build = mock(Jenkins::Model::Build)
|
7
|
+
@proxy = Jenkins::Listeners::RunListenerProxy.new(@plugin, @listener)
|
9
8
|
@console = mock(Jenkins::Model::Listener)
|
10
9
|
end
|
11
10
|
|
@@ -9,12 +9,11 @@ describe Jenkins::Model::Describable do
|
|
9
9
|
|
10
10
|
describe "when mixed into a class" do
|
11
11
|
before do
|
12
|
-
@class = Class.new
|
12
|
+
@class = Class.new(java.lang.Object)
|
13
13
|
@plugin.stub(:register_describable)
|
14
14
|
@class.send(:include, Jenkins::Model::Describable)
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
17
|
it "can't be described as plain old object" do
|
19
18
|
lambda {@class.describe_as Object}.should raise_error(Jenkins::Model::Describable::DescribableError)
|
20
19
|
end
|
@@ -26,6 +25,12 @@ describe Jenkins::Model::Describable do
|
|
26
25
|
it "must be described as a java.lang.Class" do
|
27
26
|
lambda {@class.describe_as java.lang.Object}.should_not raise_error
|
28
27
|
end
|
28
|
+
|
29
|
+
describe "and no further specification is provided" do
|
30
|
+
subject {@class}
|
31
|
+
its(:describe_as_type) {should be @class}
|
32
|
+
its(:descriptor_is) {should be Jenkins::Model::DefaultDescriptor}
|
33
|
+
end
|
29
34
|
|
30
35
|
describe "a subclass of that class" do
|
31
36
|
before do
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Jenkins::
|
3
|
+
describe Jenkins::Model::RootActionProxy do
|
4
4
|
include ProxyHelper
|
5
5
|
|
6
6
|
before do
|
7
|
-
@object = mock(Jenkins::Model::
|
8
|
-
@root_action = Jenkins::
|
7
|
+
@object = mock(Jenkins::Model::RootActionProxy)
|
8
|
+
@root_action = Jenkins::Model::RootActionProxy.new(@plugin, @object)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "getDisplayName" do
|
@@ -5,7 +5,7 @@ module ProxyHelper
|
|
5
5
|
super
|
6
6
|
mod.class_eval do
|
7
7
|
before do
|
8
|
-
@plugin = mock(Jenkins::Plugin, :name => "test-plugin")
|
8
|
+
@plugin = mock(Jenkins::Plugin, :name => "test-plugin", :linkout => true)
|
9
9
|
|
10
10
|
@jBuild = mock(Java.hudson.model.AbstractBuild)
|
11
11
|
@jLauncher = mock(Java.hudson.Launcher)
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Jenkins::
|
3
|
+
describe Jenkins::Tasks::BuilderProxy do
|
4
4
|
include ProxyHelper
|
5
5
|
|
6
6
|
before do
|
7
7
|
@object = mock(Jenkins::Tasks::Builder)
|
8
|
-
@builder = Jenkins::
|
8
|
+
@builder = Jenkins::Tasks::BuilderProxy.new(@plugin, @object)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "prebuild" do
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Jenkins::
|
3
|
+
describe Jenkins::Tasks::PublisherProxy do
|
4
4
|
include ProxyHelper
|
5
5
|
|
6
6
|
before do
|
7
7
|
@object = mock(Jenkins::Tasks::Publisher)
|
8
|
-
@builder = Jenkins::
|
8
|
+
@builder = Jenkins::Tasks::PublisherProxy.new(@plugin, @object)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe "prebuild" do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: jenkins-plugin-runtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Charles Lowell
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-30 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -93,47 +93,52 @@ files:
|
|
93
93
|
- Rakefile
|
94
94
|
- jenkins-plugin-runtime.gemspec
|
95
95
|
- lib/core_ext/exception.rb
|
96
|
+
- lib/jenkins/cli.rb
|
96
97
|
- lib/jenkins/cli/command.rb
|
97
98
|
- lib/jenkins/cli/command_proxy.rb
|
98
99
|
- lib/jenkins/extension.rb
|
99
100
|
- lib/jenkins/filepath.rb
|
100
101
|
- lib/jenkins/launcher.rb
|
102
|
+
- lib/jenkins/listeners.rb
|
101
103
|
- lib/jenkins/listeners/run_listener.rb
|
102
104
|
- lib/jenkins/listeners/run_listener_proxy.rb
|
103
105
|
- lib/jenkins/model.rb
|
104
106
|
- lib/jenkins/model/action.rb
|
107
|
+
- lib/jenkins/model/action_proxy.rb
|
105
108
|
- lib/jenkins/model/build.rb
|
106
109
|
- lib/jenkins/model/describable.rb
|
110
|
+
- lib/jenkins/model/describable_native.rb
|
111
|
+
- lib/jenkins/model/describable_proxy.rb
|
107
112
|
- lib/jenkins/model/descriptor.rb
|
108
113
|
- lib/jenkins/model/environment.rb
|
109
114
|
- lib/jenkins/model/environment_proxy.rb
|
110
115
|
- lib/jenkins/model/listener.rb
|
111
116
|
- lib/jenkins/model/root_action.rb
|
117
|
+
- lib/jenkins/model/root_action_proxy.rb
|
112
118
|
- lib/jenkins/plugin.rb
|
113
119
|
- lib/jenkins/plugin/behavior.rb
|
114
120
|
- lib/jenkins/plugin/proxies.rb
|
115
|
-
- lib/jenkins/plugin/proxies/action.rb
|
116
|
-
- lib/jenkins/plugin/proxies/build_step.rb
|
117
|
-
- lib/jenkins/plugin/proxies/builder.rb
|
118
|
-
- lib/jenkins/plugin/proxies/describable.rb
|
119
|
-
- lib/jenkins/plugin/proxies/publisher.rb
|
120
|
-
- lib/jenkins/plugin/proxies/root_action.rb
|
121
121
|
- lib/jenkins/plugin/proxy.rb
|
122
122
|
- lib/jenkins/plugin/runtime.rb
|
123
123
|
- lib/jenkins/plugin/runtime/version.rb
|
124
124
|
- lib/jenkins/plugin/specification.rb
|
125
125
|
- lib/jenkins/plugin/wrapper.rb
|
126
126
|
- lib/jenkins/rack.rb
|
127
|
+
- lib/jenkins/slaves.rb
|
127
128
|
- lib/jenkins/slaves/cloud.rb
|
128
129
|
- lib/jenkins/slaves/computer_listener.rb
|
129
130
|
- lib/jenkins/slaves/computer_listener_proxy.rb
|
130
131
|
- lib/jenkins/slaves/node_property.rb
|
131
132
|
- lib/jenkins/slaves/node_property_proxy.rb
|
133
|
+
- lib/jenkins/tasks.rb
|
132
134
|
- lib/jenkins/tasks/build_step.rb
|
135
|
+
- lib/jenkins/tasks/build_step_proxy.rb
|
133
136
|
- lib/jenkins/tasks/build_wrapper.rb
|
134
137
|
- lib/jenkins/tasks/build_wrapper_proxy.rb
|
135
138
|
- lib/jenkins/tasks/builder.rb
|
139
|
+
- lib/jenkins/tasks/builder_proxy.rb
|
136
140
|
- lib/jenkins/tasks/publisher.rb
|
141
|
+
- lib/jenkins/tasks/publisher_proxy.rb
|
137
142
|
- spec/jenkins/cli/command_proxy_spec.rb
|
138
143
|
- spec/jenkins/cli/command_spec.rb
|
139
144
|
- spec/jenkins/extension_spec.rb
|
@@ -144,20 +149,20 @@ files:
|
|
144
149
|
- spec/jenkins/model/build_spec.rb
|
145
150
|
- spec/jenkins/model/describable_spec.rb
|
146
151
|
- spec/jenkins/model/listener_spec.rb
|
152
|
+
- spec/jenkins/model/root_action_proxy_spec.rb
|
147
153
|
- spec/jenkins/model_spec.rb
|
148
154
|
- spec/jenkins/plugin/behavior_spec.rb
|
149
155
|
- spec/jenkins/plugin/example.pluginspec
|
150
|
-
- spec/jenkins/plugin/proxies/builder_spec.rb
|
151
156
|
- spec/jenkins/plugin/proxies/proxy_helper.rb
|
152
|
-
- spec/jenkins/plugin/proxies/publisher_spec.rb
|
153
|
-
- spec/jenkins/plugin/proxies/root_action_spec.rb
|
154
157
|
- spec/jenkins/plugin/proxies_spec.rb
|
155
158
|
- spec/jenkins/plugin/proxy_spec.rb
|
156
159
|
- spec/jenkins/plugin/specification_spec.rb
|
157
160
|
- spec/jenkins/plugin_spec.rb
|
158
161
|
- spec/jenkins/tasks/build_wrapper_proxy_spec.rb
|
159
162
|
- spec/jenkins/tasks/build_wrapper_spec.rb
|
163
|
+
- spec/jenkins/tasks/builder_proxy_spec.rb
|
160
164
|
- spec/jenkins/tasks/builder_spec.rb
|
165
|
+
- spec/jenkins/tasks/publisher_proxy_spec.rb
|
161
166
|
- spec/spec_helper.rb
|
162
167
|
- src/jenkins/ruby/DoDynamic.java
|
163
168
|
- src/jenkins/ruby/Get.java
|
@@ -199,18 +204,18 @@ test_files:
|
|
199
204
|
- spec/jenkins/model/build_spec.rb
|
200
205
|
- spec/jenkins/model/describable_spec.rb
|
201
206
|
- spec/jenkins/model/listener_spec.rb
|
207
|
+
- spec/jenkins/model/root_action_proxy_spec.rb
|
202
208
|
- spec/jenkins/model_spec.rb
|
203
209
|
- spec/jenkins/plugin/behavior_spec.rb
|
204
210
|
- spec/jenkins/plugin/example.pluginspec
|
205
|
-
- spec/jenkins/plugin/proxies/builder_spec.rb
|
206
211
|
- spec/jenkins/plugin/proxies/proxy_helper.rb
|
207
|
-
- spec/jenkins/plugin/proxies/publisher_spec.rb
|
208
|
-
- spec/jenkins/plugin/proxies/root_action_spec.rb
|
209
212
|
- spec/jenkins/plugin/proxies_spec.rb
|
210
213
|
- spec/jenkins/plugin/proxy_spec.rb
|
211
214
|
- spec/jenkins/plugin/specification_spec.rb
|
212
215
|
- spec/jenkins/plugin_spec.rb
|
213
216
|
- spec/jenkins/tasks/build_wrapper_proxy_spec.rb
|
214
217
|
- spec/jenkins/tasks/build_wrapper_spec.rb
|
218
|
+
- spec/jenkins/tasks/builder_proxy_spec.rb
|
215
219
|
- spec/jenkins/tasks/builder_spec.rb
|
220
|
+
- spec/jenkins/tasks/publisher_proxy_spec.rb
|
216
221
|
- spec/spec_helper.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'jenkins/model/action'
|
2
|
-
require 'jenkins/plugin/proxies/describable'
|
3
|
-
|
4
|
-
module Jenkins
|
5
|
-
class Plugin
|
6
|
-
class Proxies
|
7
|
-
module Action
|
8
|
-
include Jenkins::Plugin::Proxy
|
9
|
-
implemented do |cls|
|
10
|
-
cls.class_eval do
|
11
|
-
include Java.hudson.model.Action
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def getDisplayName
|
16
|
-
@object.display_name
|
17
|
-
end
|
18
|
-
|
19
|
-
def getIconFileName
|
20
|
-
@object.icon
|
21
|
-
end
|
22
|
-
|
23
|
-
def getUrlName
|
24
|
-
@object.url_path
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Jenkins
|
2
|
-
class Plugin
|
3
|
-
class Proxies
|
4
|
-
module BuildStep
|
5
|
-
include Describable
|
6
|
-
def prebuild(build, listener)
|
7
|
-
boolean_result(listener) do
|
8
|
-
@object.prebuild(import(build), import(listener))
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def perform(build, launcher, listener)
|
13
|
-
boolean_result(listener) do
|
14
|
-
@object.perform(import(build), import(launcher), import(listener))
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def boolean_result(listener, &block)
|
21
|
-
begin
|
22
|
-
yield
|
23
|
-
true
|
24
|
-
rescue Exception => e
|
25
|
-
msg = "#{e.message} (#{e.class})\n" << (e.backtrace || []).join("\n")
|
26
|
-
listener.error(msg + "\n")
|
27
|
-
false
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'jenkins/tasks/builder'
|
2
|
-
require 'jenkins/plugin/proxies/build_step'
|
3
|
-
|
4
|
-
module Jenkins
|
5
|
-
class Plugin
|
6
|
-
class Proxies
|
7
|
-
class Builder < Java.hudson.tasks.Builder
|
8
|
-
include BuildStep
|
9
|
-
proxy_for Jenkins::Tasks::Builder
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Jenkins
|
2
|
-
class Plugin
|
3
|
-
class Proxies
|
4
|
-
# mix-in on top of the subtypes of the Describable Java class
|
5
|
-
# to add standard behaviour as a proxy to Ruby object
|
6
|
-
module Describable
|
7
|
-
include Jenkins::Plugin::Proxy
|
8
|
-
implemented do |cls|
|
9
|
-
cls.class_eval do
|
10
|
-
include Java.jenkins.ruby.Get
|
11
|
-
end
|
12
|
-
end
|
13
|
-
def getDescriptor
|
14
|
-
@plugin.descriptors[@object.class]
|
15
|
-
end
|
16
|
-
|
17
|
-
def get(name)
|
18
|
-
@object.respond_to?(name) ? @object.send(name) : nil
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'jenkins/tasks/publisher'
|
2
|
-
require 'jenkins/plugin/proxies/build_step'
|
3
|
-
|
4
|
-
module Jenkins
|
5
|
-
class Plugin
|
6
|
-
class Proxies
|
7
|
-
class Publisher < Java.hudson.tasks.Publisher
|
8
|
-
include BuildStep
|
9
|
-
proxy_for Jenkins::Tasks::Publisher
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|