Skip to content

Commit 838642a

Browse files
committed
refactor: refactor with kotlin
1 parent 636c293 commit 838642a

File tree

146 files changed

+6390
-6166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+6390
-6166
lines changed

.coveralls.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.editorconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[*]
2+
charset=utf-8
3+
end_of_line=lf
4+
indent_size=4
5+
indent_style=space
6+
insert_final_newline=true
7+
max_line_length=180
8+
tab_width=4
9+
ij_continuation_indent_size=8
10+
ij_formatter_off_tag=@formatter:off
11+
ij_formatter_on_tag=@formatter:on
12+
ij_formatter_tags_enabled=true
13+
ij_smart_tabs=false
14+
ij_visual_guides=120,160
15+
ij_wrap_on_typing=false
16+
17+
[.editorconfig]
18+
ij_editorconfig_align_group_field_declarations=false
19+
ij_editorconfig_space_after_colon=false
20+
ij_editorconfig_space_after_comma=false
21+
ij_editorconfig_space_before_colon=false
22+
ij_editorconfig_space_before_comma=false
23+
ij_editorconfig_spaces_around_assignment_operators=false
24+
25+
[{*.sh,mvnw,gradlew}]
26+
end_of_line=lf
27+
28+
[{*.yml,*.yaml}]
29+
indent_size=2
30+
31+
[{*.html,*.xml}]
32+
indent_size=2
33+
34+
[{*.json,*.json5}]
35+
indent_size=2
36+
37+
[*.md.mustache]
38+
indent_size=0
39+
insert_final_newline=false
40+
41+
[{*.gradle.kts,*.kt,*.kts,*.main.kts,*.space.kts}]
42+
indent_size=4
43+
disabled_rules=no-wildcard-imports,import-ordering,indent
44+
kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.sh text eol=lf
2+
gradlew text eol=lf
3+
mvnw text eol=lf
4+
secret.txt text eol=lf

.github/workflows/publish.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: jacksync
2+
3+
on: [ push, pull_request ]
4+
5+
env:
6+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
7+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
8+
OSSRH_GPG_SECRET_ID: ${{ secrets.OSSRH_GPG_SECRET_ID }}
9+
OSSRH_GPG_SECRET_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_PASSWORD }}
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
if: startsWith(github.event.head_commit.message, 'bumped version to ') != true
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up JDK 1.8
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 1.8
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.gradle/caches
31+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
32+
restore-keys: ${{ runner.os }}-gradle-
33+
34+
- name: Prepare to build
35+
run: chmod +x ./gradlew
36+
37+
- name: Build project
38+
run: ./gradlew build -x test
39+
40+
test:
41+
needs: [ build ]
42+
runs-on: ubuntu-latest
43+
44+
if: startsWith(github.event.head_commit.message, 'bumped version to ') != true
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Set up JDK 1.8
52+
uses: actions/setup-java@v1
53+
with:
54+
java-version: 1.8
55+
56+
- name: Cache dependencies
57+
uses: actions/cache@v1
58+
with:
59+
path: ~/.gradle/caches
60+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
61+
restore-keys: ${{ runner.os }}-gradle-
62+
63+
- name: Prepare to build
64+
run: chmod +x ./gradlew
65+
66+
- name: Run tests
67+
run: ./gradlew check test -S
68+
69+
deploy_snapshot:
70+
needs: [ build, test ]
71+
runs-on: ubuntu-latest
72+
73+
if: (github.ref == 'refs/heads/master') && startsWith(github.event.head_commit.message, 'release:') != true
74+
75+
steps:
76+
- uses: actions/checkout@v2
77+
with:
78+
fetch-depth: 0
79+
80+
- name: Set up JDK 1.8
81+
uses: actions/setup-java@v1
82+
with:
83+
java-version: 1.8
84+
85+
- name: Cache dependencies
86+
uses: actions/cache@v1
87+
with:
88+
path: ~/.gradle/caches
89+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
90+
restore-keys: ${{ runner.os }}-gradle-
91+
92+
- name: Prepare to build
93+
run: |
94+
chmod +x ./gradlew
95+
git show-ref
96+
git log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cgreen%d %Creset %s %C(bold)(%an)%Creset" || true
97+
98+
- id: install-secret-key
99+
name: Install gpg secret key
100+
run: echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 -d > ./secret.gpg
101+
102+
- id: publish
103+
name: Publish snapshot
104+
run: |
105+
newVersion=`./gradlew derive --preRelease='SNAPSHOT' -i | grep 'NEXT_VERSION:==' | sed 's/^.*NEXT_VERSION:==//g'`
106+
107+
echo "newVersion: ${newVersion}"
108+
109+
./gradlew bumpVersion -P newVersion=${newVersion} 1>/dev/null 2>/dev/null
110+
./gradlew clean publish -x test -P OSSRH_GPG_SECRET_KEY=./secret.gpg
111+
112+
rm -rf ./secret.gpg
113+
114+
deploy_release:
115+
needs: [ build, test ]
116+
runs-on: ubuntu-latest
117+
118+
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.event.head_commit.message, 'release')
119+
120+
steps:
121+
- uses: actions/checkout@v2
122+
with:
123+
fetch-depth: 0
124+
125+
- name: Set up JDK 1.8
126+
uses: actions/setup-java@v1
127+
with:
128+
java-version: 1.8
129+
130+
- name: Cache dependencies
131+
uses: actions/cache@v1
132+
with:
133+
path: ~/.gradle/caches
134+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
135+
restore-keys: ${{ runner.os }}-gradle-
136+
137+
- name: Prepare to build
138+
run: |
139+
chmod +x ./gradlew
140+
git show-ref
141+
git log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cgreen%d %Creset %s %C(bold)(%an)%Creset" || true
142+
143+
- id: install-secret-key
144+
name: Install gpg secret key
145+
run: echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 -d > ./secret.gpg
146+
147+
- name: Publish release
148+
run: ./gradlew clean publish -x test -P OSSRH_GPG_SECRET_KEY=./secret.gpg

.gitignore

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
1-
/.settings/
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
27

3-
# Maven
4-
/target/
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
519

6-
# Eclipse Core
7-
/.project
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
828

9-
# JDT-specific (Eclipse Java Development Tools)
10-
/.classpath
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/
38+
39+
### CUSTOM CONFIG ###
40+
.okhttpcache
41+
secret.gpg
42+
43+
logs/
44+
!**/src/main/**/logs/
45+
!**/src/test/**/logs/

.travis.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
## 0.2.0 (2022-10-24)
4+
5+
No update notes.
6+

CHANGELOG.zh-cn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 更新日志
2+
3+
## 0.2.0 (2022-10-24)
4+
5+
暂无更新说明。
6+

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Jacksync
22

3-
[![Build Status](https://travis-ci.org/shagaba/jacksync.svg?branch=master)](https://travis-ci.org/shagaba/jacksync)
3+
> **TIPS**
4+
>
5+
> This project fork from https://github.com/shagaba/jacksync . And I refactored it using kotlin.
46
57
## Creating and applying sync patches (merge, patch, diff, sync)
68

0 commit comments

Comments
 (0)