Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
86792ec9
提交
86792ec9
authored
9 年前
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #237 from tomasp8/better-build
Improve build script: fork the same JRE, show target descriptions
上级
1eb9a748
9d15b1d0
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
97 行增加
和
31 行删除
+97
-31
checkstyle.xml
h2/src/installer/checkstyle.xml
+1
-1
Build.java
h2/src/tools/org/h2/build/Build.java
+51
-29
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+45
-1
没有找到文件。
h2/src/installer/checkstyle.xml
浏览文件 @
86792ec9
...
...
@@ -39,7 +39,7 @@
<module
name=
"ParenPad"
/>
<module
name=
"WhitespaceAfter"
/>
<module
name=
"WhitespaceAround"
>
<property
name=
"tokens"
value=
"ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND
,WILDCARD_TYPE
"
/>
<property
name=
"tokens"
value=
"ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"
/>
</module>
<module
name=
"ModifierOrder"
/>
<module
name=
"RedundantModifier"
/>
...
...
This diff is collapsed.
Click to expand it.
h2/src/tools/org/h2/build/Build.java
浏览文件 @
86792ec9
差异被折叠。
点击展开。
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
86792ec9
...
...
@@ -18,6 +18,11 @@ import java.io.InputStreamReader;
import
java.io.OutputStream
;
import
java.io.PrintStream
;
import
java.io.RandomAccessFile
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
...
...
@@ -36,6 +41,7 @@ import java.util.zip.Deflater;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
/**
* This class is a complete pure Java build tool. It allows to build this
* project without any external dependencies except a JDK.
...
...
@@ -44,6 +50,16 @@ import java.util.zip.ZipOutputStream;
*/
public
class
BuildBase
{
/**
* Stores descriptions for methods which can be invoked as build targets.
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
METHOD
)
@Documented
public
static
@interface
Description
{
String
summary
()
default
""
;
}
/**
* A list of strings.
*/
...
...
@@ -158,6 +174,18 @@ public class BuildBase {
*/
protected
boolean
quiet
;
/**
* The full path to the executable of the current JRE.
*/
protected
String
javaExecutable
=
System
.
getProperty
(
"java.home"
)
+
File
.
separator
+
"bin"
+
File
.
separator
+
"java"
;
/**
* The full path to the tools jar of the current JDK.
*/
protected
String
javaToolsJar
=
System
.
getProperty
(
"java.home"
)
+
File
.
separator
+
".."
+
File
.
separator
+
"lib"
+
File
.
separator
+
"tools.jar"
;
/**
* This method should be called by the main method.
*
...
...
@@ -283,11 +311,17 @@ public class BuildBase {
}
});
sysOut
.
println
(
"Targets:"
);
String
description
;
for
(
Method
m
:
methods
)
{
int
mod
=
m
.
getModifiers
();
if
(!
Modifier
.
isStatic
(
mod
)
&&
Modifier
.
isPublic
(
mod
)
&&
m
.
getParameterTypes
().
length
==
0
)
{
sysOut
.
println
(
m
.
getName
());
if
(
m
.
isAnnotationPresent
(
Description
.
class
))
{
description
=
String
.
format
(
"%1$-20s %2$s"
,
m
.
getName
(),
m
.
getAnnotation
(
Description
.
class
).
summary
());
}
else
{
description
=
m
.
getName
();
}
sysOut
.
println
(
description
);
}
}
sysOut
.
println
();
...
...
@@ -320,6 +354,16 @@ public class BuildBase {
return
exec
(
script
,
args
);
}
/**
* Execute java in a separate process, but using the java executable of the current JRE.
*
* @param args the command line parameters for the java command
* @return the exit value
*/
protected
int
execJava
(
StringList
args
)
{
return
exec
(
javaExecutable
,
args
);
}
/**
* Execute a program in a separate process.
*
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论