-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from JakeBecker/build-archives
Build archives
- Loading branch information
Showing
19 changed files
with
91 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
While you can develop ElixirLS on its own, it's easiest to test out changes if you clone the [vscode-elixir-ls](https://github.com/JakeBecker/vscode-elixir-ls) repository instead. It includes ElixirLS as a Git submodule, so you can make your changes in the submodule directory and launch the extension from the parent directory via the included "Launch Extension" configuration in `launch.json`. See the README on that repo for more details. | ||
|
||
### Building and running | ||
|
||
To build for release, run the `release.sh` script. It compiles these two apps to escripts in the `release` folder. If doing a public release, compile it with Erlang OTP 19, since OTP 20 builds are not backwards-compatible with earlier versions of Erlang. | ||
|
||
Elixir escripts typically embed Elixir, which is not what we want because users will want to run it against their own system Elixir installation. In order to support this, there are scripts in the `bin` folder that look for the system-wide Elixir installation and set the `ERL_LIBS` environment variable prior to running the escripts. These scripts are copied to the `release` folder by `release.sh`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
apps/debugger/lib/debugger/cli.ex → ...ugger/lib/mix.tasks.elixir_ls.debugger.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
defmodule ElixirLS.Debugger.CLI do | ||
defmodule Mix.Tasks.ElixirLs.Debugger do | ||
alias ElixirLS.Utils.WireProtocol | ||
alias ElixirLS.Debugger.{Output, Server} | ||
|
||
def main(_args) do | ||
def run(_args) do | ||
WireProtocol.intercept_output(&Output.print/1, &Output.print_err/1) | ||
|
||
Application.ensure_all_started(:debugger, :permanent) | ||
|
||
Mix.Local.append_archives | ||
Mix.Local.append_paths | ||
|
||
WireProtocol.stream_packets(&Server.receive_packet/1) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
defmodule Mix.Tasks.Release do | ||
@switches [destination: :string] | ||
@aliases [o: :destination] | ||
|
||
def run(args) do | ||
version_warning() | ||
{opts, _} = OptionParser.parse!(args, aliases: @aliases, switches: @switches) | ||
destination = opts[:destination] || "release" | ||
|
||
Path.join(destination, "*.ez") | ||
|> Path.wildcard() | ||
|> Enum.each(&File.rm(&1)) | ||
|
||
Mix.Task.run("archive.build.deps", [ | ||
"--skip", | ||
"mix_task_archive_deps", | ||
"--destination", | ||
destination | ||
]) | ||
end | ||
|
||
defp version_warning do | ||
{otp_version, _} = Integer.parse(to_string(:erlang.system_info(:otp_release))) | ||
|
||
if otp_version > 19 do | ||
IO.warn( | ||
"Building with Erlang/OTP #{otp_version}. Make sure to build with OTP 19 if " <> | ||
"publishing the compiled packages because modules built with higher versions are not " <> | ||
"backwards-compatible.", | ||
[] | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/language_server/lib/mix.tasks.elixir_ls.language_server.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule Mix.Tasks.ElixirLs.LanguageServer do | ||
alias ElixirLS.Utils.WireProtocol | ||
alias ElixirLS.LanguageServer.JsonRpc | ||
|
||
def run(_args) do | ||
WireProtocol.intercept_output(&JsonRpc.print/1, &JsonRpc.print_err/1) | ||
configure_logger() | ||
Application.ensure_all_started(:language_server, :permanent) | ||
Mix.shell(ElixirLS.LanguageServer.MixShell) | ||
WireProtocol.stream_packets(&JsonRpc.receive_packet/1) | ||
end | ||
|
||
defp configure_logger do | ||
use Mix.Config | ||
|
||
Mix.Config.persist(logger: [ | ||
handle_otp_reports: true, | ||
handle_sasl_reports: true, | ||
level: :warn, | ||
backends: [{ElixirLS.LanguageServer.LoggerBackend, :lsp_logger_backend}] | ||
]) | ||
|
||
logger = Process.whereis(Logger) | ||
if logger, do: Logger.App.stop() | ||
Logger.App.start() | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.