Skip to content

Commit 44d2c90

Browse files
committed
Initial commit
0 parents  commit 44d2c90

35 files changed

+59834
-0
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
service_name: travis-ci

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# maven ignore
2+
target/
3+
*.war
4+
*.zip
5+
*.tar
6+
*.tar.gz
7+
8+
# eclipse ignore
9+
.settings/
10+
.project
11+
.classpath
12+
13+
# idea ignore
14+
.idea/
15+
*.ipr
16+
*.iml
17+
*.iws
18+
19+
# temp ignore
20+
*.log
21+
*.cache
22+
*.diff
23+
*.patch
24+
*.tmp
25+
*.java~
26+
*.properties~
27+
*.xml~
28+
29+
# system ignore
30+
.DS_Store
31+
Thumbs.db
32+

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: java
2+
jdk:
3+
- oraclejdk8
4+
install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true
5+
script: mvn test
6+
after_success:
7+
- mvn clean cobertura:cobertura coveralls:report

CHANGELOG.md

Whitespace-only changes.

LICENSE.txt

Lines changed: 331 additions & 0 deletions
Large diffs are not rendered by default.

README-ENGLISH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# opencc4j

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# opencc4j

pom.xml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.github.houbb</groupId>
8+
<artifactId>opencc4j</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
12+
<properties>
13+
<!--============================== All PLUGINS START ==============================-->
14+
<plugin.compiler.version>3.2</plugin.compiler.version>
15+
<plugin.compiler.version>3.2</plugin.compiler.version>
16+
<plugin.surefire.version>2.18.1</plugin.surefire.version>
17+
<plugin.surefire.skip-it>false</plugin.surefire.skip-it>
18+
<plugin.surefire.ignore-failure>false</plugin.surefire.ignore-failure>
19+
20+
<plugin.gen.version>1.0.1</plugin.gen.version>
21+
<plugin.coveralls.version>4.3.0</plugin.coveralls.version>
22+
<plugin.cobertura.version>2.7</plugin.cobertura.version>
23+
<!--============================== All PLUGINS END ==============================-->
24+
25+
<!--============================== MAIN START ==============================-->
26+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27+
<compiler.level>1.7</compiler.level>
28+
<!--============================== MAIN START ==============================-->
29+
30+
<!--============================== JAR START ==============================-->
31+
<jieba-analysis.version>1.0.2</jieba-analysis.version>
32+
<paradise-common.version>1.1.3</paradise-common.version>
33+
34+
<!--test-->
35+
<junit.version>4.12</junit.version>
36+
<junitperf.version>1.0.1</junitperf.version>
37+
<!--============================== JAR START ==============================-->
38+
</properties>
39+
40+
<dependencies>
41+
<dependency>
42+
<groupId>com.github.houbb</groupId>
43+
<artifactId>paradise-common</artifactId>
44+
<version>${paradise-common.version}</version>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<finalName>${project.name}</finalName>
50+
51+
<pluginManagement>
52+
<!--============================== All Plugins ==============================-->
53+
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-compiler-plugin</artifactId>
57+
<version>${plugin.compiler.version}</version>
58+
<configuration>
59+
<source>${compiler.level}</source>
60+
<target>${compiler.level}</target>
61+
<encoding>${project.build.sourceEncoding}</encoding>
62+
</configuration>
63+
</plugin>
64+
65+
<plugin>
66+
<groupId>org.apache.maven.plugins</groupId>
67+
<artifactId>maven-surefire-plugin</artifactId>
68+
<version>${plugin.surefire.version}</version>
69+
<configuration>
70+
<skipTests>${plugin.surefire.skip-it}</skipTests>
71+
<testFailureIgnore>${plugin.surefire.ignore-failure}</testFailureIgnore>
72+
</configuration>
73+
</plugin>
74+
75+
<plugin>
76+
<groupId>com.github.houbb</groupId>
77+
<artifactId>gen-maven-plugin</artifactId>
78+
<version>1.0.2</version>
79+
<configuration>
80+
<isCommentWhenNetworkBroken>true</isCommentWhenNetworkBroken>
81+
<isOverwriteWhenExists>false</isOverwriteWhenExists>
82+
<encoding>utf-8</encoding>
83+
</configuration>
84+
</plugin>
85+
86+
<!--=================================== coveralls START ===================================-->
87+
<!--mvn cobertura:cobertura coveralls:report -DrepoToken=yourcoverallsprojectrepositorytoken-->
88+
<plugin>
89+
<groupId>org.eluder.coveralls</groupId>
90+
<artifactId>coveralls-maven-plugin</artifactId>
91+
<version>${plugin.coveralls.version}</version>
92+
</plugin>
93+
94+
<plugin>
95+
<groupId>org.codehaus.mojo</groupId>
96+
<artifactId>cobertura-maven-plugin</artifactId>
97+
<version>${plugin.cobertura.version}</version>
98+
<configuration>
99+
<format>xml</format>
100+
<maxmem>256m</maxmem>
101+
<!-- aggregated reports for multi-module projects -->
102+
<aggregate>true</aggregate>
103+
<instrumentation>
104+
<excludes>
105+
<exclude>**/*Test.class</exclude>
106+
<!--<exclude>**/*Vo.class</exclude>-->
107+
</excludes>
108+
</instrumentation>
109+
</configuration>
110+
</plugin>
111+
<!--=================================== coveralls END ===================================-->
112+
113+
</plugins>
114+
</pluginManagement>
115+
116+
<!--use plugins-->
117+
<plugins>
118+
<plugin>
119+
<groupId>org.apache.maven.plugins</groupId>
120+
<artifactId>maven-compiler-plugin</artifactId>
121+
<configuration>
122+
<source>1.8</source>
123+
<target>1.8</target>
124+
</configuration>
125+
</plugin>
126+
127+
<plugin>
128+
<groupId>org.apache.maven.plugins</groupId>
129+
<artifactId>maven-surefire-plugin</artifactId>
130+
</plugin>
131+
132+
<plugin>
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-assembly-plugin</artifactId>
135+
</plugin>
136+
137+
<plugin>
138+
<groupId>com.github.houbb</groupId>
139+
<artifactId>gen-maven-plugin</artifactId>
140+
</plugin>
141+
142+
<!--mvn clean install sonar:sonar -Dmaven.test.skip=true -Dsonar.host.url=http://localhost:9000-->
143+
<!--sonar-->
144+
<plugin>
145+
<groupId>org.sonarsource.scanner.maven</groupId>
146+
<artifactId>sonar-maven-plugin</artifactId>
147+
<version>3.1.1</version>
148+
</plugin>
149+
150+
<!--=================================== coveralls START ===================================-->
151+
<!--mvn cobertura:cobertura coveralls:report -DrepoToken=yourcoverallsprojectrepositorytoken-->
152+
<plugin>
153+
<groupId>org.eluder.coveralls</groupId>
154+
<artifactId>coveralls-maven-plugin</artifactId>
155+
</plugin>
156+
157+
<plugin>
158+
<groupId>org.codehaus.mojo</groupId>
159+
<artifactId>cobertura-maven-plugin</artifactId>
160+
</plugin>
161+
<!--=================================== coveralls END ===================================-->
162+
</plugins>
163+
164+
</build>
165+
166+
</project>

release.bat

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
:: 用于 release 当前项目(windows)
2+
:: author: houbb
3+
:: LastUpdateTime: 2018-1-22 09:08:52
4+
:: 用法:双击运行,或者当前路径 cmd 直接输入 release.bat
5+
6+
:: 关闭回显
7+
@echo OFF
8+
9+
ECHO "============================= RELEASE START..."
10+
11+
:: 版本号信息(需要手动指定)
12+
:::: 旧版本名称
13+
SET version=1.0.0
14+
:::: 新版本名称
15+
SET newVersion=1.0.1
16+
:::: 组织名称
17+
SET groupName=com.github.houbb
18+
:::: 项目名称
19+
SET projectName=opencc4j
20+
21+
:: release 项目版本
22+
:::: snapshot 版本号
23+
SET snapshot_version=%version%"-SNAPSHOT"
24+
:::: 新的版本号
25+
SET release_version=%version%
26+
27+
call mvn versions:set -DgroupId=%groupName% -DartifactId=%projectName% -DoldVersion=%snapshot_version% -DnewVersion=%release_version%
28+
call mvn -N versions:update-child-modules
29+
call mvn versions:commit
30+
call echo "1. RELEASE %snapshot_version% TO %release_version% DONE."
31+
32+
33+
:: 推送到 github
34+
git add .
35+
git commit -m "release branch %version%"
36+
git push
37+
git status
38+
39+
ECHO "2. PUSH TO GITHUB DONE."
40+
41+
:: 合并到 master 分支
42+
:::: 分支名称
43+
SET branchName="release_"%version%
44+
git checkout master
45+
git pull
46+
git checkout %branchName%
47+
git rebase master
48+
git checkout master
49+
git merge %branchName%
50+
git push
51+
52+
ECHO "3. MERGE TO MASTER DONE."
53+
54+
55+
:: 拉取新的分支
56+
SET newBranchName="release_"%newVersion%
57+
git branch %newBranchName%
58+
git checkout %newBranchName%
59+
git push --set-upstream origin %newBranchName%
60+
61+
ECHO "4. NEW BRANCH DONE."
62+
63+
:: 修改新分支的版本号
64+
SET snapshot_new_version=%newVersion%"-SNAPSHOT"
65+
call mvn versions:set -DgroupId=%groupName% -DartifactId=%projectName% -DoldVersion=%release_version% -DnewVersion=%snapshot_new_version%
66+
call mvn -N versions:update-child-modules
67+
call mvn versions:commit
68+
69+
git add .
70+
git commit -m "modify branch %release_version% TO %snapshot_new_version%"
71+
git push
72+
git status
73+
ECHO "5. MODIFY %release_version% TO %snapshot_new_version% DONE."
74+
75+
ECHO "============================= RELEASE END..."
76+

release.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
echo "============================= RELEASE START..."
3+
4+
## 版本号信息(需要手动指定)
5+
version="1.1.3"
6+
newVersion="1.1.4"
7+
projectName="opencc4j"
8+
9+
# release 项目版本
10+
## snapshot 版本号
11+
snapshot_version=${version}"-SNAPSHOT"
12+
## 新的版本号
13+
release_version=${version}
14+
15+
mvn versions:set -DgroupId=com.github.houbb -DartifactId=${projectName} -DoldVersion=${snapshot_version} -DnewVersion=${release_version}
16+
mvn -N versions:update-child-modules
17+
mvn versions:commit
18+
echo "1. RELEASE ${snapshot_version} TO ${release_version} DONE."
19+
20+
21+
# 推送到 github
22+
git add .
23+
git commit -m "release branch ${version}"
24+
git push
25+
git status
26+
27+
echo "2. PUSH TO GITHUB DONE."
28+
29+
30+
# 推送到 maven 中央仓库
31+
mvn clean deploy -P release
32+
33+
echo "3. PUSH TO MAVEN CENTER DONE."
34+
35+
# 合并到 master 分支
36+
branchName="release_"${version} # 分支名称
37+
git checkout master
38+
git pull
39+
git checkout ${branchName}
40+
git rebase master
41+
git checkout master
42+
git merge ${branchName}
43+
git push
44+
45+
echo "4. MERGE TO MASTER DONE."
46+
47+
48+
# 拉取新的分支
49+
newBranchName="release_"${newVersion}
50+
git branch ${newBranchName}
51+
git checkout ${newBranchName}
52+
git push --set-upstream origin ${newBranchName}
53+
54+
echo "5. NEW BRANCH DONE."
55+
56+
# 修改新分支的版本号
57+
## snapshot 版本号
58+
snapshot_new_version=${newVersion}"-SNAPSHOT"
59+
mvn versions:set -DgroupId=com.github.houbb -DartifactId=${projectName} -DoldVersion=${release_version} -DnewVersion=${snapshot_new_version}
60+
mvn -N versions:update-child-modules
61+
mvn versions:commit
62+
63+
git add .
64+
git commit -m "modify branch ${release_version} TO ${snapshot_new_version}"
65+
git push
66+
git status
67+
echo "6. MODIFY ${release_version} TO ${snapshot_new_version} DONE."
68+
69+
echo "============================= RELEASE END..."
70+
71+
72+
# 使用方式:
73+
# 1. 赋值权限: chmod +x ./release.sh
74+
# 2. 执行: ./release.sh
75+
# Last Update Time: 2018-01-20 12:07:34
76+
# Author: houbb
77+
78+

0 commit comments

Comments
 (0)