Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_corba
提交
a2f427ae
D
dragonwell8_corba
项目概览
openanolis
/
dragonwell8_corba
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_corba
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a2f427ae
编写于
3月 21, 2012
作者:
K
katleman
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
00712fe6
328fffbe
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
38 deletion
+46
-38
make/common/internal/Resources.gmk
make/common/internal/Resources.gmk
+2
-2
make/tools/src/build/tools/stripproperties/StripPropertiesCorba.java
...src/build/tools/stripproperties/StripPropertiesCorba.java
+43
-35
make/tools/strip_properties/Makefile
make/tools/strip_properties/Makefile
+1
-1
未找到文件。
make/common/internal/Resources.gmk
浏览文件 @
a2f427ae
...
...
@@ -149,8 +149,8 @@ strip_prop_options_clean:
# Strip the properties files
strip_all_props: $(STRIPPROPERTIES_JARFILE) $(STRIP_PROP_options)
@if [ -s $(STRIP_PROP_options) ] ; then \
$(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE)
-optionsfile
$(STRIP_PROP_options)" ; \
$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE)
-optionsfile
$(STRIP_PROP_options) ; \
$(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE)
@
$(STRIP_PROP_options)" ; \
$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE)
@
$(STRIP_PROP_options) ; \
fi
@$(java-vm-cleanup)
...
...
make/tools/src/build/tools/stripproperties/StripProperties.java
→
make/tools/src/build/tools/stripproperties/StripProperties
Corba
.java
浏览文件 @
a2f427ae
/*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001,
2011,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -36,6 +36,7 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Enumeration
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Properties
;
...
...
@@ -43,7 +44,7 @@ import java.util.Properties;
* Reads a properties file from standard input and writes an equivalent
* properties file without comments to standard output.
*/
public
class
StripProperties
{
public
class
StripProperties
Corba
{
private
static
void
error
(
String
msg
,
Exception
e
)
{
System
.
err
.
println
(
"ERROR: stripproperties: "
+
msg
);
...
...
@@ -53,82 +54,89 @@ public class StripProperties {
}
}
private
static
List
<
String
>
parseOptions
(
String
args
[])
{
List
<
String
>
files
=
new
ArrayList
<
String
>();
private
static
List
<
String
>
infiles
=
new
ArrayList
<
String
>();
private
static
List
<
String
>
outfiles
=
new
ArrayList
<
String
>();
private
static
boolean
parseOptions
(
String
args
[])
{
boolean
ok
=
true
;
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++
)
{
if
(
"-optionsfile"
.
equals
(
args
[
i
])
&&
i
+
1
<
args
.
length
)
{
String
filename
=
args
[++
i
];
if
(
"-clean"
.
equals
(
args
[
i
])
&&
i
+
2
<
args
.
length
)
{
infiles
.
add
(
args
[++
i
]);
outfiles
.
add
(
args
[++
i
]);
}
else
if
(
args
[
i
].
charAt
(
0
)==
'@'
)
{
String
filename
=
args
[
i
].
substring
(
1
);
FileInputStream
finput
=
null
;
byte
contents
[]
=
null
;
try
{
finput
=
new
FileInputStream
(
filename
);
int
byteCount
=
finput
.
available
();
if
(
byteCount
<=
0
)
{
error
(
"The
-optionsfile
file is empty"
,
null
);
files
=
null
;
error
(
"The
@
file is empty"
,
null
);
ok
=
false
;
}
else
{
contents
=
new
byte
[
byteCount
];
int
bytesRead
=
finput
.
read
(
contents
);
if
(
byteCount
!=
bytesRead
)
{
error
(
"Cannot read all of
-optionsfile
file"
,
null
);
files
=
null
;
error
(
"Cannot read all of
@
file"
,
null
);
ok
=
false
;
}
}
}
catch
(
IOException
e
)
{
error
(
"cannot open "
+
filename
,
e
);
files
=
null
;
ok
=
false
;
}
if
(
finput
!=
null
)
{
try
{
finput
.
close
();
}
catch
(
IOException
e
)
{
files
=
null
;
ok
=
false
;
error
(
"cannot close "
+
filename
,
e
);
}
}
if
(
files
!=
null
&&
contents
!=
null
)
{
if
(
ok
&&
contents
!=
null
)
{
String
tokens
[]
=
(
new
String
(
contents
)).
split
(
"\\s+"
);
if
(
tokens
.
length
>
0
)
{
List
<
String
>
ofiles
=
parseOptions
(
tokens
);
if
(
ofiles
!=
null
)
{
files
.
addAll
(
ofiles
);
}
else
{
error
(
"No files found in file"
,
null
);
files
=
null
;
}
ok
=
parseOptions
(
tokens
);
}
}
if
(
files
==
null
)
{
if
(
!
ok
)
{
break
;
}
}
else
{
files
.
add
(
args
[
i
]);
infiles
.
add
(
args
[
i
]);
outfiles
.
add
(
args
[
i
]);
}
}
return
files
;
return
ok
;
}
private
static
boolean
stripFiles
(
List
<
String
>
files
)
{
private
static
boolean
stripFiles
(
List
<
String
>
infiles
,
List
<
String
>
out
files
)
{
boolean
ok
=
true
;
for
(
String
file
:
files
)
{
Iterator
<
String
>
inIter
=
infiles
.
iterator
();
Iterator
<
String
>
outIter
=
outfiles
.
iterator
();
for
(;
inIter
.
hasNext
();
)
{
String
infile
=
inIter
.
next
();
String
outfile
=
outIter
.
next
();
Properties
prop
=
new
Properties
();
InputStream
in
=
null
;
try
{
in
=
new
BufferedInputStream
(
new
FileInputStream
(
file
));
in
=
new
BufferedInputStream
(
new
FileInputStream
(
in
file
));
prop
.
load
(
in
);
}
catch
(
FileNotFoundException
e
)
{
error
(
"Cannot access file "
+
file
,
e
);
error
(
"Cannot access file "
+
in
file
,
e
);
ok
=
false
;
}
catch
(
IOException
e
)
{
error
(
"IO exception processing file "
+
file
,
e
);
error
(
"IO exception processing file "
+
in
file
,
e
);
ok
=
false
;
}
if
(
in
!=
null
)
{
try
{
in
.
close
();
}
catch
(
IOException
e
)
{
error
(
"IO exception closing file "
+
file
,
e
);
error
(
"IO exception closing file "
+
in
file
,
e
);
ok
=
false
;
}
}
...
...
@@ -138,18 +146,18 @@ public class StripProperties {
OutputStream
out
=
null
;
try
{
out
=
new
FileOutputStream
(
file
);
out
=
new
FileOutputStream
(
out
file
);
storeProperties
(
prop
,
out
);
out
.
flush
();
}
catch
(
IOException
e
)
{
error
(
"IO exception processing file "
+
file
,
e
);
error
(
"IO exception processing file "
+
out
file
,
e
);
ok
=
false
;
}
if
(
out
!=
null
)
{
try
{
out
.
close
();
}
catch
(
IOException
e
)
{
error
(
"IO exception closing file "
+
file
,
e
);
error
(
"IO exception closing file "
+
out
file
,
e
);
ok
=
false
;
}
}
...
...
@@ -166,8 +174,8 @@ public class StripProperties {
* @param args Names of properties files to process and replace contents
*/
public
static
void
main
(
String
args
[])
{
List
<
String
>
files
=
parseOptions
(
args
);
if
(
files
==
null
||
!
stripFiles
(
files
)
)
{
boolean
ok
=
parseOptions
(
args
);
if
(
!
ok
||
!
stripFiles
(
infiles
,
out
files
)
)
{
System
.
exit
(
1
);
}
}
...
...
@@ -246,7 +254,7 @@ public class StripProperties {
throws
IOException
{
BufferedWriter
awriter
;
awriter
=
new
BufferedWriter
(
new
OutputStreamWriter
(
out
,
"8859_1"
));
for
(
Enumeration
e
=
properties
.
keys
();
e
.
hasMoreElements
();)
{
for
(
Enumeration
<
Object
>
e
=
properties
.
keys
();
e
.
hasMoreElements
();)
{
String
key
=
(
String
)
e
.
nextElement
();
String
val
=
(
String
)
properties
.
get
(
key
);
key
=
saveConvert
(
key
,
true
);
...
...
make/tools/strip_properties/Makefile
浏览文件 @
a2f427ae
...
...
@@ -34,7 +34,7 @@ PROGRAM = stripproperties
include
$(BUILDDIR)/common/Defs.gmk
BUILDTOOL_SOURCE_ROOT
=
$(BUILDDIR)
/tools/src
BUILDTOOL_MAIN
=
$(PKGDIR)
/StripProperties.java
BUILDTOOL_MAIN
=
$(PKGDIR)
/StripProperties
Corba
.java
#
# Build tool jar rules.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录