Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 68 additions & 8 deletions .github/workflows/build-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
arch: 'win64_msvc2022_64'
cache: true

- name: Set up MSVC Developer Command Prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Install Qt (Linux/macOS)
if: runner.os != 'Windows'
uses: jurplel/install-qt-action@v4
Expand All @@ -48,6 +52,55 @@ jobs:
libxcb-xkb1 libdbus-1-3 \
libfuse2 file imagemagick librsvg2-bin

- name: Cache vcpkg binary archives (Linux)
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: ~/.cache/vcpkg/archives
key: vcpkg-archives-linux-libgit2-v1
restore-keys: |
vcpkg-archives-linux-

- name: Cache vcpkg binary archives (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: vcpkg-archives-windows-libgit2-v1
restore-keys: |
vcpkg-archives-windows-

- name: Cache vcpkg binary archives (macOS)
if: runner.os == 'macOS'
uses: actions/cache@v4
with:
path: ~/vcpkg/archives
key: vcpkg-archives-macos-libgit2-v1
restore-keys: |
vcpkg-archives-macos-

- name: Setup vcpkg (Linux)
if: runner.os == 'Linux'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install libgit2

- name: Setup vcpkg (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install libgit2:x64-windows

- name: Setup vcpkg (macOS)
if: runner.os == 'macOS'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install libgit2

- name: Download linuxdeploy tools
if: runner.os == 'Linux'
run: |
Expand All @@ -61,13 +114,19 @@ jobs:
shell: pwsh
env:
SCCACHE_GHA_ENABLED: "true"
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"

- name: Configure CMake (Linux/macOS)
if: runner.os != 'Windows'
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
env:
SCCACHE_GHA_ENABLED: "true"
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"

- name: Configure CMake (Linux)
if: runner.os == 'Linux'
env:
SCCACHE_GHA_ENABLED: "true"
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"

- name: Build
run: cmake --build build --config Release --parallel
Expand Down Expand Up @@ -95,10 +154,11 @@ jobs:
shell: pwsh
run: |
New-Item -ItemType Directory -Path package -Force
if (!(Test-Path "build/Release/cremniy.exe")) {
throw "build/Release/cremniy.exe was not produced"
# Ninja кладет бинарник прямо в build
if (!(Test-Path "build/cremniy.exe")) {
throw "build/cremniy.exe was not produced"
}
Copy-Item build/Release/cremniy.exe package/
Copy-Item build/cremniy.exe package/

New-Item -ItemType Directory -Path "package/Resources/translations" -Force
Copy-Item build/*.qm "package/Resources/translations/"
Expand All @@ -123,4 +183,4 @@ jobs:
cremniy-linux.AppImage
cremniy-windows.zip
cremniy-macos.tar.gz
if-no-files-found: error
if-no-files-found: error
47 changes: 43 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,39 @@ jobs:
libxcb-render-util0 libxcb-xinerama0 libxcb-cursor0 \
libxcb-xkb1 libdbus-1-3

- name: Cache vcpkg binary archives (Linux)
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: ~/.cache/vcpkg/archives
key: vcpkg-archives-linux-libgit2-v1
restore-keys: |
vcpkg-archives-linux-

- name: Cache vcpkg binary archives (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: vcpkg-archives-windows-libgit2-v1
restore-keys: |
vcpkg-archives-windows-

- name: Setup vcpkg (Linux)
if: runner.os == 'Linux'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install libgit2

- name: Setup vcpkg (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install libgit2:x64-windows

- name: Initialize MSVC Environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -74,13 +107,19 @@ jobs:
-DCMAKE_C_COMPILER=cl `
-DCMAKE_CXX_COMPILER=cl `
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache

-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"

- name: Configure CMake (Linux)
if: runner.os == 'Linux'
env:
SCCACHE_GHA_ENABLED: "true"
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
run: |
cmake -B build -S src \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"

- name: Build
run: cmake --build build --config Release --parallel
Expand All @@ -95,4 +134,4 @@ jobs:
run: |
if (!(Test-Path "build/cremniy.exe")) {
throw "build/cremniy.exe was not produced"
}
}
83 changes: 61 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,55 @@ jobs:
libxcb-xkb1 libdbus-1-3 \
libfuse2 file imagemagick librsvg2-bin

- name: Cache vcpkg binary archives (Linux)
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: ~/.cache/vcpkg/archives
key: vcpkg-archives-linux-libgit2-v1
restore-keys: |
vcpkg-archives-linux-

- name: Cache vcpkg binary archives (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: vcpkg-archives-windows-libgit2-v1
restore-keys: |
vcpkg-archives-windows-

- name: Cache vcpkg binary archives (macOS)
if: runner.os == 'macOS'
uses: actions/cache@v4
with:
path: ~/vcpkg/archives
key: vcpkg-archives-macos-libgit2-v1
restore-keys: |
vcpkg-archives-macos-

- name: Setup vcpkg (Linux)
if: runner.os == 'Linux'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install libgit2

- name: Setup vcpkg (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install libgit2:x64-windows

- name: Setup vcpkg (macOS)
if: runner.os == 'macOS'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install libgit2

- name: Download linuxdeploy tools
if: runner.os == 'Linux'
run: |
Expand All @@ -68,29 +117,19 @@ jobs:
shell: pwsh
env:
SCCACHE_GHA_ENABLED: "true"
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"

- name: Configure CMake (Linux/macOS)
if: runner.os != 'Windows'
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
env:
SCCACHE_GHA_ENABLED: "true"
run: |
if [ "${{ runner.os }}" = "macOS" ]; then
# Передаем флаги во ВСЕ внутренние тесты компилятора CMake
cmake -B build -S src -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-weak_framework,AGL" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-weak_framework,AGL" \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,-weak_framework,AGL" \
-DCMAKE_REQUIRED_FLAGS="-Wl,-weak_framework,AGL"
else
cmake -B build -S src -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
fi
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"

- name: Configure CMake (Linux)
if: runner.os == 'Linux'
env:
SCCACHE_GHA_ENABLED: "true"
run: cmake -B build -S src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"

- name: Build
run: cmake --build build --config Release --parallel
Expand Down Expand Up @@ -118,7 +157,7 @@ jobs:
shell: pwsh
run: |
New-Item -ItemType Directory -Path package -Force
# Убираем /Release/ из пути, так как Ninja кладет бинарник прямо в build
# Ninja кладет бинарник прямо в build
if (!(Test-Path "build/cremniy.exe")) {
throw "build/cremniy.exe was not produced"
}
Expand Down Expand Up @@ -175,4 +214,4 @@ jobs:
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 24 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# For clangd LSP
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Qt6 6.8.2 REQUIRED COMPONENTS Core Widgets Gui LinguistTools Test Svg)

find_package(Qt6 6.8.2 REQUIRED COMPONENTS Widgets LinguistTools Test Svg)
find_package(libgit2 CONFIG QUIET)
if(NOT libgit2_FOUND)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libgit2 REQUIRED libgit2)
endif()

set(PROJECT_SOURCES
main.cpp
Expand Down Expand Up @@ -77,6 +80,10 @@ qt_add_executable(${PROJECT_NAME}
core/modules/WindowBase.h
core/modules/ReferenceBase.h

# Git
core/git/gitmanager.cpp
core/git/gitmanager.h

# UI
ui/FilesTabWidget/filestabwidget.cpp
ui/FilesTabWidget/filestabwidget.h
Expand All @@ -93,6 +100,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/widgets
${CMAKE_CURRENT_SOURCE_DIR}/core/file
${CMAKE_CURRENT_SOURCE_DIR}/core/git
${CMAKE_CURRENT_SOURCE_DIR}/core/project
${CMAKE_CURRENT_SOURCE_DIR}/core/settings
${CMAKE_CURRENT_SOURCE_DIR}/utils
Expand All @@ -101,7 +109,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/FilesTabWidget
)

file(GLOB_RECURSE PHOICONS_FILES
file(GLOB_RECURSE PHOICONS_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/phoicons/*"
)

Expand All @@ -126,7 +134,17 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Modules/Windows/)
# - - Menus - -
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ui/MenuBar/Menus/)

target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets Qt6::Svg)
# Link libgit2 - different targets for vcpkg and pkg-config
if(TARGET libgit2::libgit2)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets Qt6::Gui Qt6::Svg libgit2::libgit2)
elseif(TARGET libgit2::libgit2package)
# vcpkg target (older versions)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets Qt6::Gui Qt6::Svg libgit2::libgit2package)
else()
# Fallback to pkg-config variables
target_include_directories(${PROJECT_NAME} PRIVATE ${libgit2_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets Qt6::Gui Qt6::Svg ${libgit2_LIBRARIES})
endif()

set(APP_LANGUAGES
en
Expand Down Expand Up @@ -200,4 +218,4 @@ install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

qt_finalize_executable(${PROJECT_NAME})
qt_finalize_executable(${PROJECT_NAME})
1 change: 1 addition & 0 deletions src/app/IDEWindow/idewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

IDEWindow::IDEWindow(const QString &ProjectPath, QWidget *parent)
: QMainWindow(parent), m_projectPath(ProjectPath) {
setProperty("projectPath", ProjectPath);
// - - Window Settings - -
this->setWindowState(Qt::WindowMaximized);
this->setWindowTitle("Cremniy");
Expand Down
Loading
Loading