Skip to content

Commit 0caaa43

Browse files
author
SessionHero01
committed
Initial commit
0 parents  commit 0caaa43

File tree

450 files changed

+41042
-0
lines changed

Some content is hidden

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

450 files changed

+41042
-0
lines changed

.github/workflows/build.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
# Only allow one concurrency
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build_android:
19+
runs-on: ubuntu-latest
20+
if: false
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
26+
# Steps to build the Rust library
27+
- uses: Swatinem/rust-cache@v2
28+
- name: Install cargo-ndk
29+
run: cargo install cargo-ndk
30+
- name: Install necessary cargo toolchains
31+
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
32+
- name: Find out where the NDK v26 is by looking at the sdk folder
33+
id: setup-ndk
34+
run: echo "ndk-path=$(dirname $(find $ANDROID_HOME/ndk -name 'ndk-gdb' -maxdepth 2 | grep 26))" >> $GITHUB_OUTPUT
35+
# Steps to build the Flutter app
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v4
38+
with:
39+
java-version: '17'
40+
distribution: 'temurin'
41+
42+
- name: Set up Flutter
43+
uses: subosito/flutter-action@v2
44+
with:
45+
channel: stable
46+
cache: true
47+
48+
- name: Build ANDROID
49+
run: make android
50+
env:
51+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
52+
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
53+
54+
# Steps to upload the APK
55+
- name: Upload APK
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: session-app.apk
59+
path: flutter/build/app/outputs/apk/release/app-release.apk
60+
61+
build_linux:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
with:
66+
submodules: recursive
67+
- uses: Swatinem/rust-cache@v2
68+
- name: Download appimagetool
69+
run: curl -fL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" > appimagetool
70+
- name: Make appimagetool executable
71+
run: chmod +x appimagetool && sudo mkdir -p /usr/local/bin && sudo mv appimagetool /usr/local/bin/appimagetool
72+
- name: Set up Flutter
73+
uses: subosito/flutter-action@v2
74+
with:
75+
channel: stable
76+
cache: true
77+
- name: Install dependencies
78+
run: |
79+
sudo apt-get update -y
80+
sudo apt-get install -y ninja-build libgtk-3-dev
81+
- name: Build rust and Flutter binaries
82+
run: make linux
83+
env:
84+
CARGO_TERM_COLOR: always
85+
- name: Upload Bundle
86+
uses: actions/upload-artifact@v4
87+
with:
88+
path: flutter/build/linux/session-x86_64.AppImage
89+
90+
build_windows:
91+
runs-on: windows-latest
92+
if: false
93+
steps:
94+
- uses: actions/checkout@v4
95+
with:
96+
submodules: recursive
97+
98+
# Steps to build the Rust library
99+
- name: Build rust binary
100+
run: cargo build --release --target x86_64-pc-windows-msvc
101+
env:
102+
CARGO_TERM_COLOR: always
103+
104+
- name: Set up Flutter
105+
uses: subosito/flutter-action@v2
106+
with:
107+
channel: stable
108+
cache: true
109+
110+
- name: Build Flutter release
111+
run: flutter build windows --release
112+
working-directory: flutter
113+
114+
# Steps to upload the EXE
115+
- name: Upload EXE
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: session-app.exe

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/target
2+
.env
3+
.idea
4+
/build
5+
cmake-*
6+
.DS_Store
7+
libsession-ui-core/*sqlite3db*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "libsession-util-sys/libsession-util"]
2+
path = libsession-util-sys/libsession-util
3+
url = https://github.com/session-foundation/libsession-util.git

.run/Run account server.run.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run account server" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
3+
<option name="buildProfileId" value="dev" />
4+
<option name="command" value="run --bin session-cli -- run-account-server -l 127.0.0.1:4001" />
5+
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
6+
<envs />
7+
<option name="emulateTerminal" value="true" />
8+
<option name="channel" value="DEFAULT" />
9+
<option name="requiredFeatures" value="true" />
10+
<option name="allFeatures" value="false" />
11+
<option name="withSudo" value="false" />
12+
<option name="buildTarget" value="REMOTE" />
13+
<option name="backtrace" value="SHORT" />
14+
<option name="isRedirectInput" value="false" />
15+
<option name="redirectInputPath" value="" />
16+
<method v="2" />
17+
</configuration>
18+
</component>

.run/Run global server.run.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run global server" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
3+
<option name="buildProfileId" value="dev" />
4+
<option name="command" value="run --bin session-cli -- run-global-server -l 127.0.0.1:4002" />
5+
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
6+
<envs />
7+
<option name="emulateTerminal" value="true" />
8+
<option name="channel" value="DEFAULT" />
9+
<option name="requiredFeatures" value="true" />
10+
<option name="allFeatures" value="false" />
11+
<option name="withSudo" value="false" />
12+
<option name="buildTarget" value="REMOTE" />
13+
<option name="backtrace" value="SHORT" />
14+
<option name="isRedirectInput" value="false" />
15+
<option name="redirectInputPath" value="" />
16+
<method v="2">
17+
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
18+
</method>
19+
</configuration>
20+
</component>

.run/Test all.run.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Test all" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
3+
<option name="buildProfileId" value="dev" />
4+
<option name="command" value="test --package session-ui-core" />
5+
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
6+
<envs />
7+
<option name="emulateTerminal" value="true" />
8+
<option name="channel" value="DEFAULT" />
9+
<option name="requiredFeatures" value="true" />
10+
<option name="allFeatures" value="false" />
11+
<option name="withSudo" value="false" />
12+
<option name="buildTarget" value="REMOTE" />
13+
<option name="backtrace" value="SHORT" />
14+
<option name="isRedirectInput" value="false" />
15+
<option name="redirectInputPath" value="" />
16+
<method v="2">
17+
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
18+
</method>
19+
</configuration>
20+
</component>

.vscode/launch.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Flutter",
9+
"type": "dart",
10+
"request": "launch",
11+
"program": "lib/main.dart",
12+
"cwd": "${workspaceFolder}/flutter",
13+
"env": {
14+
"DISPLAY": ":1"
15+
}
16+
},
17+
{
18+
"type": "lldb",
19+
"request": "launch",
20+
"name": "Global server",
21+
"program": "${workspaceFolder}/target/debug/session-cli",
22+
"preLaunchTask": "build",
23+
"sourceLanguages": [
24+
"rust"
25+
],
26+
"args": [
27+
"run-global-server",
28+
"-l",
29+
"127.0.0.1:4002"
30+
],
31+
"cwd": "${workspaceFolder}"
32+
},
33+
{
34+
"type": "lldb",
35+
"request": "launch",
36+
"name": "Account server",
37+
"program": "${workspaceFolder}/target/debug/session-cli",
38+
"sourceLanguages": [
39+
"rust"
40+
],
41+
"preLaunchTask": "build",
42+
"args": [
43+
"run-account-server",
44+
"-l",
45+
"127.0.0.1:4003"
46+
]
47+
}
48+
]
49+
}

.vscode/settings.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"cmake.configureArgs": [
3+
"-DSTATIC_BUNDLE=ON",
4+
"-DBUILD_STATIC_DEPS=ON",
5+
"-DBUILD_SHARED_LIBS=OFF",
6+
"-DSTATIC_LIBSTD=ON",
7+
"-DOXEN_LOGGING_FMT_HEADER_ONLY=ON",
8+
"-DCMAKE_BUILD_TYPE=Debug"
9+
],
10+
"cmake.buildBeforeRun": true,
11+
"files.associations": {
12+
"string_view": "cpp",
13+
"array": "cpp",
14+
"__locale": "cpp",
15+
"locale": "cpp",
16+
"__tree": "cpp",
17+
"regex": "cpp",
18+
"string": "cpp",
19+
"*.inc": "cpp",
20+
"optional": "cpp",
21+
"stdexcept": "cpp",
22+
"*.tcc": "cpp",
23+
"forward_list": "cpp",
24+
"list": "cpp",
25+
"unordered_map": "cpp",
26+
"unordered_set": "cpp",
27+
"__bit_reference": "cpp",
28+
"__hash_table": "cpp",
29+
"__node_handle": "cpp",
30+
"__threading_support": "cpp",
31+
"__verbose_abort": "cpp",
32+
"bitset": "cpp",
33+
"cctype": "cpp",
34+
"charconv": "cpp",
35+
"clocale": "cpp",
36+
"cmath": "cpp",
37+
"complex": "cpp",
38+
"condition_variable": "cpp",
39+
"cstdarg": "cpp",
40+
"cstddef": "cpp",
41+
"cstdint": "cpp",
42+
"cstdio": "cpp",
43+
"cstdlib": "cpp",
44+
"cstring": "cpp",
45+
"ctime": "cpp",
46+
"cwchar": "cpp",
47+
"cwctype": "cpp",
48+
"execution": "cpp",
49+
"memory": "cpp",
50+
"initializer_list": "cpp",
51+
"ios": "cpp",
52+
"iosfwd": "cpp",
53+
"iostream": "cpp",
54+
"istream": "cpp",
55+
"limits": "cpp",
56+
"map": "cpp",
57+
"mutex": "cpp",
58+
"new": "cpp",
59+
"numbers": "cpp",
60+
"ostream": "cpp",
61+
"print": "cpp",
62+
"ratio": "cpp",
63+
"set": "cpp",
64+
"sstream": "cpp",
65+
"streambuf": "cpp",
66+
"tuple": "cpp",
67+
"typeinfo": "cpp",
68+
"variant": "cpp",
69+
"vector": "cpp",
70+
"algorithm": "cpp",
71+
"atomic": "cpp",
72+
"bit": "cpp",
73+
"chrono": "cpp",
74+
"compare": "cpp",
75+
"concepts": "cpp",
76+
"exception": "cpp",
77+
"functional": "cpp",
78+
"iterator": "cpp",
79+
"memory_resource": "cpp",
80+
"random": "cpp",
81+
"system_error": "cpp",
82+
"type_traits": "cpp",
83+
"utility": "cpp",
84+
"format": "cpp",
85+
"text_encoding": "cpp",
86+
"thread": "cpp",
87+
"cinttypes": "cpp"
88+
},
89+
"cmake.sourceDirectory": "${workspaceFolder}/libsession-util-sys"
90+
}

.vscode/tasks.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"type": "shell",
7+
"command": "cargo build",
8+
"group": {
9+
"kind": "build",
10+
"isDefault": true
11+
},
12+
"presentation": {
13+
"reveal": "always",
14+
"panel": "shared",
15+
"showReuseMessage": true,
16+
"clear": true
17+
}
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)