From b1754ca3a1bae83c32fc3306d5afc7649e321942 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Sat, 13 Jul 2019 14:07:29 +0700 Subject: [PATCH] chore: add build instructions --- .gitignore | 1 + README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++- native/Ben.pro | 2 +- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 349f6ef..319626a 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,7 @@ lib*.a # qt output /native/dist +/native/output # qpm /native/vendor \ No newline at end of file diff --git a/README.md b/README.md index a8740c7..fb5ccdb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,56 @@ # Ben [![Build Status](https://travis-ci.com/longseespace/ben.svg?branch=develop)](https://travis-ci.com/longseespace/ben) -Fast, native, cross-platform Slack client, written in [React QML][react-qml] +Fast, _native*_, cross-platform Slack client, develop with [React QML][react-qml] ![Screenshot](docs/screenshot.png?raw=true "Screenshot") +_*native in the sense that it's not another Electron app, nor using a webview_ + +## Features +- Fast: well, at least it's faster than the Electron Slack client +- Cross-platform: one codebase, deploy everywhere +- Hackable: the app is mainly in TypeScript, using front-end technologies (redux, react-redux, redux-persist etc.) +- Better developer experience: supports Hot Module Replacement, React Devtool, Redux Devtool + +## Build Instruction for macOS + +0. Setup environment: +- Install XCode 10 (with updated Command Line Tool `xcode-select --install`) +- Install Qt 5.10.1 + - **Note**: must be version 5.10.1 + - Install any additional Kits you wish to use (iOS, iOS Simulator, Android etc.) +- Install [qpm][qpm] +- Install NodeJS & yarn + +1. Front-end bundle: +```bash +# install deps +yarn install + +# build for macOS +yarn build +``` + +The JS bundle and app's assets should be available at `./native/dist` folder + +2. Native build: +```bash +cd native + +# install deps +qpm install + +# generate Makefile +mkdir -p output +qmake -o "output/" -spec macx-clang CONFIG+=x86_64 CONFIG+=release PRODUCTION=true "Ben.pro" + +# build +make -C "output/" -j7 all + +# generate dmg +macdeployqt "./output/Ben.app" -dmg -qmldir="." +``` + +You should find `Ben.app` and `Ben.dmg` in `output` folder + [react-qml]: https://github.com/longseespace/react-qml +[qpm]: https://www.qpm.io diff --git a/native/Ben.pro b/native/Ben.pro index ce4d0e8..e8c8ff5 100644 --- a/native/Ben.pro +++ b/native/Ben.pro @@ -2,7 +2,7 @@ include(vendor/vendor.pri) # mac -macx: { +macx { QT += macextras LIBS += -framework Cocoa }