Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
0a3590f0
提交
0a3590f0
authored
5月 20, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Require Java 1.5 compiler
上级
a8fec820
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
128 行增加
和
57 行删除
+128
-57
buildRelease.sh
h2/src/installer/buildRelease.sh
+4
-3
Build.java
h2/src/tools/org/h2/build/Build.java
+45
-31
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+79
-23
没有找到文件。
h2/src/installer/buildRelease.sh
浏览文件 @
0a3590f0
...
@@ -16,9 +16,10 @@ PATH=$JAVA16/bin:$PATH
...
@@ -16,9 +16,10 @@ PATH=$JAVA16/bin:$PATH
./build.sh
-quiet
spellcheck javadocImpl jarClient
./build.sh
-quiet
spellcheck javadocImpl jarClient
echo
$(
date
"+%H:%M:%S"
)
JDK 1.4
echo
$(
date
"+%H:%M:%S"
)
JDK 1.4
JAVA_HOME
=
$JAVA14
export
BCP
=
/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Classes
PATH
=
$JAVA14
/bin:
$PATH
JAVA_HOME
=
$JAVA15
./build.sh
-quiet
clean compile
PATH
=
$JAVA15
/bin:
$PATH
./build.sh
-quiet
clean
-Dversion
=
1.4 switchSource
-Dbcp
=
$BCP
/classes.jar:
$BCP
/jsse.jar compile
./build.sh
-quiet
installer mavenDeployCentral
./build.sh
-quiet
installer mavenDeployCentral
# ./build.sh -quiet compile benchmark
# ./build.sh -quiet compile benchmark
...
...
h2/src/tools/org/h2/build/Build.java
浏览文件 @
0a3590f0
差异被折叠。
点击展开。
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
0a3590f0
...
@@ -43,12 +43,69 @@ import java.util.zip.ZipOutputStream;
...
@@ -43,12 +43,69 @@ import java.util.zip.ZipOutputStream;
*/
*/
public
class
BuildBase
{
public
class
BuildBase
{
/**
* A list of strings.
*/
public
static
class
StringList
extends
ArrayList
implements
List
{
private
static
final
long
serialVersionUID
=
1L
;
StringList
()
{
super
();
}
StringList
(
String
[]
args
)
{
super
();
addAll
(
Arrays
.
asList
(
args
));
}
/**
* Add a list of strings.
*
* @param args the list to add
* @return the new list
*/
public
StringList
plus
(
String
[]
args
)
{
StringList
newList
=
new
StringList
();
newList
.
addAll
(
this
);
newList
.
addAll
(
Arrays
.
asList
(
args
));
return
newList
;
}
/**
* Add a string.
*
* @param s the string to add
* @return the new list
*/
public
StringList
plus
(
String
s
)
{
StringList
newList
=
new
StringList
();
newList
.
addAll
(
this
);
newList
.
add
(
s
);
return
newList
;
}
/**
* Convert this list to a string array.
*
* @return the string array
*/
public
String
[]
toArray
()
{
String
[]
list
=
new
String
[
size
()];
for
(
int
i
=
0
;
i
<
size
();
i
++)
{
list
[
i
]
=
(
String
)
get
(
i
);
}
return
list
;
}
}
/**
/**
* A list of files.
* A list of files.
*/
*/
public
static
class
FileList
extends
ArrayList
implements
List
{
public
static
class
FileList
extends
ArrayList
implements
List
{
private
static
final
long
serialVersionUID
=
-
3241001695597802578
L
;
private
static
final
long
serialVersionUID
=
1
L
;
/**
/**
* Remove the files that match from the list.
* Remove the files that match from the list.
...
@@ -190,7 +247,7 @@ public class BuildBase {
...
@@ -190,7 +247,7 @@ public class BuildBase {
* @param args the command line parameters
* @param args the command line parameters
* @return the exit value
* @return the exit value
*/
*/
protected
int
execScript
(
String
script
,
String
[]
args
)
{
protected
int
execScript
(
String
script
,
String
List
args
)
{
if
(
isWindows
())
{
if
(
isWindows
())
{
script
=
script
+
".bat"
;
script
=
script
+
".bat"
;
}
}
...
@@ -204,19 +261,19 @@ public class BuildBase {
...
@@ -204,19 +261,19 @@ public class BuildBase {
* @param args the command line parameters
* @param args the command line parameters
* @return the exit value
* @return the exit value
*/
*/
protected
int
exec
(
String
command
,
String
[]
args
)
{
protected
int
exec
(
String
command
,
String
List
args
)
{
try
{
try
{
print
(
command
);
print
(
command
);
for
(
int
i
=
0
;
args
!=
null
&&
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
;
args
!=
null
&&
i
<
args
.
size
()
;
i
++)
{
print
(
" "
+
args
[
i
]
);
print
(
" "
+
args
.
get
(
i
)
);
}
}
println
(
""
);
StringList
cmd
=
new
StringList
();
String
[]
cmdArray
=
new
String
[
1
+
(
args
==
null
?
0
:
args
.
length
)];
cmd
=
cmd
.
plus
(
command
);
cmdArray
[
0
]
=
command
;
if
(
args
!=
null
)
{
if
(
args
!=
null
)
{
System
.
arraycopy
(
args
,
0
,
cmdArray
,
1
,
args
.
length
);
cmd
.
addAll
(
args
);
}
}
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmdArray
);
println
(
""
);
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmd
.
toArray
());
copyInThread
(
p
.
getInputStream
(),
quiet
?
null
:
out
);
copyInThread
(
p
.
getInputStream
(),
quiet
?
null
:
out
);
copyInThread
(
p
.
getErrorStream
(),
quiet
?
null
:
out
);
copyInThread
(
p
.
getErrorStream
(),
quiet
?
null
:
out
);
p
.
waitFor
();
p
.
waitFor
();
...
@@ -345,7 +402,7 @@ public class BuildBase {
...
@@ -345,7 +402,7 @@ public class BuildBase {
*
*
* @param args the command line arguments to pass
* @param args the command line arguments to pass
*/
*/
protected
void
javadoc
(
String
[]
args
)
{
protected
void
javadoc
(
String
List
args
)
{
int
result
;
int
result
;
PrintStream
old
=
System
.
out
;
PrintStream
old
=
System
.
out
;
try
{
try
{
...
@@ -361,7 +418,8 @@ public class BuildBase {
...
@@ -361,7 +418,8 @@ public class BuildBase {
}
}
Class
clazz
=
Class
.
forName
(
"com.sun.tools.javadoc.Main"
);
Class
clazz
=
Class
.
forName
(
"com.sun.tools.javadoc.Main"
);
Method
execute
=
clazz
.
getMethod
(
"execute"
,
new
Class
[]
{
String
[].
class
});
Method
execute
=
clazz
.
getMethod
(
"execute"
,
new
Class
[]
{
String
[].
class
});
result
=
((
Integer
)
invoke
(
execute
,
null
,
new
Object
[]
{
args
})).
intValue
();
String
[]
array
=
args
.
toArray
();
result
=
((
Integer
)
invoke
(
execute
,
null
,
new
Object
[]
{
array
})).
intValue
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
result
=
exec
(
"javadoc"
,
args
);
result
=
exec
(
"javadoc"
,
args
);
}
finally
{
}
finally
{
...
@@ -667,12 +725,12 @@ public class BuildBase {
...
@@ -667,12 +725,12 @@ public class BuildBase {
* @param args the command line parameters
* @param args the command line parameters
* @param files the file list
* @param files the file list
*/
*/
protected
void
javac
(
String
[]
args
,
FileList
files
)
{
protected
void
javac
(
String
List
args
,
FileList
files
)
{
println
(
"Compiling "
+
files
.
size
()
+
" classes"
);
println
(
"Compiling "
+
files
.
size
()
+
" classes"
);
ArrayList
argList
=
new
ArrayList
(
Arrays
.
asList
(
args
)
);
StringList
params
=
new
StringList
(
);
argList
.
addAll
(
getPaths
(
filterFiles
(
files
,
true
,
".java"
))
);
params
.
addAll
(
args
);
args
=
new
String
[
argList
.
size
()]
;
params
.
addAll
(
getPaths
(
filterFiles
(
files
,
true
,
".java"
)))
;
argList
.
toArray
(
args
);
String
[]
array
=
params
.
toArray
(
);
int
result
;
int
result
;
PrintStream
old
=
System
.
err
;
PrintStream
old
=
System
.
err
;
try
{
try
{
...
@@ -684,7 +742,7 @@ public class BuildBase {
...
@@ -684,7 +742,7 @@ public class BuildBase {
Class
clazz
=
Class
.
forName
(
"com.sun.tools.javac.Main"
);
Class
clazz
=
Class
.
forName
(
"com.sun.tools.javac.Main"
);
Method
compile
=
clazz
.
getMethod
(
"compile"
,
new
Class
[]
{
String
[].
class
});
Method
compile
=
clazz
.
getMethod
(
"compile"
,
new
Class
[]
{
String
[].
class
});
Object
instance
=
clazz
.
newInstance
();
Object
instance
=
clazz
.
newInstance
();
result
=
((
Integer
)
invoke
(
compile
,
instance
,
new
Object
[]
{
ar
gs
})).
intValue
();
result
=
((
Integer
)
invoke
(
compile
,
instance
,
new
Object
[]
{
ar
ray
})).
intValue
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
result
=
exec
(
"javac"
,
args
);
result
=
exec
(
"javac"
,
args
);
...
@@ -702,14 +760,12 @@ public class BuildBase {
...
@@ -702,14 +760,12 @@ public class BuildBase {
* @param className the class name
* @param className the class name
* @param args the command line parameters to pass
* @param args the command line parameters to pass
*/
*/
protected
void
java
(
String
className
,
String
[]
args
)
{
protected
void
java
(
String
className
,
String
List
args
)
{
println
(
"Running "
+
className
);
println
(
"Running "
+
className
);
if
(
args
==
null
)
{
String
[]
array
=
args
==
null
?
new
String
[
0
]
:
args
.
toArray
();
args
=
new
String
[
0
];
}
try
{
try
{
Method
main
=
Class
.
forName
(
className
).
getMethod
(
"main"
,
new
Class
[]
{
String
[].
class
});
Method
main
=
Class
.
forName
(
className
).
getMethod
(
"main"
,
new
Class
[]
{
String
[].
class
});
invoke
(
main
,
null
,
new
Object
[]
{
ar
gs
});
invoke
(
main
,
null
,
new
Object
[]
{
ar
ray
});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Error
(
e
);
throw
new
Error
(
e
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论