Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
f593e73e
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,发现更多精彩内容 >>
提交
f593e73e
编写于
1月 27, 2015
作者:
N
Nicolas De Loof
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JDK installer on OSX
上级
388c4b5e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
2 deletion
+61
-2
changelog.html
changelog.html
+2
-0
core/src/main/java/hudson/tools/JDKInstaller.java
core/src/main/java/hudson/tools/JDKInstaller.java
+59
-2
未找到文件。
changelog.html
浏览文件 @
f593e73e
...
...
@@ -55,6 +55,8 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div
id=
"trunk"
style=
"display:none"
>
<!--=TRUNK-BEGIN=-->
<ul
class=
image
>
<li
class=
"rfe"
>
JDK auto-installer for Mac OSX
<li
class=
'major bug'
>
Build format change migrator in 1.597 did not work on some Windows systems.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-26519"
>
issue 26519
</a>
)
...
...
core/src/main/java/hudson/tools/JDKInstaller.java
浏览文件 @
f593e73e
...
...
@@ -171,6 +171,7 @@ public class JDKInstaller extends ToolInstaller {
PrintStream
out
=
log
.
getLogger
();
out
.
println
(
"Installing "
+
jdkBundle
);
FilePath
parent
=
new
FilePath
(
launcher
.
getChannel
(),
expectedLocation
).
getParent
();
switch
(
p
)
{
case
LINUX:
case
SOLARIS:
...
...
@@ -240,7 +241,7 @@ public class JDKInstaller extends ToolInstaller {
// Prevent a trailing slash from escaping quotes
expectedLocation
=
expectedLocation
.
substring
(
0
,
expectedLocation
.
length
()
-
1
);
}
String
logFile
=
new
FilePath
(
launcher
.
getChannel
(),
expectedLocation
).
getParent
()
.
createTempFile
(
"install"
,
"log"
).
getRemote
();
String
logFile
=
parent
.
createTempFile
(
"install"
,
"log"
).
getRemote
();
ArgumentListBuilder
args
=
new
ArgumentListBuilder
();
...
...
@@ -281,6 +282,61 @@ public class JDKInstaller extends ToolInstaller {
fs
.
delete
(
logFile
);
break
;
case
OSX:
// Mount the DMG distribution bundle
FilePath
dmg
=
parent
.
createTempDir
(
"jdk"
,
"dmg"
);
exit
=
launcher
.
launch
()
.
cmds
(
"hdiutil"
,
"attach"
,
"-puppetstrings"
,
"-mountpoint"
,
dmg
.
getRemote
(),
jdkBundle
)
.
stdout
(
log
)
.
join
();
if
(
exit
!=
0
)
throw
new
AbortException
(
Messages
.
JDKInstaller_FailedToInstallJDK
(
exit
));
// expand the installation PKG
FilePath
[]
list
=
dmg
.
list
(
"*.pkg"
);
if
(
list
.
length
!=
1
)
{
log
.
getLogger
().
println
(
"JDK dmg bundle does not contain expected pkg installer"
);
throw
new
AbortException
(
Messages
.
JDKInstaller_FailedToInstallJDK
(
exit
));
}
String
installer
=
list
[
0
].
getRemote
();
FilePath
pkg
=
parent
.
createTempDir
(
"jdk"
,
"pkg"
);
pkg
.
deleteRecursive
();
// pkgutil fails if target directory exists
exit
=
launcher
.
launch
()
.
cmds
(
"pkgutil"
,
"--expand"
,
installer
,
pkg
.
getRemote
())
.
stdout
(
log
)
.
join
();
if
(
exit
!=
0
)
throw
new
AbortException
(
Messages
.
JDKInstaller_FailedToInstallJDK
(
exit
));
exit
=
launcher
.
launch
()
.
cmds
(
"umount"
,
dmg
.
getRemote
())
.
stdout
(
log
)
.
join
();
if
(
exit
!=
0
)
throw
new
AbortException
(
Messages
.
JDKInstaller_FailedToInstallJDK
(
exit
));
// We only want the actual JDK sub-package, which "Payload" is actually a tar.gz archive
list
=
pkg
.
list
(
"jdk*.pkg/Payload"
);
if
(
list
.
length
!=
1
)
{
log
.
getLogger
().
println
(
"JDK pkg installer does not contain expected JDK Payload archive"
);
throw
new
AbortException
(
Messages
.
JDKInstaller_FailedToInstallJDK
(
exit
));
}
String
payload
=
list
[
0
].
getRemote
();
exit
=
launcher
.
launch
()
.
pwd
(
parent
).
cmds
(
"tar"
,
"xzf"
,
payload
)
.
stdout
(
log
)
.
join
();
if
(
exit
!=
0
)
throw
new
AbortException
(
Messages
.
JDKInstaller_FailedToInstallJDK
(
exit
));
parent
.
child
(
"Contents/Home"
).
moveAllChildrenTo
(
new
FilePath
(
launcher
.
getChannel
(),
expectedLocation
));
parent
.
child
(
"Contents"
).
deleteRecursive
();
pkg
.
deleteRecursive
();
dmg
.
deleteRecursive
();
break
;
}
}
...
...
@@ -502,7 +558,7 @@ public class JDKInstaller extends ToolInstaller {
* Supported platform.
*/
public
enum
Platform
{
LINUX
(
"jdk.sh"
),
SOLARIS
(
"jdk.sh"
),
WINDOWS
(
"jdk.exe"
);
LINUX
(
"jdk.sh"
),
SOLARIS
(
"jdk.sh"
),
WINDOWS
(
"jdk.exe"
)
,
OSX
(
"jdk.dmg"
)
;
/**
* Choose the file name suitable for the downloaded JDK bundle.
...
...
@@ -529,6 +585,7 @@ public class JDKInstaller extends ToolInstaller {
if
(
arch
.
contains
(
"linux"
))
return
LINUX
;
if
(
arch
.
contains
(
"windows"
))
return
WINDOWS
;
if
(
arch
.
contains
(
"sun"
)
||
arch
.
contains
(
"solaris"
))
return
SOLARIS
;
if
(
arch
.
contains
(
"mac"
))
return
OSX
;
throw
new
DetectionFailedException
(
"Unknown CPU name: "
+
arch
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录