Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
0655d670
提交
0655d670
authored
14 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The build tool now supports (minimalistic) shell mode, started using ./build.sh -
上级
15efc627
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
9 行删除
+51
-9
build.html
h2/src/docsrc/html/build.html
+4
-1
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+47
-8
没有找到文件。
h2/src/docsrc/html/build.html
浏览文件 @
0655d670
...
...
@@ -88,10 +88,13 @@ You will get a list of targets. If you want to build the <code>jar</code> file,
<pre>
build jar
</pre>
<p>
To run the build tool in shell mode, use the command line option
<code>
-
</code>
as in
<code>
./build.sh -
</code>
.
</p>
<h3>
Switching the Source Code
</h3>
<p>
By default the source code uses Java 1.
5 features, however Java 1.6
is supported as well.
By default the source code uses Java 1.
6 features, however Java 1.5
is supported as well.
To switch the source code to the installed version of Java, run:
</p>
<pre>
...
...
This diff is collapsed.
Click to expand it.
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
0655d670
...
...
@@ -8,12 +8,14 @@ package org.h2.build;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.BufferedReader
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.FilterOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.io.PrintStream
;
import
java.io.RandomAccessFile
;
...
...
@@ -169,6 +171,9 @@ public class BuildBase {
for
(
String
a
:
args
)
{
if
(
"-quiet"
.
equals
(
a
))
{
quiet
=
true
;
}
else
if
(
a
.
startsWith
(
"-"
))
{
runShell
();
return
;
}
else
if
(
a
.
startsWith
(
"-D"
))
{
String
value
;
String
key
=
a
.
substring
(
2
);
...
...
@@ -181,20 +186,54 @@ public class BuildBase {
}
System
.
setProperty
(
key
,
value
);
}
else
{
if
(!
runTarget
(
a
))
{
break
;
}
}
}
}
println
(
"Done in "
+
(
System
.
currentTimeMillis
()
-
time
)
+
" ms"
);
}
private
boolean
runTarget
(
String
target
)
{
Method
m
=
null
;
try
{
m
=
getClass
().
getMethod
(
a
);
m
=
getClass
().
getMethod
(
target
);
}
catch
(
Exception
e
)
{
sysOut
.
println
(
"Unknown target: "
+
a
);
sysOut
.
println
(
"Unknown target: "
+
target
);
projectHelp
();
break
;
return
false
;
}
println
(
"Target: "
+
a
);
println
(
"Target: "
+
target
);
invoke
(
m
,
this
,
new
Object
[
0
]);
return
true
;
}
private
void
runShell
()
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
));
String
last
=
""
,
line
;
System
.
out
.
println
(
"Shell mode. Type the target, then [Enter]. Just [Enter] repeats the last target."
);
while
(
true
)
{
System
.
out
.
print
(
"build> "
);
try
{
line
=
reader
.
readLine
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
line
.
length
()
==
0
)
{
line
=
last
;
}
else
if
(
line
.
equals
(
"exit"
)
||
line
.
equals
(
"quit"
))
{
break
;
}
long
time
=
System
.
currentTimeMillis
();
try
{
runTarget
(
line
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
}
println
(
"Done in "
+
(
System
.
currentTimeMillis
()
-
time
)
+
" ms"
);
last
=
line
;
}
}
private
Object
invoke
(
Method
m
,
Object
instance
,
Object
[]
args
)
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论