Skip to content

Commit

Permalink
Updated docs / release task
Browse files Browse the repository at this point in the history
  • Loading branch information
scohen committed Aug 10, 2023
1 parent 3c14687 commit f8e35cd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 47 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
tags:
- v*
env:
NAMESPACE: 1

jobs:
release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -42,11 +39,11 @@ jobs:
run: mix compile

- name: Build release
run: mix release lexical
run: mix package

- name: Archive release
run: |
cd _build/dev/rel/lexical
cd _build/dev/package/lexical
zip -r lexical.zip *
cp lexical.zip ../../../../lexical.zip
cp lexical.zip ../../../../lexical-${{ github.ref_name }}.zip
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ faster.
Follow the [Detailed Installation Instructions](pages/installation.md)

```
NAMESPACE=1 mix release lexical --overwrite
mix package
```

Lexical will now be available in `_build/dev/rel/lexical`
Lexical will now be available in `_build/dev/package/lexical`

If you would like to change the output directory, you can do so with the `--path` option

```
mix package --path /path/to/output
```
32 changes: 0 additions & 32 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ defmodule Lexical.LanguageServer.MixProject do

defp releases do
[
lexical: [
applications: [
server: :permanent,
remote_control: :load,
mix: :load
],
include_executables_for: [:unix],
include_erts: false,
cookie: "lexical",
rel_templates_path: "rel/deploy",
strip_beams: false,
steps: release_steps()
],
lexical_debug: [
applications: [
server: :permanent,
Expand All @@ -82,29 +69,10 @@ defmodule Lexical.LanguageServer.MixProject do
cookie: "lexical",
rel_templates_path: "rel/debug",
strip_beams: false
],
remote_control: [
applications: [remote_control: :permanent],
include_erts: false,
include_executables_for: [],
strip_beams: false
]
]
end

defp release_steps do
if System.get_env("NAMESPACE") do
[:assemble, &namespace_release/1]
else
[:assemble]
end
end

defp namespace_release(%Mix.Release{} = release) do
Mix.Task.run("namespace", [release.path])
release
end

defp aliases do
[
compile: "compile --docs --debug-info",
Expand Down
16 changes: 8 additions & 8 deletions pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Lexical supports the following versions of Elixir and Erlang:
| 1.15 | `>= 1.15.3` | `1.15.0` - `1.15.2` had compiler bugs that prevented lexical from working |

Lexical can run projects in any version of Elixir and Erlang that it supports, but it's important to understand that Lexical needs to be compiled under the lowest version of elixir and erlang that you intend to use it with. That means if you have the following projects:

* `first`: elixir `1.14.4` erlang `24.3.2`
* `second`: elixir `1.14.3` erlang `25.0`
* `third`: elixir: `1.13.3` erlang `25.2.3`

Lexical would need to be compiled with Erlang `24.3.2` and Elixir `1.13.3`.
Lexical would need to be compiled with Erlang `24.3.2` and Elixir `1.13.3`.
Lexical's prepackaged builds use Erlang `24.3.4.12` and Elixir `1.13.4`

## Prerequisites
Expand All @@ -46,11 +46,11 @@ cd lexical
...and build the project

```shell
NAMESPACE=1 mix release lexical --overwrite
mix package
```

If things complete successfully, you will then have a release in your
`build/dev/rel/lexical` directory. If you see errors, please file a
`_build/dev/package/lexical` directory. If you see errors, please file a
bug.

For the following examples, assume the absolute path to your Lexical
Expand Down Expand Up @@ -80,7 +80,7 @@ emacs configuration), insert the following code:
(use-package elixir-mode
:ensure t
:custom
(lsp-elixir-server-command '("/my/home/projects/_build/dev/rel/lexical/start_lexical.sh")))
(lsp-elixir-server-command '("/my/home/projects/_build/dev/package/lexical/lexical.sh")))
```

Expand All @@ -101,12 +101,12 @@ Click on the extensions button on the sidebar, then search for
download the latest version of Lexical.

To change to a local executable, go to `Settings -> Extensions -> Lexical` and
type `/my/home/projects/lexical/_build/dev/rel/lexical` into the text box in
type `/my/home/projects/lexical/_build/dev/package/lexical` into the text box in
the `Server: Release path override` section.

## neovim

Lexical doesn't work in neovim `< 0.9.0`.
Lexical requires neovim `>= 0.9.0`.

In version `>= 0.9.0`, the key is to append the custom LS configuration to [lspconfig](https://github.com/neovim/nvim-lspconfig), so regardless of whether you are using mason or others, you can use this configuration below as a reference:

Expand All @@ -116,7 +116,7 @@ In version `>= 0.9.0`, the key is to append the custom LS configuration to [lspc

local lexical_config = {
filetypes = { "elixir", "eelixir", },
cmd = { "/my/home/projects/_build/dev/rel/lexical/start_lexical.sh" },
cmd = { "/my/home/projects/_build/dev/package/lexical/lexical.sh" },
settings = {},
}

Expand Down

0 comments on commit f8e35cd

Please sign in to comment.