Skip to content

Commit

Permalink
Merge pull request #1142 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
ca333 authored Aug 28, 2021
2 parents 2e44e6d + 560340f commit 6871199
Show file tree
Hide file tree
Showing 409 changed files with 26,738 additions and 14,697 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/atomicdex-desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

include:
- name: ubuntu-qt-5-15-2
os: ubuntu-18.04
os: ubuntu-16.04
qt: '5.15.2'
type: 'release'

Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
host: 'linux'
target: 'desktop'
dir: '${{ github.workspace }}'
#mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
mirror: https://qt-mirror.dannhauer.de/
#mirror: https://www.funet.fi/pub/mirrors/download.qt-project.org/
#mirror: https://ftp.fau.de/qtproject/
#mirror: 'http://mirrors.ocf.berkeley.edu/qt'
#mirror: https://qt-mirror.dannhauer.de
#mirror: https://www.funet.fi/pub/mirrors/download.qt-project.org
mirror: https://ftp.fau.de/qtproject
modules: 'qtcharts qtwidgets debug_info qtwebengine qtwebview'
aqtversion: '==0.8'
py7zrversion: '==0.6'
Expand All @@ -85,17 +85,17 @@ jobs:
version: ${{ matrix.qt }}
host: 'mac'
target: 'desktop'
#mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
mirror: https://qt-mirror.dannhauer.de/
#mirror: https://www.funet.fi/pub/mirrors/download.qt-project.org/
#mirror: https://ftp.fau.de/qtproject/
#mirror: 'http://mirrors.ocf.berkeley.edu/qt'
#mirror: https://qt-mirror.dannhauer.de
#mirror: https://www.funet.fi/pub/mirrors/download.qt-project.org
mirror: https://ftp.fau.de/qtproject
dir: '${{ github.workspace }}'
modules: 'qtcharts qtwidgets debug_info qtwebview qtwebengine'

- name: Install QT IFW (MacOS)
if: runner.os == 'macOS'
run: |
python3 -m aqt tool mac tools_ifw 4.1.0-202104091030 qt.tools.ifw.41 -b https://qt-mirror.dannhauer.de/ --outputdir ${{ github.workspace }}/Qt
python3 -m aqt tool mac tools_ifw 4.1.1-202105261132 qt.tools.ifw.41 --outputdir ${{ github.workspace }}/Qt
echo "${{ github.workspace }}/Qt/Tools/QtInstallerFramework/4.0/bin" >> $GITHUB_PATH
- name: Install QT (Windows)
Expand All @@ -106,18 +106,18 @@ jobs:
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
#mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
mirror: https://qt-mirror.dannhauer.de/
#mirror: https://www.funet.fi/pub/mirrors/download.qt-project.org/
#mirror: https://ftp.fau.de/qtproject/
#mirror: 'http://mirrors.ocf.berkeley.edu/qt'
#mirror: https://qt-mirror.dannhauer.de
#mirror: https://www.funet.fi/pub/mirrors/download.qt-project.org
mirror: https://ftp.fau.de/qtproject
dir: 'C:\'
modules: 'qtcharts qtwidgets debug_info qtwebview qtwebengine'

- name: Install QT IFW (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
python -m aqt tool windows tools_ifw 4.1.0-202104091029 qt.tools.ifw.41 -b https://qt-mirror.dannhauer.de/ --outputdir C:/Qt
python -m aqt tool windows tools_ifw 4.1.1-202105261131 qt.tools.ifw.41 --outputdir C:/Qt
echo "C:/Qt/Tools/QtInstallerFramework/4.0/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo $env:GITHUB_PATH
echo $env:PATH
Expand All @@ -142,10 +142,10 @@ jobs:
- name: Upload env variable for vpkg (Linux)
if: runner.os == 'Linux'
run: |
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "LDFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "CXX=clang++-11" >> $GITHUB_ENV
echo "CC=clang-11" >> $GITHUB_ENV
#echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
#echo "LDFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "CXX=clang++-12" >> $GITHUB_ENV
echo "CC=clang-12" >> $GITHUB_ENV
- name: vcpkg deps (All)
uses: KomodoPlatform/run-vcpkg@v7
Expand All @@ -172,10 +172,10 @@ jobs:
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
export CXXFLAGS=-stdlib=libc++
export LDFLAGS=-stdlib=libc++
export CXX=clang++-11
export CC=clang-11
#export CXXFLAGS=-stdlib=libc++
#export LDFLAGS=-stdlib=libc++
export CXX=clang++-12
export CC=clang-12
cd ci_tools_atomic_dex
nimble build -y
Expand Down Expand Up @@ -235,10 +235,10 @@ jobs:
export QT_ROOT=${{ github.workspace }}/Qt/${{ matrix.qt }}
export PATH=${{ github.workspace }}/Qt/${{ matrix.qt }}/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
export CXXFLAGS=-stdlib=libc++
export LDFLAGS=-stdlib=libc++
export CXX=clang++-11
export CC=clang-11
#export CXXFLAGS=-stdlib=libc++
#export LDFLAGS=-stdlib=libc++
export CXX=clang++-12
export CC=clang-12
echo "Running tests"
./ci_tools_atomic_dex tests release
cd build-Release/bin/AntaraAtomicDexTestsAppDir/usr/bin
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/sync_mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: GitlabSync

on:
push:
branches:
- '*'
pull_request:
branches:
- dev
delete:
branches:
- '*'

jobs:
sync:
runs-on: ubuntu-latest
name: Git Repo Sync
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wangchucheng/[email protected]
with:
target-url: ${{ secrets.GITLAB_URL }}
target-username: ${{ secrets.GITLAB_USERNAME }}
target-token: ${{ secrets.GITLAB_TOKEN }}
112 changes: 112 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
image: smk762/qt-ci:latest

stages:
- build
- upload_linux_zip
- upload_linux_tar
- upload_linux_appimage
- test

variables:
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_DRIVER: overlay2
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
VCPKG_DEFAULT_BINARY_CACHE: "$CI_PROJECT_DIR/.cache/vcpkg"
QT_VERSION: "5.15.2"
CMAKE_VERSION: "3.20.5"

cache:
- key: $CI_COMMIT_REF_SLUG
paths:
- atomicdex-desktop-linux-${CI_COMMIT_SHA::9}.zip
- atomicdex-desktop-linux-${CI_COMMIT_SHA::9}.tar.zst
- atomicdex-desktop-${CI_COMMIT_SHA::9}-x86_64.AppImage
- key: $CI_PROJECT_NAME
paths:
- "$CI_PROJECT_DIR/.cache/vcpkg"


linux:build:
stage: build
before_script:
- cd $CI_PROJECT_DIR
- mkdir -p .cache/pip
- mkdir -p .cache/vcpkg

script:
# Job Variables
- echo $CI_COMMIT_REF_SLUG
- echo $CI_COMMIT_AUTHOR
- echo $CI_COMMIT_BRANCH
- echo $CI_COMMIT_SHA
- echo $CI_COMMIT_SHORT_SHA
- echo $CI_PROJECT_PATH
- echo $CI_PROJECT_NAME
- echo $QT_VERSION
- echo $CMAKE_VERSION

# Job Path/Env variables
- export DEBIAN_FRONTEND=noninteractive
- export QT_INSTALL_CMAKE_PATH=/opt/Qt/$QT_VERSION/gcc_64/lib/cmake
- export QT_ROOT=/opt/Qt/$QT_VERSION
- export Qt5_DIR=/opt/Qt/$QT_VERSION/gcc_64/lib/cmake/Qt5
- export PATH=/opt/Qt/$QT_VERSION/gcc_64/bin:$PATH
- export PATH=${PATH}:/cmake-$CMAKE_VERSION-linux-x86_64/bin;
- export APPIMAGE_EXTRACT_AND_RUN=1

# Update tar
- export FORCE_UNSAFE_CONFIGURE=1
- wget https://ftp.wayne.edu/gnu/tar/tar-1.34.tar.gz && tar -xvf tar-1.34.tar.gz
- cd tar-1.34 && ./configure && make && make install
- cp src/tar $(which tar)

# Bootstrap Vcpkg
- cd $CI_PROJECT_DIR; ./ci_tools_atomic_dex/vcpkg-repo/bootstrap-vcpkg.sh

# NINJA
- cd $CI_PROJECT_DIR
- rm -rf build_ninja || echo "no build_ninja folder to rm"
- mkdir build_ninja && cd $_
- cmake -DCMAKE_BUILD_TYPE=Release -GNinja ../
- ninja atomicdex-desktop
- ninja install
- cd $CI_PROJECT_DIR
- cp $CI_PROJECT_DIR/bundled/linux/atomicdex-desktop-linux-${CI_COMMIT_SHA::9}.zip .
- cp $CI_PROJECT_DIR/bundled/linux/atomicdex-desktop-linux-${CI_COMMIT_SHA::9}.tar.zst .
- cp $CI_PROJECT_DIR/bundled/linux/atomicdex-desktop-${CI_COMMIT_SHA::9}-x86_64.AppImage .

AtomicDex-linux-zip:
stage: upload_linux_zip
allow_failure: true
script:
- echo "Uploading AppImage..."
artifacts:
name: "AtomicDex-linux-${CI_COMMIT_SHA::9}.zip"
paths:
- $CI_PROJECT_DIR/atomicdex-desktop-linux-${CI_COMMIT_SHA::9}.zip
when: always
expire_in: 1 week

AtomicDex-linux-AppImage:
stage: upload_linux_appimage
allow_failure: true
script:
- echo "Uploading AppImage..."
artifacts:
name: "AtomicDex-linux-${CI_COMMIT_SHA::9}-AppImage"
paths:
- $CI_PROJECT_DIR/atomicdex-desktop-${CI_COMMIT_SHA::9}-x86_64.AppImage
when: always
expire_in: 1 week

AtomicDex-linux-tar:
stage: upload_linux_tar
allow_failure: true
script:
- echo "Uploading tar..."
artifacts:
name: "AtomicDex-linux-${CI_COMMIT_SHA::9}.tar.zst"
paths:
- $CI_PROJECT_DIR/atomicdex-desktop-linux-${CI_COMMIT_SHA::9}.tar.zst
when: always
expire_in: 1 week
87 changes: 20 additions & 67 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(vcpkg_prerequisites)
include(qt_prerequisites)
include(cfg_hash)

project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.4.3)
project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.5.0)
message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}")

include(cmake_default_options)
Expand Down Expand Up @@ -54,23 +54,29 @@ endif ()

if (UNIX AND NOT APPLE)
message("Forcing stdlib C++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif ()

##! We fetch our dependencies
if (APPLE)
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.1.3445/mm2-419f36ef5-Darwin-Release.zip)
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/v1.1.0/mm2-41170748d-Darwin-Release.zip)
elseif (UNIX AND NOT APPLE)
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.1.3445/mm2-419f36ef5-Linux-Release.zip)
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/v1.1.0/mm2-41170748d-Linux-Release.zip)
else ()
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.1.3445/mm2-419f36ef5-Windows_NT-Release.zip)
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/v1.1.0/mm2-41170748d-Windows_NT-Release.zip)
endif ()

FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip)
#FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip)

FetchContent_Declare(
qmaterial
GIT_REPOSITORY https://github.com/KomodoPlatform/Qaterial.git
GIT_TAG 53669824261ae07bc0e8c2abb4b55431f65b2055
)

FetchContent_Declare(jl777-coins
URL https://github.com/KomodoPlatform/coins/archive/master.zip)
Expand Down Expand Up @@ -109,66 +115,13 @@ add_subdirectory(src)

# Adds Qaterial hot reload to main executable
if (WITH_HOTRELOAD)
message(STATUS "Hot reload enabled")
include(hot_reload/cmake/Configuration.cmake)
include(hot_reload/cmake/FetchDependencies.cmake)
set(QATERIALHOTRELOAD_LIB QaterialHotReload)
set(QATERIALHOTRELOAD_SRC_DIR ${CMAKE_SOURCE_DIR}/hot_reload/src/Qaterial/HotReload)
add_subdirectory(hot_reload/qml/Qaterial/HotReload)

add_library(${QATERIALHOTRELOAD_LIB} STATIC
${QATERIALHOTRELOAD_SRC_DIR}/HotReload.hpp
${QATERIALHOTRELOAD_SRC_DIR}/HotReload.cpp
${QATERIALHOTRELOAD_QML_RES})
add_library(Qaterial::HotReload ALIAS ${QATERIALHOTRELOAD_LIB})

target_link_libraries(${QATERIALHOTRELOAD_LIB} PUBLIC
Qaterial
SortFilterProxyModel
)
target_link_libraries(${QATERIALHOTRELOAD_LIB} PRIVATE
Qaterial::HotReload::Ui
spdlog::spdlog
)

function(target_link_quiet_libraries TARGET)
foreach (LIB ${ARGN})
if (TARGET ${LIB})
target_link_libraries(${TARGET} PUBLIC ${LIB})
endif ()
endforeach (LIB)
endfunction()

# Optionnal Qt libs that might be interessant to have packaged with hotreloader
find_package(Qt5 QUIET COMPONENTS
Charts)

target_link_quiet_libraries(${QATERIALHOTRELOAD_LIB}
Qt::Charts)

set_target_properties(${QATERIALHOTRELOAD_LIB} PROPERTIES
FOLDER ${QATERIALHOTRELOAD_FOLDER_PREFIX}
AUTORCC TRUE
AUTOMOC TRUE)
target_include_directories(${QATERIALHOTRELOAD_LIB} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/hot_reload/src)
target_compile_definitions(${QATERIALHOTRELOAD_LIB}
PRIVATE -DQATERIALHOTRELOAD_VERSION_MAJOR=${QATERIALHOTRELOAD_VERSION_MAJOR}
PRIVATE -DQATERIALHOTRELOAD_VERSION_MINOR=${QATERIALHOTRELOAD_VERSION_MINOR}
PRIVATE -DQATERIALHOTRELOAD_VERSION_PATCH=${QATERIALHOTRELOAD_VERSION_PATCH}
PRIVATE -DQATERIALHOTRELOAD_VERSION_TAG=${QATERIALHOTRELOAD_VERSION_TAG}
PRIVATE -DQATERIALHOTRELOAD_VERSION_TAG_HEX=${QATERIALHOTRELOAD_VERSION_TAG_HEX}
)

if (QATERIALHOTRELOAD_ENABLE_PCH AND COMMAND target_precompile_headers)
target_precompile_headers(${QATERIALHOTRELOAD_LIB} PRIVATE ${PROJECT_SOURCE_DIR}/hot_reload/src/Qaterial/HotReload/Pch/Pch.hpp)
endif ()

get_target_property(QT_TARGET_TYPE Qt::Core TYPE)
if (${QT_TARGET_TYPE} STREQUAL "STATIC_LIBRARY")
qt_generate_qml_plugin_import(${QATERIALHOTRELOAD_LIB} QML_SRC ${CMAKE_CURRENT_SOURCE_DIR})
qt_generate_plugin_import(${QATERIALHOTRELOAD_LIB})
endif ()

FetchContent_Declare(
qaterial_hotreload
GIT_REPOSITORY https://github.com/KomodoPlatform/QaterialHotReload
GIT_TAG ecffec6bd01d9a13561689283bc2a6a927957f64
)
set(QATERIALHOTRELOAD_ENABLE_HOTRELOAD_APP OFF CACHE BOOL "")
FetchContent_MakeAvailable(qaterial_hotreload)
target_link_libraries(${PROJECT_NAME} PUBLIC Qaterial::HotReload)
target_compile_definitions(${PROJECT_NAME} PUBLIC ATOMICDEX_HOT_RELOAD)
endif ()
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
| cpprestsdk | 2.10.15-1 | The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. | HTTP |
| taskflow | 2.2.0 | Parallel and Heterogeneous Task Programming in Modern C++ | Threading |
| qt | 5.15.2 | Qt is a cross-platform application development framework for desktop, embedded and mobile. | GUI |
| reproc | 13.0.1 | A cross-platform (C99/C++11) process library | Process |

## How do I build it ?

Expand Down
Loading

0 comments on commit 6871199

Please sign in to comment.