Skip to content

Commit 8eab5c9

Browse files
authored
Merge pull request #10 from FGadvancer/main
Feat: update sdk to v3.5.1 and refactor project structure.
2 parents d8d8846 + 1389c44 commit 8eab5c9

40 files changed

+403
-917
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
*.vscode

bootstrap_install_mage.bat

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
SETLOCAL
3+
4+
mage -version >nul 2>&1
5+
IF %ERRORLEVEL% EQU 0 (
6+
echo Mage is already installed.
7+
GOTO DOWNLOAD
8+
)
9+
10+
go version >nul 2>&1
11+
IF NOT %ERRORLEVEL% EQU 0 (
12+
echo Go is not installed. Please install Go and try again.
13+
exit /b 1
14+
)
15+
16+
echo Installing Mage...
17+
go install github.com/magefile/mage@latest
18+
19+
mage -version >nul 2>&1
20+
IF NOT %ERRORLEVEL% EQU 0 (
21+
echo Mage installation failed.
22+
echo Please ensure that %GOPATH%/bin is in your PATH.
23+
exit /b 1
24+
)
25+
26+
echo Mage installed successfully.
27+
28+
:DOWNLOAD
29+
go mod download
30+
31+
ENDLOCAL

bootstrap_install_mage.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
if [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then
4+
TARGET_DIR="$HOME/.local/bin"
5+
else
6+
TARGET_DIR="/usr/local/bin"
7+
echo "Using /usr/local/bin as the installation directory. Might require sudo permissions."
8+
fi
9+
10+
if ! command -v mage &> /dev/null; then
11+
echo "Installing Mage to $TARGET_DIR ..."
12+
GOBIN=$TARGET_DIR go install github.com/magefile/mage@latest
13+
fi
14+
15+
if ! command -v mage &> /dev/null; then
16+
echo "Mage installation failed."
17+
echo "Please ensure that $TARGET_DIR is in your \$PATH."
18+
exit 1
19+
fi
20+
21+
echo "Mage installed successfully."
22+
23+
go mod download

c/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cmake_minimum_required(VERSION 3.12)
2+
project(test_project)
3+
4+
Set source code files
5+
set(SOURCE_FILES test.c)
6+
7+
Set dynamic library file path
8+
set(LIBRARY_PATH ../shared/windows)
9+
10+
Set dynamic library file name
11+
set(LIBRARY_NAME libopenimsdk)
12+
13+
Add executable
14+
add_executable(test.exe ${SOURCE_FILES})
15+
16+
Add library directory for linking
17+
link_directories(${LIBRARY_PATH})
18+
19+
Add library for linking
20+
target_link_libraries(test.exe ${LIBRARY_NAME})

c/include/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# openim-sdk-cpp
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <stdlib.h>
44
#include <unistd.h>
55

6-
#include "openimsdk.h"
6+
#include "../include/libopenimsdk.h"
77

88
typedef struct
99
{
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
5151
set_advanced_msg_listener(c_message_callback);
5252
login(c_base_callback, operationID, uid, token);
5353
sleep(10);
54-
// char text[] = "哈哈";
54+
// char text[] = "hello";
5555
char* loginUserID=get_login_user();
5656

5757
printf("return :%s\n",loginUserID);

c_cpp_wrapper/build_test.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

c_cpp_wrapper/event_listener/listener.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

c_cpp_wrapper/gen_android_so.bat

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

c_cpp_wrapper/go.mod

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

0 commit comments

Comments
 (0)