Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
java镜像
Smart Generator
提交
39f5d2c8
S
Smart Generator
项目概览
后端镜像
/
java镜像
/
Smart Generator
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Smart Generator
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
39f5d2c8
编写于
5月 09, 2014
作者:
黄
黄勇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【I】代码优化
上级
8797307d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
14 deletion
+13
-14
pom.xml
pom.xml
+1
-1
src/main/java/org/smart4j/generator/command/Command.java
src/main/java/org/smart4j/generator/command/Command.java
+12
-13
未找到文件。
pom.xml
浏览文件 @
39f5d2c8
...
...
@@ -43,7 +43,7 @@
<dependency>
<groupId>
org.smart4j
</groupId>
<artifactId>
smart-framework
</artifactId>
<version>
2.
2
-SNAPSHOT
</version>
<version>
2.
3
-SNAPSHOT
</version>
</dependency>
</dependencies>
...
...
src/main/java/org/smart4j/generator/command/Command.java
浏览文件 @
39f5d2c8
...
...
@@ -12,7 +12,7 @@ public abstract class Command {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Command
.
class
);
private
static
Properties
config
;
private
static
Properties
props
;
public
final
boolean
exec
(
String
...
params
)
{
boolean
result
=
true
;
...
...
@@ -48,27 +48,26 @@ public abstract class Command {
}
protected
final
String
getAppName
(
String
appPath
)
{
// TODO 无法获取
return
getConfigProperty
(
appPath
,
"app.name"
);
return
getConfigProperty
(
appPath
,
"smart.framework.app.name"
);
}
protected
final
String
getAppPackage
(
String
appPath
)
{
return
getConfigProperty
(
appPath
,
"app.base_package"
);
return
getConfigProperty
(
appPath
,
"
smart.framework.
app.base_package"
);
}
private
String
getConfigProperty
(
String
appPath
,
String
prop
ert
y
)
{
String
appNam
e
;
private
String
getConfigProperty
(
String
appPath
,
String
prop
Ke
y
)
{
String
propValu
e
;
try
{
if
(
config
==
null
)
{
config
=
new
Properties
();
config
.
load
(
new
FileInputStream
(
appPath
+
"/src/main/resources/config
.properties"
));
if
(
props
==
null
)
{
props
=
new
Properties
();
props
.
load
(
new
FileInputStream
(
appPath
+
"/src/main/resources/smart
.properties"
));
}
appName
=
config
.
getProperty
(
propert
y
);
propValue
=
props
.
getProperty
(
propKe
y
);
}
catch
(
FileNotFoundException
e
)
{
throw
new
RuntimeException
(
"无法找到
config
.properties 文件!"
);
throw
new
RuntimeException
(
"无法找到
smart
.properties 文件!"
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"加载
config
.properties 文件出错!"
);
throw
new
RuntimeException
(
"加载
smart
.properties 文件出错!"
);
}
return
appNam
e
;
return
propValu
e
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录