Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
54d1cf11
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
54d1cf11
编写于
3月 10, 2016
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2034 from daspilker/2.0-JENKINS-21249
[JENKINS-21249] Update Groovy to 2.4.6
上级
219481a2
23707951
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
30 deletion
+29
-30
core/pom.xml
core/pom.xml
+3
-3
core/src/main/java/hudson/cli/GroovyshCommand.java
core/src/main/java/hudson/cli/GroovyshCommand.java
+12
-4
core/src/main/java/hudson/util/spring/BeanBuilder.java
core/src/main/java/hudson/util/spring/BeanBuilder.java
+3
-2
pom.xml
pom.xml
+10
-12
test/pom.xml
test/pom.xml
+0
-8
test/src/test/java/hudson/cli/GroovyshCommandTest.java
test/src/test/java/hudson/cli/GroovyshCommandTest.java
+1
-1
未找到文件。
core/pom.xml
浏览文件 @
54d1cf11
...
...
@@ -41,7 +41,7 @@ THE SOFTWARE.
<staplerFork>
true
</staplerFork>
<stapler.version>
1.240
</stapler.version>
<spring.version>
2.5.6.SEC03
</spring.version>
<groovy.version>
1.8.9
</groovy.version>
<groovy.version>
2.4.6
</groovy.version>
</properties>
<dependencies>
...
...
@@ -411,13 +411,13 @@ THE SOFTWARE.
<dependency>
<!-- groovy shell uses this but uses an optional dependency -->
<groupId>
jline
</groupId>
<artifactId>
jline
</artifactId>
<version>
1.0
</version>
<version>
2.12
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<!-- groovy shell uses this but it doesn't declare this dependency -->
<groupId>
org.fusesource.jansi
</groupId>
<artifactId>
jansi
</artifactId>
<version>
1.
9
</version>
<version>
1.
11
</version>
</dependency>
<dependency>
<!--
...
...
core/src/main/java/hudson/cli/GroovyshCommand.java
浏览文件 @
54d1cf11
...
...
@@ -41,7 +41,7 @@ import java.io.PrintWriter;
import
java.util.ArrayList
;
import
jline.UnsupportedTerminal
;
import
jline.Terminal
;
import
jline.Terminal
Factory
;
import
org.kohsuke.args4j.Argument
;
/**
...
...
@@ -65,10 +65,18 @@ public class GroovyshCommand extends CLICommand {
// this being remote means no jline capability is available
System
.
setProperty
(
"jline.terminal"
,
UnsupportedTerminal
.
class
.
getName
());
Terminal
.
resetTerminal
();
TerminalFactory
.
reset
();
StringBuilder
commandLine
=
new
StringBuilder
();
for
(
String
arg
:
args
)
{
if
(
commandLine
.
length
()
>
0
)
{
commandLine
.
append
(
" "
);
}
commandLine
.
append
(
arg
);
}
Groovysh
shell
=
createShell
(
stdin
,
stdout
,
stderr
);
return
shell
.
run
(
args
.
toArray
(
new
String
[
args
.
size
()]
));
return
shell
.
run
(
commandLine
.
toString
(
));
}
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
...
...
@@ -101,7 +109,7 @@ public class GroovyshCommand extends CLICommand {
}
};
Groovysh
shell
=
new
Groovysh
(
cl
,
binding
,
io
,
registrar
);
shell
.
getImports
().
add
(
"
import
hudson.model.*"
);
shell
.
getImports
().
add
(
"hudson.model.*"
);
// defaultErrorHook doesn't re-throw IOException, so ShellRunner in
// Groovysh will keep looping forever if we don't terminate when the
...
...
core/src/main/java/hudson/util/spring/BeanBuilder.java
浏览文件 @
54d1cf11
...
...
@@ -39,6 +39,7 @@ import org.springframework.web.context.WebApplicationContext;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -132,7 +133,7 @@ public class BeanBuilder extends GroovyObjectSupport {
cc
.
setScriptBaseClass
(
ClosureScript
.
class
.
getName
());
GroovyShell
shell
=
new
GroovyShell
(
classLoader
,
binding
,
cc
);
ClosureScript
s
=
(
ClosureScript
)
shell
.
parse
(
script
);
ClosureScript
s
=
(
ClosureScript
)
shell
.
parse
(
new
InputStreamReader
(
script
)
);
s
.
setDelegate
(
this
);
s
.
run
();
}
...
...
@@ -336,7 +337,7 @@ public class BeanBuilder extends GroovyObjectSupport {
GroovyShell
shell
=
classLoader
!=
null
?
new
GroovyShell
(
classLoader
,
b
)
:
new
GroovyShell
(
b
);
for
(
Resource
resource
:
resources
)
{
shell
.
evaluate
(
resource
.
getInputStream
(
));
shell
.
evaluate
(
new
InputStreamReader
(
resource
.
getInputStream
()
));
}
}
...
...
pom.xml
浏览文件 @
54d1cf11
...
...
@@ -323,7 +323,17 @@ THE SOFTWARE.
<artifactId>
servlet-api
</artifactId>
<version>
2.4
</version>
</dependency>
<dependency>
<groupId>
org.codehaus.gmaven.runtime
</groupId>
<artifactId>
gmaven-runtime-2.0
</artifactId>
<version>
1.5-jenkins-3
</version>
</dependency>
</dependencies>
<configuration>
<!-- 2.4 not yet supported by plugin but 2.0 works
here so long as we provide explicit version -->
<providerSelection>
2.0
</providerSelection>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
@@ -724,18 +734,6 @@ THE SOFTWARE.
</goals>
</execution>
</executions>
<configuration>
<!-- 1.8 not yet supported by plugin but 1.7 works
here so long as we provide explicit version -->
<providerSelection>
1.7
</providerSelection>
</configuration>
<dependencies>
<dependency>
<groupId>
org.codehaus.gmaven.runtime
</groupId>
<artifactId>
gmaven-runtime-1.7
</artifactId>
<version>
1.3
</version>
</dependency>
</dependencies>
</plugin>
</plugins>
...
...
test/pom.xml
浏览文件 @
54d1cf11
...
...
@@ -240,15 +240,7 @@ THE SOFTWARE.
<artifactId>
ant-launcher
</artifactId>
<version>
1.8.0
</version>
</dependency>
<dependency>
<groupId>
org.codehaus.gmaven.runtime
</groupId>
<artifactId>
gmaven-runtime-2.0
</artifactId>
<version>
1.5-jenkins-1
</version>
</dependency>
</dependencies>
<configuration>
<providerSelection>
2.0
</providerSelection>
</configuration>
</plugin>
</plugins>
</build>
...
...
test/src/test/java/hudson/cli/GroovyshCommandTest.java
浏览文件 @
54d1cf11
...
...
@@ -42,7 +42,7 @@ public class GroovyshCommandTest {
@Test
public
void
authentication
()
throws
Exception
{
CLICommandInvoker
.
Result
result
=
new
CLICommandInvoker
(
r
,
new
GroovyshCommand
())
.
authorizedTo
(
Jenkins
.
READ
,
Jenkins
.
RUN_SCRIPTS
)
.
withStdin
(
new
StringInputStream
(
"println(jenkins.model.Jenkins.instance.getClass().name)\nquit\n"
))
.
withStdin
(
new
StringInputStream
(
"println(jenkins.model.Jenkins.instance.getClass().name)\n
:
quit\n"
))
.
invoke
();
assertThat
(
result
,
succeeded
());
assertThat
(
result
,
hasNoErrorOutput
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录