Skip to content

Commit d950193

Browse files
committed
feat(service): implement primary features and challenges
------------ # Locales - **[zh-cn]** 实现主要功能
1 parent f8e81e1 commit d950193

43 files changed

Lines changed: 2807 additions & 0 deletions

Some content is hidden

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

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[*]
2+
charset = utf-8
3+
end_of_line = crlf
4+
indent_size = 4
5+
indent_style = space
6+
insert_final_newline = true
7+
max_line_length = 180
8+
tab_width = 4
9+
10+
[{*.sh, mvnw, gradlew}]
11+
end_of_line = lf
12+
13+
[{*.yml, *.yaml}]
14+
indent_size = 2
15+
16+
[*.xml]
17+
indent_size = 2
18+
19+
[*.json]
20+
indent_size = 2
21+
22+
[*.mustache]
23+
insert_final_newline = false

.gitattributes

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

.travis.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
os: linux
2+
dist: trusty
3+
language: java
4+
jdk:
5+
- openjdk8
6+
if: |
7+
(branch IN (master, dev) AND commit_message !~ /^(bumped version to|release:) (\d+(\.\d+){2})(-.+)?$/) \
8+
OR tag =~ /^(\d+(\.\d+){2})([-+][\w\-\.+]+)?$/
9+
git:
10+
depth: false
11+
env:
12+
global:
13+
secure: J4kvyPq8BJg05x864lLOYHjcCQqHsO10t/4nq1odYrZ6udFxRKkmBUccp8P52kWAZswJXFAWHoM04Cl6nygSd/j4uzfH2Z3z0izxcfKM5MtL/1aHEmzlGuS8K5CFaRis6Oq/f04pX3rIZJu1yr5TIiI0Xbq9SqXYxGMSHqYSss2WMgJRzNQteHEefWAmZb6ivMYkR8fPs9Ad0dtFug3gOgO52jtfaSj3m6xJc0OL0Gx1EsaS/Po8DWcRtYGfvWU1BHwFR35LK8odLlt7ywJgMP1vdRz+BMxZ3PK8JLWeaYF4Pe/+L4w/iZxmz6VvUKrXyVBNRqhuA5OTuSa/cSTYsmzND5hX9GLgW8s0tiMfme/Cx+/JP2+RVnlGqyB5risGJDmnFvE/L3bCEacl87zY/506FwSmxRT3VGu6sMLBGm+3CIy6PU1SsaWOnTi9o0TX1y/VVvdlp5eWbmUb15NdFHPmfaO6MSz29fcbVNaI8pVRMdRtXEmOiJF3joOiJvLRR0WPucGG/LewhnpJIfLNKPBc2tTK2i+maCP6zHnJbOG76K1x0Exa9CWe8dp2LHRV/K0yiolxx8XKqQIAwbGVBxQdN9/qAqX32uupeWTxW5oGOcwMAMjvrV9TSxnSzKjaPK/7ttyOt4G4pSQUCJODHGbYKoeDbmp/wCQRBNwgOpo=
14+
before_cache:
15+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
16+
cache:
17+
directories:
18+
- ".autoconf"
19+
- "$HOME/.m2"
20+
- "$HOME/.gradle/caches/modules-2/"
21+
- "$HOME/.gradle/wrapper/dists/"
22+
before_install:
23+
- openssl aes-256-cbc -K $encrypted_2afbb999f001_key -iv $encrypted_2afbb999f001_iv
24+
-in gradle.properties.enc -out gradle.properties -d
25+
- openssl aes-256-cbc -K $encrypted_70811ee8b6a1_key -iv $encrypted_70811ee8b6a1_iv
26+
-in .travis/secret.gpg.enc -out .travis/secret.gpg -d
27+
- git config --global user.name "Travis CI"
28+
- git config --global user.email "travis.ci@yi.team"
29+
- chmod +x ./gradlew .travis/*.sh
30+
- ls -lh
31+
- git log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h
32+
%Creset%ad%Cgreen%d %Creset %s %C(bold)(%an)%Creset" || true
33+
install: "/bin/true"
34+
script:
35+
- "./gradlew clean"
36+
deploy:
37+
- provider: script
38+
skip_cleanup: true
39+
cleanup: false
40+
script: ".travis/deploy-snapshot.sh"
41+
on:
42+
branch: master
43+
- provider: script
44+
skip_cleanup: true
45+
cleanup: false
46+
script: ".travis/deploy-release.sh"
47+
on:
48+
tags: true

.travis/deploy-release.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd ${TRAVIS_BUILD_DIR}
6+
7+
# Prepare the local keyring (requires travis to have decrypted the file
8+
# beforehand)
9+
gpg --fast-import .travis/secret.gpg
10+
11+
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
12+
echo "on a tag -> set project version to ${TRAVIS_TAG}"
13+
14+
newVersion=${TRAVIS_TAG}
15+
gitCommit="release: ${newVersion}"
16+
17+
# Print newVersion
18+
echo "newVersion: ${newVersion}"
19+
20+
if [[ -z "${newVersion}" ]]; then
21+
echo "missing newVersion value" >&2
22+
exit 1
23+
fi
24+
25+
# Run the gradle publish steps
26+
./gradlew setVersion -P newVersion=${newVersion} 1>/dev/null 2>/dev/null
27+
./gradlew publishMavenJavaPublicationToMavenRepository
28+
./gradlew publishPlugins
29+
30+
# Generate and push CHANGELOG.md - fully
31+
git reset --hard
32+
git remote set-url origin https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
33+
git remote set-branches --add origin 'master'
34+
git fetch
35+
git checkout master
36+
git show-ref
37+
chmod +x ./gradlew .travis/*.sh
38+
39+
./gradlew setVersion -P newVersion=${newVersion} 1>/dev/null 2>/dev/null
40+
./gradlew changelog --toRef=master
41+
42+
git add ./CHANGELOG* || true
43+
git add ./build.gradle || true
44+
git commit --amend -m "${gitCommit}" && git push -f || true

.travis/deploy-snapshot.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd ${TRAVIS_BUILD_DIR}
6+
7+
# Prepare the local keyring (requires travis to have decrypted the file
8+
# beforehand)
9+
gpg --fast-import .travis/secret.gpg
10+
11+
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
12+
echo "not on a tag -> derive version and keep snapshot"
13+
14+
newVersion=`./gradlew derive --preRelease='SNAPSHOT' -i | grep 'NEXT_VERSION:==' | sed 's/^.*NEXT_VERSION:==//g'`
15+
gitCommit="bumped version to ${newVersion}"
16+
17+
# Print newVersion
18+
echo "newVersion: ${newVersion}"
19+
20+
if [[ -z "${newVersion}" ]]; then
21+
echo "missing newVersion value" >&2
22+
exit 1
23+
fi
24+
25+
git remote set-url origin https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
26+
git fetch
27+
git checkout master
28+
git show-ref
29+
30+
# Run the gradle publish steps
31+
./gradlew setVersion -P newVersion=${newVersion} 1>/dev/null 2>/dev/null
32+
./gradlew publishMavenJavaPublicationToMavenRepository
33+
./gradlew publishPlugins
34+
35+
# Generate and push CHANGELOG.md
36+
./gradlew changelog --toRef=master
37+
38+
git add ./CHANGELOG* || true
39+
git add ./build.gradle || true
40+
git commit -m "${gitCommit}" && git push origin || true

.travis/secret.gpg.enc

3.27 KB
Binary file not shown.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 ymind
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)