From 3bd70993d609fb3a9b8b366cf1e207e497bb58a5 Mon Sep 17 00:00:00 2001
From: yejian <596306006@qq.com>
Date: Tue, 8 Oct 2024 21:37:54 +0800
Subject: [PATCH 1/2] change code structure
---
.github/.codecov.yml | 9 -
.github/workflows/auto-assign-issue.yml | 26 -
.github/workflows/auto-invite.yml | 39 -
.github/workflows/check-coverage.yml | 46 -
.github/workflows/cla.yml | 48 -
.github/workflows/codeql-analysis.yml | 71 -
.github/workflows/gosec.yml | 30 -
.github/workflows/help-comment-issue.yml | 21 -
.github/workflows/issue-robot.yml | 17 -
.github/workflows/link-pr.yml | 47 -
.github/workflows/opencommit.yml | 39 -
.github/workflows/project-progress.yml | 22 -
.github/workflows/release.yml | 64 -
.github/workflows/stale.yml | 34 -
.gitignore | 22 -
CMakeLists.txt | 13 -
README.md | 12 +-
examples/CMakeLists.txt | 11 -
examples/main.cpp | 10 -
gen/export.go => export.go | 0
gen/gen_win_dll.bat | 6 -
gen/gen_android_so.bat => gen_android_so.bat | 2 +
gen/gen_ios_dylib.sh => gen_ios_dylib.sh | 0
gen/gen_linux_so.sh => gen_linux_so.sh | 0
gen/gen_mac_dylib.sh => gen_mac_dylib.sh | 0
gen_win_dll.bat | 2 +
gen/go.mod => go.mod | 0
gen/go.sum => go.sum | 0
include/imsdk.h | 11 -
gen/message.go => message.go | 0
gen/protocol.go => protocol.go | 0
scripts/githooks/commit-msg | 92 -
scripts/githooks/commit-msg.sh | 92 -
scripts/githooks/pre-commit | 111 -
scripts/githooks/pre-commit.sh | 111 -
scripts/githooks/pre-push | 119 -
scripts/githooks/pre-push.sh | 119 -
src/imsdk.cpp | 20 -
src/json.hpp | 24765 -----------------
39 files changed, 15 insertions(+), 26016 deletions(-)
delete mode 100644 .github/.codecov.yml
delete mode 100644 .github/workflows/auto-assign-issue.yml
delete mode 100644 .github/workflows/auto-invite.yml
delete mode 100644 .github/workflows/check-coverage.yml
delete mode 100644 .github/workflows/cla.yml
delete mode 100644 .github/workflows/codeql-analysis.yml
delete mode 100644 .github/workflows/gosec.yml
delete mode 100644 .github/workflows/help-comment-issue.yml
delete mode 100644 .github/workflows/issue-robot.yml
delete mode 100644 .github/workflows/link-pr.yml
delete mode 100644 .github/workflows/opencommit.yml
delete mode 100644 .github/workflows/project-progress.yml
delete mode 100644 .github/workflows/release.yml
delete mode 100644 .github/workflows/stale.yml
delete mode 100644 CMakeLists.txt
delete mode 100644 examples/CMakeLists.txt
delete mode 100644 examples/main.cpp
rename gen/export.go => export.go (100%)
delete mode 100644 gen/gen_win_dll.bat
rename gen/gen_android_so.bat => gen_android_so.bat (95%)
rename gen/gen_ios_dylib.sh => gen_ios_dylib.sh (100%)
rename gen/gen_linux_so.sh => gen_linux_so.sh (100%)
rename gen/gen_mac_dylib.sh => gen_mac_dylib.sh (100%)
create mode 100644 gen_win_dll.bat
rename gen/go.mod => go.mod (100%)
rename gen/go.sum => go.sum (100%)
delete mode 100644 include/imsdk.h
rename gen/message.go => message.go (100%)
rename gen/protocol.go => protocol.go (100%)
delete mode 100644 scripts/githooks/commit-msg
delete mode 100644 scripts/githooks/commit-msg.sh
delete mode 100644 scripts/githooks/pre-commit
delete mode 100644 scripts/githooks/pre-commit.sh
delete mode 100644 scripts/githooks/pre-push
delete mode 100644 scripts/githooks/pre-push.sh
delete mode 100644 src/imsdk.cpp
delete mode 100644 src/json.hpp
diff --git a/.github/.codecov.yml b/.github/.codecov.yml
deleted file mode 100644
index 45e2131..0000000
--- a/.github/.codecov.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-coverage:
- status:
- project:
- default: false # disable the default status that measures entire project
- pkg: # declare a new status context "pkg"
- paths:
- - pkg/* # only include coverage in "pkg/" folder
- informational: true # Always pass check
- patch: off # disable the commit only checks
\ No newline at end of file
diff --git a/.github/workflows/auto-assign-issue.yml b/.github/workflows/auto-assign-issue.yml
deleted file mode 100644
index 7afebe0..0000000
--- a/.github/workflows/auto-assign-issue.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Assign issue to comment author
-on:
- issue_comment:
- types: [created]
-jobs:
- assign-issue:
- if: contains(github.event.comment.body, '/assign') || contains(github.event.comment.body, '/accept')
- runs-on: ubuntu-latest
- permissions:
- issues: write
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Assign the issue
- run: |
- export LETASE_MILESTONES=$(curl "https://api.github.com/repos/$OWNER/$REPO/milestones" | jq -r 'last(.[]).title')
- gh issue edit ${{ github.event.issue.number }} --add-assignee "${{ github.event.comment.user.login }}"
- gh issue edit ${{ github.event.issue.number }} --add-label "triage/accepted"
- gh issue edit ${{ github.event.issue.number }} --milestone "$LETASE_MILESTONES"
- gh issue comment $ISSUE --body "@${{ github.event.comment.user.login }} Glad to see you accepted this issue🤲, this issue has been assigned to you.
I set the milestones for this issue to $LETASE_MILESTONES, we are looking forward to your PR!"
- env:
- GH_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
- ISSUE: ${{ github.event.issue.html_url }}
- OWNER: ${{ github.repository_owner }}
- REPO: ${{ github.event.repository.name }}
\ No newline at end of file
diff --git a/.github/workflows/auto-invite.yml b/.github/workflows/auto-invite.yml
deleted file mode 100644
index 9d8effb..0000000
--- a/.github/workflows/auto-invite.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: Invite users to join our group
-on:
- issue_comment:
- types:
- - created
-jobs:
- issue_comment:
- name: Invite users to join our group
- if: ${{ github.event.comment.body == '/invite' || github.event.comment.body == '/close' || github.event.comment.body == '/comment' }}
- runs-on: ubuntu-latest
- permissions:
- issues: write
- steps:
-
- - name: Invite user to join our group
- uses: peter-evans/create-or-update-comment@v1
- with:
- token: ${{ secrets.BOT_GITHUB_TOKEN }}
- issue-number: ${{ github.event.issue.number }}
- body: |
- We value close connections with our users, developers, and contributors here at Open-IM-Server. With a large community and maintainer team, we're always here to help and support you. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us.
-
- Our most recommended way to get in touch is through [Slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg). Even if you're in China, Slack is usually not blocked by firewalls, making it an easy way to connect with us. Our Slack community is the ideal place to discuss and share ideas and suggestions with other users and developers of Open-IM-Server. You can ask technical questions, seek help, or share your experiences with other users of Open-IM-Server.
-
- In addition to Slack, we also offer the following ways to get in touch:
-
- + We also have Slack channels for you to communicate and discuss. To join, visit https://slack.com/ and join our [👀 Open-IM-Server slack](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) team channel.
- + Get in touch with us on [Gmail](https://mail.google.com/mail/u/0/?fs=1&tf=cm&to=winxu81@gmail.com). If you have any questions or issues that need resolving, or any suggestions and feedback for our open source projects, please feel free to contact us via email.
- + Read our [blog](https://doc.rentsoft.cn/). Our blog is a great place to stay up-to-date with Open-IM-Server projects and trends. On the blog, we share our latest developments, tech trends, and other interesting information.
- + Add [Wechat](https://github.com/OpenIMSDK/OpenIM-Docs/blob/main/docs/images/WechatIMG20.jpeg) and indicate that you are a user or developer of Open-IM-Server. We will process your request as soon as possible.
-
- - name: Close Issue
- uses: peter-evans/close-issue@v3
- with:
- token: ${{ secrets.BOT_GITHUB_TOKEN }}
- issue-number: ${{ github.event.issue.number }}
- comment: 🤖 Auto-closing issue, if you still need help please reopen the issue or ask for help in the community above
- labels: |
- triage/accepted
\ No newline at end of file
diff --git a/.github/workflows/check-coverage.yml b/.github/workflows/check-coverage.yml
deleted file mode 100644
index b4a6a69..0000000
--- a/.github/workflows/check-coverage.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-# name: Check-Coverage
-
-
-# on:
-# workflow_dispatch:
-# push:
-# branches: [ "main" ]
-# paths-ignore:
-# - "docs/**"
-# - "**/*.md"
-# - "**/*.yaml"
-# - "CONTRIBUTORS"
-# - "CHANGELOG/**"
-# pull_request:
-# branches: [ "*" ]
-# paths-ignore:
-# - "docs/**"
-# - "**/*.md"
-# - "**/*.yaml"
-# - "CONTRIBUTORS"
-# - "CHANGELOG/**"
-# env:
-# # Common versions
-# GO_VERSION: "1.20"
-
-# jobs:
-# coverage:
-# runs-on: ubuntu-20.04
-# steps:
-# - name: Checkout
-# uses: actions/checkout@v3
-
-# - name: Setup Golang with cache
-# uses: magnetikonline/action-golang-cache@v3
-# with:
-# go-version: ${{ env.GO_VERSION }}
-# token: ${{ secrets.BOT_GITHUB_TOKEN }}
-
-# - name: Install Dependencies
-# run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
-
-# - name: Run Cover
-# run: make cover
-
-# - name: Upload Coverage to Codecov
-# uses: codecov/codecov-action@v3
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
deleted file mode 100644
index 65497a1..0000000
--- a/.github/workflows/cla.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-name: "OpenIM CLA Assistant"
-on:
- issue_comment:
- types: [created]
- pull_request_target:
- types: [opened,closed,synchronize]
-
-# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
-permissions:
- actions: write
- contents: write
- pull-requests: write
- statuses: write
-
-env:
- # Define Open-IM-Server variables here
- OPEN_IM_SERVER_REMOTE_ORGANIZATION: openim-sigs
- REMOTE_REPOSITORY: cla
- OPEN_IM_SERVER_CLA_DOCUMENT: https://github.com/openim-sigs/cla/blob/main/README.md
- OPEN_IM_SERVER_SIGNATURES_PATH: signatures/${{ github.event.repository.name }}/cla.json
-
- OPEN_IM_SERVER_ALLOWLIST: kubbot,bot*
-
-jobs:
- CLAAssistant:
- runs-on: ubuntu-latest
- steps:
- - name: "CLA Assistant"
- if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
- uses: contributor-assistant/github-action@v2.3.0
- env:
- GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- PERSONAL_ACCESS_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
- with:
- path-to-signatures: ${{ env.OPEN_IM_SERVER_SIGNATURES_PATH }}
- path-to-document: ${{ env.OPEN_IM_SERVER_CLA_DOCUMENT }}
- branch: 'main'
- allowlist: ${{ env.OPEN_IM_SERVER_ALLOWLIST }}
-
- remote-organization-name: ${{ env.OPEN_IM_SERVER_REMOTE_ORGANIZATION }}
- remote-repository-name: ${{ env.REMOTE_REPOSITORY }}
-
- create-file-commit-message: '📚 Docs: Creating file for storing ${{ github.event.repository.name }} CLA Signatures'
- custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md)
'
- custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA'
- custom-allsigned-prcomment: '🤖 All Contributors have signed the [${{ github.event.repository.name }} CLA](https://github.com/openim-sigs/cla/blob/main/README.md).
The signed information is recorded [🤖here](https://github.com/openim-sigs/cla/tree/main/signatures/${{ env.OPEN_IM_SERVER_ALLOWLIST }}/cla.json)'
- # lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
- # use-dco-flag: true - If you are using DCO instead of CLA
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
deleted file mode 100644
index 38508b7..0000000
--- a/.github/workflows/codeql-analysis.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-# For most projects, this workflow file will not need changing; you simply need
-# to commit it to your repository.
-#
-# You may wish to alter this file to override the set of languages analyzed,
-# or to provide custom queries or build logic.
-#
-# ******** NOTE ********
-# We have attempted to detect the languages in your repository. Please check
-# the `language` matrix defined below to confirm you have the correct set of
-# supported CodeQL languages.
-#
-name: "CodeQL"
-
-on:
- push:
- branches: [ main ]
- pull_request:
- # The branches below must be a subset of the branches above
- branches: "*"
-# schedule:
-# - cron: '23 2 * * 2'
-
-jobs:
- analyze:
- name: Analyze
- runs-on: ubuntu-latest
- permissions:
- actions: read
- contents: read
- security-events: write
-
- strategy:
- fail-fast: false
- matrix:
- language: [ 'go' ]
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
- # Learn more:
- # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v1
- with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
-
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
-
- # ℹ️ Command-line programs to run using the OS shell.
- # 📚 https://git.io/JvXDl
-
- # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
- # and modify them (or add more) to build your code if your project
- # uses a compiled language
-
- #- run: |
- # make bootstrap
- # make release
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml
deleted file mode 100644
index 60f42ae..0000000
--- a/.github/workflows/gosec.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-# name: Run gosec
-
-# # gosec is a source code security audit tool for the Go language. It performs a static
-# # analysis of the Go code, looking for potential security problems. The main functions of gosec are:
-# # 1. Find common security vulnerabilities, such as SQL injection, command injection, and cross-site scripting (XSS).
-# # 2. Audit codes according to common security standards and find non-standard codes.
-# # 3. Assist the Go language engineer to write safe and reliable code.
-
-# on:
-# push:
-# branches: "*"
-# pull_request:
-# branches: "*"
-# paths-ignore:
-# - '*.md'
-# - '*.yml'
-# - '.github'
-
-# jobs:
-# golang-security-action:
-# runs-on: ubuntu-latest
-# env:
-# GO111MODULE: on
-# steps:
-# - name: Check out code
-# uses: actions/checkout@v3
-# - name: Run Gosec Security Scanner
-# uses: securego/gosec@master
-# with:
-# args: ./...
\ No newline at end of file
diff --git a/.github/workflows/help-comment-issue.yml b/.github/workflows/help-comment-issue.yml
deleted file mode 100644
index b1414d7..0000000
--- a/.github/workflows/help-comment-issue.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: Good frist issue add comment
-on:
- issues:
- types:
- - labeled
-jobs:
- add-comment:
- if: github.event.label.name == 'help wanted' || github.event.label.name == 'good first issue'
- runs-on: ubuntu-latest
- permissions:
- issues: write
- steps:
- - name: Add comment
- uses: peter-evans/create-or-update-comment@v3
- with:
- issue-number: ${{ github.event.issue.number }}
- token: ${{ secrets.BOT_GITHUB_TOKEN }}
- body: |
- This issue is available for anyone to work on. **Make sure to reference this issue in your pull request.** :sparkles: Thank you for your contribution! :sparkles:
- [Join slack 🤖](https://join.slack.com/t/openimsdk/shared_invite/zt-1tmoj26uf-_FDy3dowVHBiGvLk9e5Xkg) to connect and communicate with our developers.
- If you wish to accept this assignment, please leave a comment in the comments section: `/accept`.🎯
diff --git a/.github/workflows/issue-robot.yml b/.github/workflows/issue-robot.yml
deleted file mode 100644
index 74927a0..0000000
--- a/.github/workflows/issue-robot.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: 'issue translator'
-on:
- issue_comment:
- types: [created]
- issues:
- types: [opened]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: usthe/issues-translate-action@v2.7
- with:
- # it is not necessary to decide whether you need to modify the issue header content
- IS_MODIFY_TITLE: true
- BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- # Required, input your bot github token
\ No newline at end of file
diff --git a/.github/workflows/link-pr.yml b/.github/workflows/link-pr.yml
deleted file mode 100644
index 844dd5f..0000000
--- a/.github/workflows/link-pr.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-# name: Github Rebot for Link check error
-
-# on:
-# pull_request:
-# branches: [ main ]
-# paths:
-# - '**.md'
-# - 'docs/**'
-# - '.lycheeignore'
-# push:
-# branches: [ main ]
-
-# schedule:
-# - cron: '0 11 * * *'
-
-# jobs:
-# linkChecker:
-# runs-on: ubuntu-latest
-# steps:
-# - uses: actions/checkout@v3
-
-# - name: Link Checker
-# id: lychee
-# uses: lycheeverse/lychee-action@v1.7.0
-# with:
-# # For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
-# # Actions Link address -> https://github.com/lycheeverse/lychee-action
-# # -E, --exclude-all-private Exclude all private IPs from checking.
-# # -i, --insecure Proceed for server connections considered insecure (invalid TLS)
-# # -n, --no-progress Do not show progress bar.
-# # -t, --timeout Website timeout in seconds from connect to response finished [default:20]
-# # --max-concurrency Maximum number of concurrent network requests [default: 128]
-# # -a --accept Comma-separated list of accepted status codes for valid links
-# # docs/.vitepress/dist the site directory to check
-# # ./*.md all markdown files in the root directory
-# args: --verbose -E -i --no-progress --exclude-path './CHANGELOG' './**/*.md'
-# env:
-# GITHUB_TOKEN: ${{secrets.GH_PAT}}
-
-# - name: Create Issue From File
-# if: env.lychee_exit_code != 0
-# uses: peter-evans/create-issue-from-file@v4
-# with:
-# title: Bug reports for links in OpenIM docs
-# content-filepath: ./lychee/out.md
-# labels: kind/documentation, triage/unresolved, report
-# token: ${{ secrets.BOT_GITHUB_TOKEN }}
diff --git a/.github/workflows/opencommit.yml b/.github/workflows/opencommit.yml
deleted file mode 100644
index d3d5250..0000000
--- a/.github/workflows/opencommit.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: 'OpenCommit Action'
-
-on:
- push:
- # this list of branches is often enough,
- # but you may still ignore other public branches
- branches-ignore: [main master dev development release]
-
-jobs:
- opencommit:
- timeout-minutes: 10
- name: OpenCommit
- runs-on: ubuntu-latest
- permissions: write-all
- steps:
- - name: Setup Node.js Environment
- uses: actions/setup-node@v2
- with:
- node-version: '16'
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - uses: di-sukharev/opencommit@github-action-v1.0.4
- with:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- env:
- # set openAI api key in repo actions secrets,
- # for openAI keys go to: https://platform.openai.com/account/api-keys
- # for repo secret go to: https://github.com/kuebcub/settings/secrets/actions
- OCO_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
-
- # customization
- OCO_OPENAI_MAX_TOKENS: 500
- OCO_OPENAI_BASE_PATH: ''
- OCO_DESCRIPTION: false
- OCO_EMOJI: false
- OCO_MODEL: gpt-3.5-turbo
- OCO_LANGUAGE: en
\ No newline at end of file
diff --git a/.github/workflows/project-progress.yml b/.github/workflows/project-progress.yml
deleted file mode 100644
index ad721a3..0000000
--- a/.github/workflows/project-progress.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-# GitHub recommends pinning actions to a commit SHA.
-# To get a newer version, you will need to update the SHA.
-# You can also reference a tag or branch, but the action may change without warning.
-
-name: Move assigned card
-on:
- issues:
- types:
- - assigned
- pull_request:
- types:
- - assigned
-
-jobs:
- move-assigned-card:
- runs-on: ubuntu-latest
- steps:
- - uses: alex-page/github-project-automation-plus@v0.8.3
- with:
- project: OpenIM 2023 Sprint 🔥
- column: In Progress
- repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index c4f1907..0000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-name: OpenIM Server Release
-
-on:
- push:
- # run only against tags
- tags:
- - '*'
-
-permissions:
- contents: write
- packages: write
- issues: write
-
-jobs:
- goreleaser:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - run: git fetch --force --tags
- - uses: actions/setup-go@v4
- with:
- go-version: stable
- # More assembly might be required: Docker logins, GPG, etc. It all depends
- # on your needs.
- - uses: goreleaser/goreleaser-action@v4
- with:
- # either 'goreleaser' (default) or 'goreleaser-pro':
- distribution: goreleaser
- version: latest
- args: release --clean
- env:
- GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- # Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
- # distribution:
- # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
-
- goreleaser-check-pkgs:
- runs-on: ubuntu-latest
- env:
- DOCKER_CLI_EXPERIMENTAL: "enabled"
- needs: [ goreleaser ]
- if: github.ref == 'refs/heads/main'
- strategy:
- matrix:
- format: [ deb, rpm, apk ]
- steps:
- - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- with:
- fetch-depth: 0
- - uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
- with:
- version: 3.x
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- - uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
- with:
- path: |
- ./_output/dist/*.deb
- ./_output/dist/*.rpm
- ./_output/dist/*.apk
- key: ${{ github.ref }}
- - run: task goreleaser:test:${{ matrix.format }}
\ No newline at end of file
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
deleted file mode 100644
index 2cad62c..0000000
--- a/.github/workflows/stale.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
-#
-# You can adjust the behavior by modifying this file.
-# For more information, see:
-# https://github.com/actions/stale
-name: Mark stale issues and pull requests
-
-on:
- schedule:
- - cron: '0 8 * * *'
-
-jobs:
- stale:
-
- runs-on: ubuntu-latest
- permissions:
- issues: write
- pull-requests: write
-
- steps:
- - uses: actions/stale@v5
- with:
- repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
- days-before-stale: 60
- days-before-close: 7
- stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
- stale-pr-message: 'This issue is stale because it has been open 60 days with no activity.'
- close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
- close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity. You can reopen it if you want.'
- stale-pr-label: lifecycle/stale
- stale-issue-label: lifecycle/stale
- exempt-issue-labels: 'openim'
- exempt-pr-labels: 'openim'
- exempt-draft-pr: true
diff --git a/.gitignore b/.gitignore
index 6b70f4e..2934a0e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,37 +1,15 @@
-# Prerequisites
-*.d
-
-# Compiled Object files
-*.slo
-*.lo
*.o
*.obj
-
-# Precompiled Headers
*.gch
*.pch
-
-# Compiled Dynamic libraries
*.so
*.dylib
*.dll
-
-# Fortran module files
-*.mod
-*.smod
-
-# Compiled Static libraries
-*.lai
-*.la
*.a
*.lib
-
-# Executables
*.exe
*.out
*.app
/vendor
-/openimsdk.h
-/openimsdk.dll
/build
/.vscode
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index b048433..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-cmake_minimum_required(VERSION 3.20)
-project(openim-sdk-cpp)
-set(CMAKE_CXX_STANDARD 11)
-include_directories(${CMAKE_SOURCE_DIR}/gen)
-link_directories(${CMAKE_SOURCE_DIR}/gen)
-file(GLOB INCLUDES "include/*.h")
-file(GLOB SOURCES "src/*.cpp")
-
-add_library(openimsdk_wrapper STATIC ${SOURCES} ${INCLUDES})
-target_include_directories(openimsdk_wrapper PUBLIC include)
-target_link_libraries(openimsdk_wrapper openimsdk)
-add_subdirectory(examples)
-
diff --git a/README.md b/README.md
index 6726ffe..8a694dd 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,13 @@
# openim-sdk-cpp
-openim-sdk-core
\ No newline at end of file
+Based on the secondary closure of [openim-sdk-core](https://github.com/openimsdk/openim-sdk-core), export the library of the corresponding platform
+
+# scripts
+
+```bash
+gen_win_dll.bat # gen windows .dll
+gen_android_so.bat # gen android .so
+gen_ios_dylib.sh # gen ios .a
+gen_linux_so.sh # gen linux .so
+gen_mac_dylib.sh # gen mac .dylib
+```
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
deleted file mode 100644
index 4f74c00..0000000
--- a/examples/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-cmake_minimum_required(VERSION 3.20)
-
-file(GLOB EXAMPLE_INCLUDES "*.h")
-file(GLOB EXAMPLE_SOURCES "*.cpp")
-add_executable(example ${EXAMPLE_SOURCES} ${EXAMPLE_INCLUDES})
-target_link_libraries(example openimsdk_wrapper)
-
-
-add_custom_command(TARGET example PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_SOURCE_DIR}/gen/openimsdk.dll $/)
\ No newline at end of file
diff --git a/examples/main.cpp b/examples/main.cpp
deleted file mode 100644
index cc26b98..0000000
--- a/examples/main.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include
-#include "IMSDK.h"
-using namespace OpenIM;
-
-int main()
-{
- InitSDK();
- std::cout << "helloworld" << std::endl;
- return 0;
-}
\ No newline at end of file
diff --git a/gen/export.go b/export.go
similarity index 100%
rename from gen/export.go
rename to export.go
diff --git a/gen/gen_win_dll.bat b/gen/gen_win_dll.bat
deleted file mode 100644
index ab04da2..0000000
--- a/gen/gen_win_dll.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-set CGO_ENABLED=1
-go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o openimsdk.dll export.go protocol.go message.go
-
-
-
-@REM g++ -shared -fPIC -o openimsdkcc.dll openimsdkcc.cc openimsdk.dll
\ No newline at end of file
diff --git a/gen/gen_android_so.bat b/gen_android_so.bat
similarity index 95%
rename from gen/gen_android_so.bat
rename to gen_android_so.bat
index e4825e5..de2455b 100644
--- a/gen/gen_android_so.bat
+++ b/gen_android_so.bat
@@ -1,4 +1,6 @@
set NDK_PATH=D:\Android\SDK\ndk\21.3.6528147
+@REM First set the NDK_PATH environment variable
+
set SO_NAME=libopenimsdk
set OUT_PATH=android\
diff --git a/gen/gen_ios_dylib.sh b/gen_ios_dylib.sh
similarity index 100%
rename from gen/gen_ios_dylib.sh
rename to gen_ios_dylib.sh
diff --git a/gen/gen_linux_so.sh b/gen_linux_so.sh
similarity index 100%
rename from gen/gen_linux_so.sh
rename to gen_linux_so.sh
diff --git a/gen/gen_mac_dylib.sh b/gen_mac_dylib.sh
similarity index 100%
rename from gen/gen_mac_dylib.sh
rename to gen_mac_dylib.sh
diff --git a/gen_win_dll.bat b/gen_win_dll.bat
new file mode 100644
index 0000000..d5f1071
--- /dev/null
+++ b/gen_win_dll.bat
@@ -0,0 +1,2 @@
+set CGO_ENABLED=1
+go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o openimsdk.dll export.go protocol.go message.go
\ No newline at end of file
diff --git a/gen/go.mod b/go.mod
similarity index 100%
rename from gen/go.mod
rename to go.mod
diff --git a/gen/go.sum b/go.sum
similarity index 100%
rename from gen/go.sum
rename to go.sum
diff --git a/include/imsdk.h b/include/imsdk.h
deleted file mode 100644
index a8dce6e..0000000
--- a/include/imsdk.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "openimsdk.h"
-
-namespace OpenIM
-{
- enum PlatformID
- {
-
- };
-
- void InitSDK();
-}
\ No newline at end of file
diff --git a/gen/message.go b/message.go
similarity index 100%
rename from gen/message.go
rename to message.go
diff --git a/gen/protocol.go b/protocol.go
similarity index 100%
rename from gen/protocol.go
rename to protocol.go
diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg
deleted file mode 100644
index efff13f..0000000
--- a/scripts/githooks/commit-msg
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env bash
-# Copyright © 2023 OpenIMSDK.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ==============================================================================
-#
-# Store this file as .git/hooks/commit-msg in your repository in order to
-# enforce checking for proper commit message format before actual commits.
-# You may need to make the scripts executable by 'chmod +x .git/hooks/commit-msg'.
-
-# commit-msg use go-gitlint tool, install go-gitlint via `go get github.com/llorllale/go-gitlint/cmd/go-gitlint`
-# go-gitlint --msg-file="$1"
-
-# An example hook scripts to check the commit log message.
-# Called by "git commit" with one argument, the name of the file
-# that has the commit message. The hook should exit with non-zero
-# status after issuing an appropriate message if it wants to stop the
-# commit. The hook is allowed to edit the commit message file.
-
-YELLOW="\e[93m"
-GREEN="\e[32m"
-RED="\e[31m"
-ENDCOLOR="\e[0m"
-
-printMessage() {
- printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printSuccess() {
- printf "${GREEN}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printError() {
- printf "${RED}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printMessage "Running the OpenIM commit-msg hook."
-
-# This example catches duplicate Signed-off-by lines.
-
-test "" = "$(grep '^Signed-off-by: ' "$1" |
- sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
- echo >&2 Duplicate Signed-off-by lines.
- exit 1
-}
-
-# TODO: go-gitlint dir set
-OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
-GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint"
-
-$GITLINT_DIR \
- --msg-file=$1 \
- --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \
- --subject-maxlen=150 \
- --subject-minlen=10 \
- --body-regex=".*" \
- --max-parents=1
-
-if [ $? -ne 0 ]
-then
- if ! command -v $GITLINT_DIR &>/dev/null; then
- printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it."
- fi
- printError "Please fix your commit message to match kubecub coding standards"
- printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"
- exit 1
-fi
-
-### Add Sign-off-by line to the end of the commit message
-# Get local git config
-NAME=$(git config user.name)
-EMAIL=$(git config user.email)
-
-# Check if the commit message contains a sign-off line
-grep -qs "^Signed-off-by: " "$1"
-SIGNED_OFF_BY_EXISTS=$?
-
-# Add "Signed-off-by" line if it doesn't exist
-if [ $SIGNED_OFF_BY_EXISTS -ne 0 ]; then
- echo -e "\nSigned-off-by: $NAME <$EMAIL>" >> "$1"
-fi
\ No newline at end of file
diff --git a/scripts/githooks/commit-msg.sh b/scripts/githooks/commit-msg.sh
deleted file mode 100644
index d2d9664..0000000
--- a/scripts/githooks/commit-msg.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env bash
-# Copyright © 2023 OpenIMSDK.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ==============================================================================
-#
-# Store this file as .git/hooks/commit-msg in your repository in order to
-# enforce checking for proper commit message format before actual commits.
-# You may need to make the scripts executable by 'chmod +x .git/hooks/commit-msg'.
-
-# commit-msg use go-gitlint tool, install go-gitlint via `go get github.com/llorllale/go-gitlint/cmd/go-gitlint`
-# go-gitlint --msg-file="$1"
-
-# An example hook scripts to check the commit log message.
-# Called by "git commit" with one argument, the name of the file
-# that has the commit message. The hook should exit with non-zero
-# status after issuing an appropriate message if it wants to stop the
-# commit. The hook is allowed to edit the commit message file.
-
-YELLOW="\e[93m"
-GREEN="\e[32m"
-RED="\e[31m"
-ENDCOLOR="\e[0m"
-
-printMessage() {
- printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printSuccess() {
- printf "${GREEN}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printError() {
- printf "${RED}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printMessage "Running the OpenIM commit-msg hook."
-
-# This example catches duplicate Signed-off-by lines.
-
-test "" = "$(grep '^Signed-off-by: ' "$1" |
-sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
-echo >&2 Duplicate Signed-off-by lines.
-exit 1
-}
-
-# TODO: go-gitlint dir set
-OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
-GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint"
-
-$GITLINT_DIR \
---msg-file=$1 \
---subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \
---subject-maxlen=150 \
---subject-minlen=10 \
---body-regex=".*" \
---max-parents=1
-
-if [ $? -ne 0 ]
-then
-if ! command -v $GITLINT_DIR &>/dev/null; then
- printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it."
-fi
-printError "Please fix your commit message to match kubecub coding standards"
-printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"
-exit 1
-fi
-
-### Add Sign-off-by line to the end of the commit message
-# Get local git config
-NAME=$(git config user.name)
-EMAIL=$(git config user.email)
-
-# Check if the commit message contains a sign-off line
-grep -qs "^Signed-off-by: " "$1"
-SIGNED_OFF_BY_EXISTS=$?
-
-# Add "Signed-off-by" line if it doesn't exist
-if [ $SIGNED_OFF_BY_EXISTS -ne 0 ]; then
-echo -e "\nSigned-off-by: $NAME <$EMAIL>" >> "$1"
-fi
\ No newline at end of file
diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit
deleted file mode 100644
index 7fd2159..0000000
--- a/scripts/githooks/pre-commit
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env bash
-# Copyright © 2023 OpenIMSDK.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ==============================================================================
-# This is a pre-commit hook that ensures attempts to commit files that are
-# are larger than $limit to your _local_ repo fail, with a helpful error message.
-
-# You can override the default limit of 2MB by supplying the environment variable:
-# GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB"
-#
-# ==============================================================================
-#
-
-LC_ALL=C
-
-local_branch="$(git rev-parse --abbrev-ref HEAD)"
-valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|bot|refactor|revert|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
-
-YELLOW="\e[93m"
-GREEN="\e[32m"
-RED="\e[31m"
-ENDCOLOR="\e[0m"
-
-printMessage() {
- printf "${YELLOW}openim : $1${ENDCOLOR}\n"
-}
-
-printSuccess() {
- printf "${GREEN}openim : $1${ENDCOLOR}\n"
-}
-
-printError() {
- printf "${RED}openim : $1${ENDCOLOR}\n"
-}
-
-printMessage "Running local openim pre-commit hook."
-
-# flutter format .
-# https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md
-# TODO! GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB"
-# Maximum file size limit in bytes
-limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB
-limitInMB=$(( $limit / 1000000 ))
-
-function file_too_large(){
- filename=$0
- filesize=$(( $1 / 2**20 ))
-
- cat < /dev/null 2>&1
-then
- against=HEAD
-else
- against="$empty_tree"
-fi
-
-# Set split so that for loop below can handle spaces in file names by splitting on line breaks
-IFS='
-'
-
-shouldFail=false
-for file in $( git diff-index --cached --name-only $against ); do
- file_size=$(([ ! -f $file ] && echo 0) || (ls -la $file | awk '{ print $5 }'))
- if [ "$file_size" -gt "$limit" ]; then
- printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB"
- shouldFail=true
- fi
-done
-
-if $shouldFail
-then
- printMessage "If you really need to commit this file, you can override the size limit by setting the GIT_FILE_SIZE_LIMIT environment variable, e.g. GIT_FILE_SIZE_LIMIT=42000000 for 42MB. Or, commit with the --no-verify switch to skip the check entirely."
- printError "Commit aborted"
- exit 1;
-fi
-
-if [[ ! $local_branch =~ $valid_branch_regex ]]
-then
- printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex.
-Your commit will be rejected. You should rename your branch to a valid name(feat/name OR bug/name) and try again."
- printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694"
- exit 1
-fi
\ No newline at end of file
diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh
deleted file mode 100644
index d8396b5..0000000
--- a/scripts/githooks/pre-commit.sh
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env bash
-# Copyright © 2023 OpenIMSDK.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ==============================================================================
-# This is a pre-commit hook that ensures attempts to commit files that are
-# are larger than $limit to your _local_ repo fail, with a helpful error message.
-
-# You can override the default limit of 2MB by supplying the environment variable:
-# GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB"
-#
-# ==============================================================================
-#
-
-LC_ALL=C
-
-local_branch="$(git rev-parse --abbrev-ref HEAD)"
-valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|bot|refactor|revert|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
-
-YELLOW="\e[93m"
-GREEN="\e[32m"
-RED="\e[31m"
-ENDCOLOR="\e[0m"
-
-printMessage() {
- printf "${YELLOW}openim : $1${ENDCOLOR}\n"
-}
-
-printSuccess() {
- printf "${GREEN}openim : $1${ENDCOLOR}\n"
-}
-
-printError() {
- printf "${RED}openim : $1${ENDCOLOR}\n"
-}
-
-printMessage "Running local openim pre-commit hook."
-
-# flutter format .
-# https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md
-# TODO! GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB"
-# Maximum file size limit in bytes
-limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB
-limitInMB=$(( $limit / 1000000 ))
-
-function file_too_large(){
- filename=$0
- filesize=$(( $1 / 2**20 ))
-
- cat < /dev/null 2>&1
-then
- against=HEAD
-else
- against="$empty_tree"
-fi
-
-# Set split so that for loop below can handle spaces in file names by splitting on line breaks
-IFS='
-'
-
-shouldFail=false
-for file in $( git diff-index --cached --name-only $against ); do
- file_size=$(([ ! -f $file ] && echo 0) || (ls -la $file | awk '{ print $5 }'))
- if [ "$file_size" -gt "$limit" ]; then
- printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB"
- shouldFail=true
- fi
-done
-
-if $shouldFail
-then
- printMessage "If you really need to commit this file, you can override the size limit by setting the GIT_FILE_SIZE_LIMIT environment variable, e.g. GIT_FILE_SIZE_LIMIT=42000000 for 42MB. Or, commit with the --no-verify switch to skip the check entirely."
- printError "Commit aborted"
- exit 1;
-fi
-
-if [[ ! $local_branch =~ $valid_branch_regex ]]
-then
- printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex.
-Your commit will be rejected. You should rename your branch to a valid name(feat/name OR fix/name) and try again."
- printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694"
- exit 1
-fi
\ No newline at end of file
diff --git a/scripts/githooks/pre-push b/scripts/githooks/pre-push
deleted file mode 100644
index 2985313..0000000
--- a/scripts/githooks/pre-push
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env bash
-# Copyright © 2023 OpenIMSDK.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ==============================================================================
-#
-
-YELLOW="\e[93m"
-GREEN="\e[32m"
-RED="\e[31m"
-ENDCOLOR="\e[0m"
-
-local_branch="$(git rev-parse --abbrev-ref HEAD)"
-valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
-
-printMessage() {
- printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printSuccess() {
- printf "${GREEN}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printError() {
- printf "${RED}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printMessage "Running local OpenIM pre-push hook."
-
-if [[ `git status --porcelain` ]]; then
- printError "This scripts needs to run against committed code only. Please commit or stash you changes."
- exit 1
-fi
-
-COLOR_SUFFIX="\033[0m"
-
-BLACK_PREFIX="\033[30m"
-RED_PREFIX="\033[31m"
-GREEN_PREFIX="\033[32m"
-BACKGROUND_GREEN="\033[33m"
-BLUE_PREFIX="\033[34m"
-PURPLE_PREFIX="\033[35m"
-SKY_BLUE_PREFIX="\033[36m"
-WHITE_PREFIX="\033[37m"
-BOLD_PREFIX="\033[1m"
-UNDERLINE_PREFIX="\033[4m"
-ITALIC_PREFIX="\033[3m"
-
-# Function to print colored text
-print_color() {
- local text=$1
- local color=$2
- echo -e "${color}${text}${COLOR_SUFFIX}"
-}
-
-# Function to print section separator
-print_separator() {
- print_color "==========================================================" ${PURPLE_PREFIX}
-}
-
-# Get current time
-time=$(date +"%Y-%m-%d %H:%M:%S")
-
-# Print section separator
-print_separator
-
-# Print time of submission
-print_color "PTIME: ${time}" "${BOLD_PREFIX}${CYAN_PREFIX}"
-echo ""
-author=$(git config user.name)
-repository=$(basename -s .git $(git config --get remote.origin.url))
-
-# Print additional information if needed
-print_color "Repository: ${repository}" "${BLUE_PREFIX}"
-echo ""
-
-print_color "Author: ${author}" "${PURPLE_PREFIX}"
-
-# Print section separator
-print_separator
-
-file_list=$(git diff --name-status HEAD @{u})
-added_files=$(grep -c '^A' <<< "$file_list")
-modified_files=$(grep -c '^M' <<< "$file_list")
-deleted_files=$(grep -c '^D' <<< "$file_list")
-
-print_color "Added Files: ${added_files}" "${BACKGROUND_GREEN}"
-print_color "Modified Files: ${modified_files}" "${BACKGROUND_GREEN}"
-print_color "Deleted Files: ${deleted_files}" "${BACKGROUND_GREEN}"
-
-if [[ ! $local_branch =~ $valid_branch_regex ]]
-then
- printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex.
-Your commit will be rejected. You should rename your branch to a valid name(feat/name OR bug/name) and try again."
- printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694"
- exit 1
-fi
-
-#
-#printMessage "Running the Flutter analyzer"
-#flutter analyze
-#
-#if [ $? -ne 0 ]; then
-# printError "Flutter analyzer error"
-# exit 1
-#fi
-#
-#printMessage "Finished running the Flutter analyzer"
diff --git a/scripts/githooks/pre-push.sh b/scripts/githooks/pre-push.sh
deleted file mode 100644
index 9bd9389..0000000
--- a/scripts/githooks/pre-push.sh
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env bash
-# Copyright © 2023 OpenIMSDK.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ==============================================================================
-#
-
-YELLOW="\e[93m"
-GREEN="\e[32m"
-RED="\e[31m"
-ENDCOLOR="\e[0m"
-
-local_branch="$(git rev-parse --abbrev-ref HEAD)"
-valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
-
-printMessage() {
- printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printSuccess() {
- printf "${GREEN}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printError() {
- printf "${RED}OpenIM : $1${ENDCOLOR}\n"
-}
-
-printMessage "Running local OpenIM pre-push hook."
-
-if [[ $(git status --porcelain) ]]; then
- printError "This scripts needs to run against committed code only. Please commit or stash you changes."
- exit 1
-fi
-
-COLOR_SUFFIX="\033[0m"
-
-BLACK_PREFIX="\033[30m"
-RED_PREFIX="\033[31m"
-GREEN_PREFIX="\033[32m"
-BACKGROUND_GREEN="\033[33m"
-BLUE_PREFIX="\033[34m"
-PURPLE_PREFIX="\033[35m"
-SKY_BLUE_PREFIX="\033[36m"
-WHITE_PREFIX="\033[37m"
-BOLD_PREFIX="\033[1m"
-UNDERLINE_PREFIX="\033[4m"
-ITALIC_PREFIX="\033[3m"
-
-# Function to print colored text
-print_color() {
- local text=$1
- local color=$2
- echo -e "${color}${text}${COLOR_SUFFIX}"
-}
-
-# Function to print section separator
-print_separator() {
- print_color "==========================================================" ${PURPLE_PREFIX}
-}
-
-# Get current time
-time=$(date +"%Y-%m-%d %H:%M:%S")
-
-# Print section separator
-print_separator
-
-# Print time of submission
-print_color "PTIME: ${time}" "${BOLD_PREFIX}${CYAN_PREFIX}"
-echo ""
-author=$(git config user.name)
-repository=$(basename -s .git $(git config --get remote.origin.url))
-
-# Print additional information if needed
-print_color "Repository: ${repository}" "${BLUE_PREFIX}"
-echo ""
-
-print_color "Author: ${author}" "${PURPLE_PREFIX}"
-
-# Print section separator
-print_separator
-
-file_list=$(git diff --name-status HEAD @{u})
-added_files=$(grep -c '^A' <<< "$file_list")
-modified_files=$(grep -c '^M' <<< "$file_list")
-deleted_files=$(grep -c '^D' <<< "$file_list")
-
-print_color "Added Files: ${added_files}" "${BACKGROUND_GREEN}"
-print_color "Modified Files: ${modified_files}" "${BACKGROUND_GREEN}"
-print_color "Deleted Files: ${deleted_files}" "${BACKGROUND_GREEN}"
-
-if [[ ! $local_branch =~ $valid_branch_regex ]]
-then
- printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex.
-Your commit will be rejected. You should rename your branch to a valid name(feat/name OR fix/name) and try again."
- printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694"
- exit 1
-fi
-
-#
-#printMessage "Running the Flutter analyzer"
-#flutter analyze
-#
-#if [ $? -ne 0 ]; then
-# printError "Flutter analyzer error"
-# exit 1
-#fi
-#
-#printMessage "Finished running the Flutter analyzer"
diff --git a/src/imsdk.cpp b/src/imsdk.cpp
deleted file mode 100644
index 5727da9..0000000
--- a/src/imsdk.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "imsdk.h"
-
-#include
-#include
-#include "json.hpp"
-using json = nlohmann::json;
-
-char *GetOperationId(const char *prefix)
-{
- static int operationIndex = 0;
- operationIndex = operationIndex + 1;
- std::stringstream ss;
- ss << prefix << "_" << operationIndex;
- return (char *)ss.str().c_str();
-}
-
-void OpenIM::InitSDK()
-{
- init_sdk(GetOperationId("init_sdk"), "");
-}
\ No newline at end of file
diff --git a/src/json.hpp b/src/json.hpp
deleted file mode 100644
index 8b72ea6..0000000
--- a/src/json.hpp
+++ /dev/null
@@ -1,24765 +0,0 @@
-// __ _____ _____ _____
-// __| | __| | | | JSON for Modern C++
-// | | |__ | | | | | | version 3.11.3
-// |_____|_____|_____|_|___| https://github.com/nlohmann/json
-//
-// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann
-// SPDX-License-Identifier: MIT
-
-/****************************************************************************\
- * Note on documentation: The source files contain links to the online *
- * documentation of the public API at https://json.nlohmann.me. This URL *
- * contains the most recent documentation and should also be applicable to *
- * previous versions; documentation for deprecated functions is not *
- * removed, but marked deprecated. See "Generate documentation" section in *
- * file docs/README.md. *
-\****************************************************************************/
-
-#ifndef INCLUDE_NLOHMANN_JSON_HPP_
-#define INCLUDE_NLOHMANN_JSON_HPP_
-
-#include // all_of, find, for_each
-#include // nullptr_t, ptrdiff_t, size_t
-#include // hash, less
-#include // initializer_list
-#ifndef JSON_NO_IO
- #include // istream, ostream
-#endif // JSON_NO_IO
-#include // random_access_iterator_tag
-#include // unique_ptr
-#include // string, stoi, to_string
-#include // declval, forward, move, pair, swap
-#include // vector
-
-// #include
-// __ _____ _____ _____
-// __| | __| | | | JSON for Modern C++
-// | | |__ | | | | | | version 3.11.3
-// |_____|_____|_____|_|___| https://github.com/nlohmann/json
-//
-// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann
-// SPDX-License-Identifier: MIT
-
-
-
-#include
-
-// #include
-// __ _____ _____ _____
-// __| | __| | | | JSON for Modern C++
-// | | |__ | | | | | | version 3.11.3
-// |_____|_____|_____|_|___| https://github.com/nlohmann/json
-//
-// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann
-// SPDX-License-Identifier: MIT
-
-
-
-// This file contains all macro definitions affecting or depending on the ABI
-
-#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
- #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
- #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 3
- #warning "Already included a different version of the library!"
- #endif
- #endif
-#endif
-
-#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
-#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
-#define NLOHMANN_JSON_VERSION_PATCH 3 // NOLINT(modernize-macro-to-enum)
-
-#ifndef JSON_DIAGNOSTICS
- #define JSON_DIAGNOSTICS 0
-#endif
-
-#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
- #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
-#endif
-
-#if JSON_DIAGNOSTICS
- #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag
-#else
- #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS
-#endif
-
-#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
- #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp
-#else
- #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
-#endif
-
-#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
- #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
-#endif
-
-// Construct the namespace ABI tags component
-#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
-#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
- NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
-
-#define NLOHMANN_JSON_ABI_TAGS \
- NLOHMANN_JSON_ABI_TAGS_CONCAT( \
- NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
- NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
-
-// Construct the namespace version component
-#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
- _v ## major ## _ ## minor ## _ ## patch
-#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
- NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
-
-#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
-#define NLOHMANN_JSON_NAMESPACE_VERSION
-#else
-#define NLOHMANN_JSON_NAMESPACE_VERSION \
- NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
- NLOHMANN_JSON_VERSION_MINOR, \
- NLOHMANN_JSON_VERSION_PATCH)
-#endif
-
-// Combine namespace components
-#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
-#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
- NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
-
-#ifndef NLOHMANN_JSON_NAMESPACE
-#define NLOHMANN_JSON_NAMESPACE \
- nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
- NLOHMANN_JSON_ABI_TAGS, \
- NLOHMANN_JSON_NAMESPACE_VERSION)
-#endif
-
-#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
-#define NLOHMANN_JSON_NAMESPACE_BEGIN \
- namespace nlohmann \
- { \
- inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
- NLOHMANN_JSON_ABI_TAGS, \
- NLOHMANN_JSON_NAMESPACE_VERSION) \
- {
-#endif
-
-#ifndef NLOHMANN_JSON_NAMESPACE_END
-#define NLOHMANN_JSON_NAMESPACE_END \
- } /* namespace (inline namespace) NOLINT(readability/namespace) */ \
- } // namespace nlohmann
-#endif
-
-// #include
-// __ _____ _____ _____
-// __| | __| | | | JSON for Modern C++
-// | | |__ | | | | | | version 3.11.3
-// |_____|_____|_____|_|___| https://github.com/nlohmann/json
-//
-// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann
-// SPDX-License-Identifier: MIT
-
-
-
-#include // transform
-#include // array
-#include // forward_list
-#include // inserter, front_inserter, end
-#include