Skip to content

Commit

Permalink
Allow building compiler without 'playground', to avoid dependency on …
Browse files Browse the repository at this point in the history
…sockets (#9031)

This would, for example, be useful to bootstrap the compiler on Windows before having a "socket" implementation.
  • Loading branch information
oprypin authored Apr 10, 2020
1 parent f3c8f31 commit f85bdb2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/compiler/crystal/command.cr
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ class Crystal::Command
result
when "play".starts_with?(command)
options.shift
playground
{% if flag?(:without_playground) %}
puts "Crystal was compiled without playground support"
exit 1
{% else %}
playground
{% end %}
when "deps".starts_with?(command)
STDERR.puts "Please use 'shards': 'crystal deps' has been removed"
exit 1
Expand Down
1 change: 0 additions & 1 deletion src/compiler/crystal/compiler.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require "option_parser"
require "file_utils"
require "socket"
require "colorize"
require "digest/md5"

Expand Down
2 changes: 2 additions & 0 deletions src/compiler/crystal/tools/playground/agent.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file if flag?(:without_playground) %}

require "http"
require "json"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file if flag?(:without_playground) %}

module Crystal
class Playground::AgentInstrumentorTransformer < Transformer
class MacroDefNameCollector < Visitor
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/crystal/tools/playground/server.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file if flag?(:without_playground) %}

require "http/server"
require "log"
require "ecr/macros"
Expand Down

0 comments on commit f85bdb2

Please sign in to comment.