diff --git a/DEVELOP.md b/DEVELOP.md new file mode 100644 index 00000000..ce41b37c --- /dev/null +++ b/DEVELOP.md @@ -0,0 +1,86 @@ +## How to develop + +### No change in NvimServer + +If you did not change NvimServer, i.e. NvimServer, NvimServerTypes, and neovim, +then, do the following to run VimR: + +* `./bin/download_nvimserver.sh` +* Run VimR scheme in Xcode + +A development version of VimR will be built and run, +i.e. the bundle identifier will be `com.qvacua.VimR.dev` and the name of the app will be `VimR-dev`. +If you want to build a development version as a release build, then use the following: + +```bash +clean=true ./bin/build_vimr_dev.sh +``` + +### Changes in NvimServer + +Since SwiftPM does not support a script phase, we have to copy some files manually, +e.g. `NvimServer` binary. +This can be done with the following: + +```bash +build_libnvim=true clean=true download_gettext=true ./bin/build_nvimserver_for_local_dev.sh +``` + +Set `download_gettext` to true when you are building NvimServer locally for the first time. +See the `build_nvimserver_for_local_dev` script for default values of the env vars. +You can also use a watch script as follows (it uses `entr`): + +```bash +clean_initial_build=true ./bin/watch_nvimserver_and_build +``` + +When `clean_initial_build` is `true`, the script will download `gettext`, clean, and build, +then continuously invoke the `build_nvimserver_for_local_dev` script. + +## How to release + +### NvimServer + +#### Dependencies + +* Tag with the name `nvimserver-deps-yyyy-mm-dd`. GitHub actions will build the `x86_64` version, + create a release and upload it. +* Build the `arm64` version locally (on an Apple Silicon machine since I could not find out + how to cross-compile `libnvim`) and upload it. +* Update `NvimServer/Resources/nvimserver-deps-for-download.txt` and push. + +#### Executable + +* Tag with the name `nvimserver-x.y.z-n`. GitHub actions will build the `x86_64` version, + create a release and upload it. +* Build the `arm64` version locally and upload it. + +### VimR + +#### Dependencies + +* Tag with the name `vimr-deps-yyyy-mm-dd`. GitHub actions will build the universal version, + create a release and upload it. +* Update `resources/vimr-deps_version.txt` and push. + +#### Executable + +* Set a new version of VimR via + ```bash + is_snapshot=true ./bin/set_new_versions.sh + ``` + and commit. This will print out some environment variables you can use when invoking the + `build_release.sh` script later. +* Tag with the name + - Snapshot: `snapshot/yyyymmdd.HHMMSS` + - Release: `vX.Y.Z` +* Push, create a release and add release notes. +* Build, package and upload via + ```bash + is_snapshot=true \ + bundle_version=20211212.213543 tag=snapshot/20211212.213543 marketing_version=SNAPSHOT-20211212.213543 \ + upload=true update_appcast=true \ + ./bin/build_release.sh + ``` +* The `appcast{-snapshot}.xml` file is modified. Check and push. + diff --git a/README.md b/README.md index 12b64672..ae9c8f4e 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,17 @@ The goal is to build an editor that uses Neovim inside with many of the convenie GUI features similar to those present in modern editors. We mainly use Swift, but also use C/Objective-C when where appropriate. -There are other Neovim GUIs for macOS, e.g. [NyaoVim](https://github.com/rhysd/NyaoVim), [neovim-dot-app](https://github.com/rogual/neovim-dot-app), [Oni](https://www.onivim.io), etc., so why? +There are other Neovim GUIs for macOS, see the [list](https://github.com/neovim/neovim/wiki/Related-projects#gui), so why? - Play around with [Neovim](https://github.com/qvacua/neovim), - play around with Swift (and especially with [RxSwift](https://github.com/ReactiveX/RxSwift)), and - (most importantly) have fun! -If you want to support VimR financially, use [Github's Sponsor](https://github.com/sponsors/qvacua) -or [Bountysource](https://www.bountysource.com/teams/vimr). +If you want to support VimR financially, use [Github's Sponsor](https://github.com/sponsors/qvacua). ## Download -Pre-built binaries can be found under [Releases](https://github.com/qvacua/vimr/releases). +Pre-built Universal signed and notarized binaries can be found under [Releases](https://github.com/qvacua/vimr/releases). ## Reusable Components @@ -45,45 +44,21 @@ Pre-built binaries can be found under [Releases](https://github.com/qvacua/vimr/ ## How to Build -First after cloning the VimR source tree you need to initialize git submodules - -```bash -git lfs install -git submodule update --init -``` - -First install `homebrew`, then in the project root: +Clone this repository. Install `homebrew`, then in the project root: ```bash xcode-select --install # install the Xcode command line tools, if you haven't already brew bundle -code_sign=false use_carthage_cache=false ./bin/build_vimr.sh # VimR.app will be placed in build/Build/Products/Release/ +code_sign=false use_carthage_cache=false download_deps=true ./bin/build_vimr.sh +# VimR.app will be placed in ./build/Build/Products/Release/ ``` -## Project Setup +## Development -### Artifacts Hierarchy - -``` -VimR.app -+-- NvimView.framework -    +-- NvimServer -       +-- libnvim -       +-- other libs for Neovim -    +-- NvimView - +-- NvimServer binary (copied by the build script) -    +-- runtime files for Neovim (copied by the build script) -``` - -### How to develop - -See [DEVELOP.md](docs/develop.md). +See [DEVELOP.md](DEVELOP.md). ## License [MIT](https://github.com/qvacua/vimr/blob/master/LICENSE) ---- - -If you are here for VimR-MacVim, use the [macvim/master](https://github.com/qvacua/vimr/tree/macvim/master) branch and the version [0.8.0 (32)](https://github.com/qvacua/vimr/releases/tag/v0.8.0-32). diff --git a/bin/build_release.sh b/bin/build_release.sh index 201bec36..17260026 100755 --- a/bin/build_release.sh +++ b/bin/build_release.sh @@ -97,10 +97,10 @@ main() { if [[ "${upload}" == true ]]; then upload_artifact - fi - if [[ "${update_appcast}" == true ]]; then - update_appcast_file + if [[ "${update_appcast}" == true ]]; then + update_appcast_file + fi fi popd >/dev/null } diff --git a/bin/set_new_versions.sh b/bin/set_new_versions.sh index a5561ca2..80154c01 100755 --- a/bin/set_new_versions.sh +++ b/bin/set_new_versions.sh @@ -7,6 +7,12 @@ marketing_version=${marketing_version:-""} main() { if [[ "${is_snapshot}" == false && -z "${marketing_version}" ]]; then echo "When no snapshot, you have to set 'marketing_version', eg 0.38.1" + + if [[ "${marketing_version}" =~ ^v.* ]]; then + echo "### marketing_version must not begin with v!" + exit 1 + fi + exit 1 fi @@ -29,6 +35,14 @@ main() { popd >/dev/null echo "### Set versions of VimR" + + local tag + if [[ "${is_snapshot}" == true ]]; then + tag="tag=snapshot/${bundle_version}" + else + tag="tag=v${marketing_version}" + fi + echo "bundle_version=${bundle_version} marketing_version=${marketing_version} tag=${tag}" } main diff --git a/docs/develop.md b/docs/develop.md deleted file mode 100644 index 355b39fc..00000000 --- a/docs/develop.md +++ /dev/null @@ -1,70 +0,0 @@ -## How to develop - -### No change in NvimServer - -If you did not change code in NvimServer, i.e. NvimServer, NvimServerTypes, and neovim, -then, do the following to run VimR: - -* `./bin/download_nvimserver.sh` -* Run VimR scheme in Xcode - -A development version of VimR will be built and run, -i.e. the bundle identifier will be `com.qvacua.VimR.dev` and the name of the app will be `VimR-dev`. -If you want to build a development version as a release build, then use the following: - -```bash -clean=true ./bin/build_vimr_dev.sh -``` - -### Changes in NvimServer - -Since SwiftPM does not support a script phase, we have to copy some files manually, -e.g. `NvimServer` binary. -This can be done with the following: - -```bash -build_libnvim=true clean=true download_gettext=true ./bin/build_nvimserver_for_local_dev.sh -``` - -Set `download_gettext` to true when you are building NvimServer locally for the first time. -See the `build_nvimserver_for_local_dev` script for default values of the env vars. -You can also use a watch script as follows: - -```bash -clean_initial_build=true ./bin/watch_nvimserver_and_build -``` - -When `clean_initial_build` is `true`, the script will download `gettext`, clean, and build, -then continuously invoke the `build_nvimserver_for_local_dev` script. - -## How to release - -* Tag NvimServer: Travis will create a Github release, build, - and upload `gettext` and `NvimServer` for `x86_64`. -* Build `gettext` and `NvimServer` on an `arm64` Mac - and upload them to the release from the last step. -* Set a new version of VimR via - ``` - is_snapshot=true ./bin/set_new_versions.sh - ``` -* Push and and build using - ``` - code_sign=true use_carthage_cache=false ./bin/build_vimr.sh - ``` -* Notarize using - ``` - vimr_app_path=./build/Build/Products/Release/VimR.app ./bin/notarize_vimr.sh - ``` -* Create a Github release, add release notes, and upload VimR archived by - ``` - cd ./build/Build/Products/Release - tar cjf VimR-SNAPSHOT-20201210.181940.tar.bz2 VimR.app - ``` -* Update `appcast` file, e.g. - ``` - cd ./build/Build/Products/Release - ./bin/set_appcast.py "${vimr_file}" "${bundle_version}" "${marketing_version}" "${tag}" "${is_snapshot}" - cp appcast_snapshot.xml "${project_root}" - ``` - -*TODO*: Automate this again.