Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
51cca9a8
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
51cca9a8
编写于
1月 11, 2019
作者:
R
roo00
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改默认资源文件
上级
3585a0e5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
414 addition
and
0 deletion
+414
-0
o2server/.gitignore
o2server/.gitignore
+5
-0
o2server/build.xml
o2server/build.xml
+38
-0
o2server/build_common.xml
o2server/build_common.xml
+114
-0
o2server/console.jar
o2server/console.jar
+0
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java
...ava/com/x/base/core/project/build/CreateConfigSample.java
+145
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateLocalSample.java
...java/com/x/base/core/project/build/CreateLocalSample.java
+21
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateManifestCfg.java
...java/com/x/base/core/project/build/CreateManifestCfg.java
+91
-0
未找到文件。
o2server/.gitignore
浏览文件 @
51cca9a8
.project
.project
/.settings/
/.settings/
/local/
/local/
/localSample/
/config/
/config/
/configSample/
/logs/
/logs/
/target/
/target/
/x_build_and_scratch/
/x_build_and_scratch/
...
@@ -11,4 +13,7 @@ command.swap
...
@@ -11,4 +13,7 @@ command.swap
/node_modules/
/node_modules/
package-lock.json
package-lock.json
**/src/main/resources/META-INF/persistence.xml
**/src/main/resources/META-INF/persistence.xml
**/src/main/resources/META-INF/x_persistence.xml
**/*_.java
**/*_.java
**/src/main/webapp/describe/
console.jar
o2server/
package
.xml
→
o2server/
build
.xml
浏览文件 @
51cca9a8
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
basedir=
"."
name=
"main"
default=
"default"
>
<project
basedir=
"."
name=
"main"
default=
"default"
>
<basename
property=
"project"
file=
"${basedir}"
/>
<basename
property=
"project"
file=
"${basedir}"
/>
<path
id=
"project.classpath"
>
<fileset
dir=
"${basedir}/commons/ext"
>
<include
name=
"*.jar"
/>
</fileset>
<fileset
dir=
"${basedir}/store/jars"
>
<include
name=
"*.jar"
/>
</fileset>
</path>
<tstamp>
<tstamp>
<format
property=
"VERSION"
pattern=
"yyyyMMddHHmmss"
locale=
"zh-cn"
/>
<format
property=
"VERSION"
pattern=
"yyyyMMddHHmmss"
locale=
"zh-cn"
/>
</tstamp>
</tstamp>
<target
name=
"createConfigSample"
>
<delete
dir=
"${basedir}/configSample"
/>
<mkdir
dir=
"${basedir}/configSample"
/>
<java
classname=
"com.x.base.core.project.build.CreateConfigSample"
fork=
"true"
>
<sysproperty
key=
"file.encoding"
value=
"utf-8"
/>
<classpath
refid=
"project.classpath"
/>
<arg
value=
"${basedir}"
/>
</java>
</target>
<target
name=
"createLocalSample"
>
<delete
dir=
"${basedir}/localSample"
/>
<mkdir
dir=
"${basedir}/localSample"
/>
<java
classname=
"com.x.base.core.project.build.CreateLocalSample"
fork=
"true"
>
<sysproperty
key=
"file.encoding"
value=
"utf-8"
/>
<classpath
refid=
"project.classpath"
/>
<arg
value=
"${basedir}"
/>
</java>
</target>
<target
name=
"createManifestCfg"
>
<java
classname=
"com.x.base.core.project.build.CreateManifestCfg"
fork=
"true"
>
<sysproperty
key=
"file.encoding"
value=
"utf-8"
/>
<classpath
refid=
"project.classpath"
/>
<arg
value=
"${basedir}"
/>
</java>
</target>
<target
name=
"default"
>
<target
name=
"default"
>
<delete
dir=
"target"
/>
<delete
dir=
"target"
/>
<mkdir
dir=
"target/o2server"
/>
<mkdir
dir=
"target/o2server"
/>
...
...
o2server/build_common.xml
0 → 100644
浏览文件 @
51cca9a8
<?xml version="1.0" encoding="UTF-8"?>
<project>
<basename
property=
"project"
file=
"${basedir}"
/>
<dirname
property=
"o2server.dir"
file=
"./"
/>
<path
id=
"project.classpath"
>
<fileset
dir=
"${o2server.dir}/commons/ext"
>
<include
name=
"*.jar"
/>
</fileset>
<fileset
dir=
"${o2server.dir}/store/jars"
>
<include
name=
"*.jar"
/>
</fileset>
<pathelement
location=
"${basedir}/target/classes"
/>
</path>
<taskdef
name=
"openjpac"
classname=
"org.apache.openjpa.ant.PCEnhancerTask"
>
<classpath
refid=
"project.classpath"
/>
</taskdef>
<!--
<taskdef name="if-contrib" classname="net.sf.antcontrib.logic.IfTask">
<classpath refid="project.classpath" />
</taskdef>
<taskdef name="for-contrib" classname="net.sf.antcontrib.logic.ForTask">
<classpath refid="project.classpath" />
</taskdef>
<taskdef name="var-contrib" classname="net.sf.antcontrib.property.Variable">
<classpath refid="project.classpath" />
</taskdef>
-->
<target
name=
"metamodel"
>
<delete>
<fileset
dir=
"${basedir}/src/main/java"
includes=
"**/entity/**/*_.java"
/>
</delete>
<javac
srcdir=
"${basedir}/src/main/java"
destdir=
"${basedir}/src/main/java"
includes=
"**/entity/**,**/entity"
debug=
"true"
debuglevel=
"source,lines,vars"
includeantruntime=
"true"
encoding=
"utf-8"
target=
"1.8"
source=
"1.8"
fork=
"true"
>
<classpath
refid=
"project.classpath"
>
</classpath>
<compilerarg
value=
"-Aopenjpa.metamodel=true"
/>
<compilerarg
value=
"-Aopenjpa.log=TRACE"
/>
</javac>
<delete>
<fileset
dir=
"${basedir}/src/main/java"
includes=
"**/*.class"
/>
</delete>
<echo
message=
"metamodel complete."
/>
</target>
<target
name=
"createPersistenceXml"
>
<java
classname=
"com.x.base.core.entity.tools.PersistenceXmlWriter"
fork=
"true"
>
<sysproperty
key=
"file.encoding"
value=
"utf-8"
/>
<classpath>
<pathelement
path=
"${basedir}/target/classes"
/>
<pathelement
path=
"${basedir}/src/main/java"
/>
<fileset
dir=
"${o2server.dir}/commons/ext"
>
<include
name=
"*.jar"
/>
</fileset>
<fileset
dir=
"${o2server.dir}/store/jars"
>
<include
name=
"*.jar"
/>
</fileset>
</classpath>
<arg
value=
"{
project:'${project}',
path:'${basedir}/src/main/resources/META-INF/x_persistence.xml'
}"
/>
</java>
</target>
<target
name=
"describe"
>
<mkdir
dir=
"${basedir}/src/main/webapp/describe"
/>
<delete
includeemptydirs=
"true"
>
<fileset
dir=
"${basedir}/src/main/webapp/describe"
includes=
"**/*"
/>
</delete>
<java
classname=
"com.x.base.core.project.annotation.Describe"
fork=
"true"
>
<sysproperty
key=
"file.encoding"
value=
"utf-8"
/>
<arg
value=
"${basedir}/src/main/webapp/describe"
/>
<arg
value=
"${project}"
/>
<classpath>
<pathelement
location=
"${basedir}/target/classes"
/>
<pathelement
location=
"${basedir}/src/main/resources"
/>
<fileset
dir=
"${o2server.dir}/commons/ext"
>
<include
name=
"*.jar"
/>
</fileset>
<fileset
dir=
"${o2server.dir}/store/jars"
>
<include
name=
"*.jar"
/>
</fileset>
</classpath>
</java>
<copy
todir=
"${basedir}/src/main/webapp/describe/sources"
>
<fileset
dir=
"${basedir}/src/main/java"
>
<include
name=
"**/*.java"
/>
</fileset>
</copy>
</target>
<target
name=
"createEnhancePersistenceXml"
>
<mkdir
dir=
"${basedir}/src/main/resources/META-INF"
/>
<java
classname=
"com.x.base.core.entity.tools.EnhancePersistenceXmlWriter"
fork=
"true"
>
<sysproperty
key=
"file.encoding"
value=
"utf-8"
/>
<classpath>
<pathelement
path=
"${basedir}/target/classes"
/>
<pathelement
path=
"${basedir}/src/main/java"
/>
<pathelement
path=
"${basedir}/src/main/resources"
/>
<fileset
dir=
"${o2server.dir}/commons/ext"
>
<include
name=
"*.jar"
/>
</fileset>
<fileset
dir=
"${o2server.dir}/store/jars"
>
<include
name=
"x_base_core_project.jar"
/>
<exclude
name=
"${project}.jar"
/>
</fileset>
</classpath>
<arg
value=
"{
path:'${basedir}/src/main/resources/META-INF/persistence.xml'
}"
/>
</java>
</target>
</project>
\ No newline at end of file
o2server/console.jar
已删除
100644 → 0
浏览文件 @
3585a0e5
文件已删除
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java
0 → 100644
浏览文件 @
51cca9a8
package
com.x.base.core.project.build
;
import
java.io.File
;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.reflect.FieldUtils
;
import
org.apache.commons.lang3.reflect.MethodUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.Packages
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.config.AppStyle
;
import
com.x.base.core.project.config.CenterServer
;
import
com.x.base.core.project.config.Collect
;
import
com.x.base.core.project.config.ConfigObject
;
import
com.x.base.core.project.config.Dingding
;
import
com.x.base.core.project.config.DumpRestoreData
;
import
com.x.base.core.project.config.DumpRestoreStorage
;
import
com.x.base.core.project.config.ExternalDataSource
;
import
com.x.base.core.project.config.LogLevel
;
import
com.x.base.core.project.config.Meeting
;
import
com.x.base.core.project.config.Messages
;
import
com.x.base.core.project.config.Node
;
import
com.x.base.core.project.config.Person
;
import
com.x.base.core.project.config.ProcessPlatform
;
import
com.x.base.core.project.config.Qiyeweixin
;
import
com.x.base.core.project.config.Query
;
import
com.x.base.core.project.config.Token
;
import
com.x.base.core.project.config.Vfs
;
import
com.x.base.core.project.config.WorkTime
;
import
com.x.base.core.project.config.ZhengwuDingding
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
com.x.base.core.project.tools.FileTools
;
import
io.github.lukehutch.fastclasspathscanner.FastClasspathScanner
;
import
io.github.lukehutch.fastclasspathscanner.scanner.ScanResult
;
public
class
CreateConfigSample
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CreateConfigSample
.
class
);
public
static
void
main
(
String
...
args
)
throws
Exception
{
File
base
=
new
File
(
args
[
0
]);
File
dir
=
new
File
(
base
,
"configSample"
);
FastClasspathScanner
scanner
=
new
FastClasspathScanner
(
Packages
.
PREFIX
);
ScanResult
scanResult
=
scanner
.
scan
();
List
<
Class
<?>>
classes
=
new
ArrayList
<
Class
<?>>();
classes
.
add
(
AppStyle
.
class
);
classes
.
add
(
CenterServer
.
class
);
classes
.
add
(
Collect
.
class
);
classes
.
add
(
Dingding
.
class
);
classes
.
add
(
DumpRestoreData
.
class
);
classes
.
add
(
DumpRestoreStorage
.
class
);
classes
.
add
(
LogLevel
.
class
);
classes
.
add
(
Meeting
.
class
);
classes
.
add
(
Messages
.
class
);
classes
.
add
(
Node
.
class
);
classes
.
add
(
Person
.
class
);
classes
.
add
(
ProcessPlatform
.
class
);
classes
.
add
(
Qiyeweixin
.
class
);
classes
.
add
(
Query
.
class
);
classes
.
add
(
Token
.
class
);
classes
.
add
(
Vfs
.
class
);
classes
.
add
(
WorkTime
.
class
);
classes
.
add
(
ZhengwuDingding
.
class
);
classes
.
add
(
ExternalDataSource
.
class
);
Collections
.
sort
(
classes
,
new
Comparator
<
Class
<?>>()
{
public
int
compare
(
Class
<?>
c1
,
Class
<?>
c2
)
{
return
c1
.
getCanonicalName
().
compareTo
(
c2
.
getCanonicalName
());
}
});
for
(
Class
<?>
cls
:
classes
)
{
Object
o
=
MethodUtils
.
invokeStaticMethod
(
cls
,
"defaultInstance"
,
null
);
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<
String
,
Object
>();
map
=
XGsonBuilder
.
convert
(
o
,
map
.
getClass
());
map
=
describe
(
cls
,
map
);
String
name
=
StringUtils
.
lowerCase
(
cls
.
getSimpleName
().
substring
(
0
,
1
))
+
cls
.
getSimpleName
().
substring
(
1
)
+
".json"
;
File
file
=
new
File
(
dir
,
name
);
logger
.
print
(
"create file:{}."
,
file
.
getAbsoluteFile
());
FileUtils
.
write
(
file
,
XGsonBuilder
.
toJson
(
map
),
DefaultCharset
.
charset
);
}
convertExternalDataSource2ExternalDataSources
(
dir
);
renameNode
(
dir
);
}
private
static
void
convertExternalDataSource2ExternalDataSources
(
File
dir
)
throws
Exception
,
IOException
{
File
file_externalDataSource
=
new
File
(
dir
,
"externalDataSource.json"
);
File
file_externalDataSources
=
new
File
(
dir
,
"externalDataSources.json"
);
JsonElement
jsonElement
=
XGsonBuilder
.
instance
().
fromJson
(
FileUtils
.
readFileToString
(
file_externalDataSource
,
DefaultCharset
.
charset
),
JsonElement
.
class
);
List
<
JsonElement
>
list
=
new
ArrayList
<>();
list
.
add
(
jsonElement
);
FileUtils
.
writeStringToFile
(
file_externalDataSources
,
XGsonBuilder
.
toJson
(
list
),
DefaultCharset
.
charset
);
file_externalDataSource
.
delete
();
}
private
static
void
renameNode
(
File
dir
)
throws
Exception
,
IOException
{
File
file_node
=
new
File
(
dir
,
"node.json"
);
File
file_node_local
=
new
File
(
dir
,
"node_127.0.0.1.json"
);
if
(
file_node_local
.
exists
())
{
file_node_local
.
delete
();
}
FileUtils
.
moveFile
(
file_node
,
file_node_local
);
}
private
static
<
T
extends
ConfigObject
>
Map
<
String
,
Object
>
describe
(
Class
<?>
cls
,
Map
<
String
,
Object
>
map
)
throws
Exception
{
for
(
Field
field
:
FieldUtils
.
getFieldsListWithAnnotation
(
cls
,
FieldDescribe
.
class
))
{
map
.
put
(
"###"
+
field
.
getName
(),
field
.
getAnnotation
(
FieldDescribe
.
class
).
value
()
+
"###"
);
if
(
ConfigObject
.
class
.
isAssignableFrom
(
field
.
getType
()))
{
Object
o
=
MethodUtils
.
invokeStaticMethod
(
field
.
getType
(),
"defaultInstance"
,
null
);
Map
<
String
,
Object
>
m
=
new
LinkedHashMap
<
String
,
Object
>();
m
=
XGsonBuilder
.
convert
(
o
,
m
.
getClass
());
map
.
put
(
field
.
getName
(),
describe
(
field
.
getType
(),
m
));
}
else
if
(
List
.
class
.
isAssignableFrom
(
field
.
getType
()))
{
ParameterizedType
parameterized
=
(
ParameterizedType
)
field
.
getGenericType
();
Class
<
Object
>
actualClass
=
(
Class
<
Object
>)
parameterized
.
getActualTypeArguments
()[
0
];
if
(
ConfigObject
.
class
.
isAssignableFrom
(
actualClass
))
{
Object
o
=
MethodUtils
.
invokeStaticMethod
(
actualClass
,
"defaultInstance"
,
null
);
Map
<
String
,
Object
>
m
=
new
LinkedHashMap
<
String
,
Object
>();
m
=
XGsonBuilder
.
convert
(
o
,
m
.
getClass
());
List
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
describe
(
actualClass
,
m
));
map
.
put
(
field
.
getName
(),
list
);
}
}
}
return
map
;
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateLocalSample.java
0 → 100644
浏览文件 @
51cca9a8
package
com.x.base.core.project.build
;
import
java.io.File
;
import
org.apache.commons.io.FileUtils
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DefaultCharset
;
public
class
CreateLocalSample
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CreateLocalSample
.
class
);
public
static
void
main
(
String
...
args
)
throws
Exception
{
File
base
=
new
File
(
args
[
0
]);
File
dir
=
new
File
(
base
,
"localSample"
);
File
node_cfg
=
new
File
(
dir
,
"node.cfg"
);
FileUtils
.
write
(
node_cfg
,
"127.0.0.1"
,
DefaultCharset
.
charset
);
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateManifestCfg.java
0 → 100644
浏览文件 @
51cca9a8
package
com.x.base.core.project.build
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
public
class
CreateManifestCfg
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CreateManifestCfg
.
class
);
public
static
void
main
(
String
[]
args
)
throws
Exception
{
File
base
=
new
File
(
args
[
0
]);
CreateManifestCfg
creator
=
new
CreateManifestCfg
();
creator
.
commonsExt
(
base
);
creator
.
storeJars
(
base
);
creator
.
store
(
base
);
}
public
void
store
(
File
base
)
throws
Exception
{
File
dir
=
new
File
(
base
,
"store"
);
if
((!
dir
.
exists
())
||
(!
dir
.
isDirectory
()))
{
throw
new
Exception
(
"error"
);
}
List
<
String
>
names
=
new
ArrayList
<>();
for
(
File
o
:
dir
.
listFiles
())
{
if
((!
StringUtils
.
equals
(
o
.
getName
(),
"manifest.cfg"
))
&&
(!
StringUtils
.
equals
(
o
.
getName
(),
"jars"
))
&&
(!
StringUtils
.
equals
(
o
.
getName
(),
".gitignore"
)))
{
if
(
StringUtils
.
isNotEmpty
(
o
.
getName
()))
{
if
((!
StringUtils
.
equals
(
"x_report_assemble_control.war"
,
o
.
getName
()))
&&
(!
StringUtils
.
equals
(
"x_strategydeploy_assemble_control.war"
,
o
.
getName
())))
{
names
.
add
(
o
.
getName
());
}
}
}
}
names
=
names
.
stream
().
sorted
().
collect
(
Collectors
.
toList
());
File
file
=
new
File
(
dir
,
"manifest.cfg"
);
logger
.
print
(
"create manifest.cfg, path:{}."
,
file
.
getAbsolutePath
());
FileUtils
.
writeLines
(
file
,
names
);
}
public
void
storeJars
(
File
base
)
throws
Exception
{
File
dir
=
new
File
(
base
,
"store/jars"
);
if
((!
dir
.
exists
())
||
(!
dir
.
isDirectory
()))
{
throw
new
Exception
(
"error"
);
}
List
<
String
>
names
=
new
ArrayList
<>();
for
(
File
o
:
dir
.
listFiles
())
{
if
((!
StringUtils
.
equals
(
o
.
getName
(),
"manifest.cfg"
))
&&
(!
StringUtils
.
equals
(
o
.
getName
(),
".gitignore"
)))
{
if
(
StringUtils
.
isNotEmpty
(
o
.
getName
()))
{
if
((!
StringUtils
.
equals
(
"x_report_core_entity.jar"
,
o
.
getName
()))
&&
(!
StringUtils
.
equals
(
"x_strategydeploy_core_entity.jar"
,
o
.
getName
())))
{
names
.
add
(
o
.
getName
());
}
}
}
}
names
=
names
.
stream
().
sorted
().
collect
(
Collectors
.
toList
());
File
file
=
new
File
(
dir
,
"manifest.cfg"
);
logger
.
print
(
"create manifest.cfg, path:{}."
,
file
.
getAbsolutePath
());
FileUtils
.
writeLines
(
file
,
names
);
}
public
void
commonsExt
(
File
base
)
throws
Exception
{
File
dir
=
new
File
(
base
,
"commons/ext"
);
if
((!
dir
.
exists
())
||
(!
dir
.
isDirectory
()))
{
throw
new
Exception
(
"error"
);
}
List
<
String
>
names
=
new
ArrayList
<>();
for
(
File
o
:
dir
.
listFiles
())
{
if
((!
StringUtils
.
equals
(
o
.
getName
(),
"manifest.cfg"
))
&&
(!
StringUtils
.
equals
(
o
.
getName
(),
".gitignore"
)))
{
if
(
StringUtils
.
isNotEmpty
(
o
.
getName
()))
{
names
.
add
(
o
.
getName
());
}
}
}
names
=
names
.
stream
().
sorted
().
collect
(
Collectors
.
toList
());
File
file
=
new
File
(
dir
,
"manifest.cfg"
);
logger
.
print
(
"create manifest.cfg, path:{}."
,
file
.
getAbsolutePath
());
FileUtils
.
writeLines
(
file
,
names
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录