Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install: |
esac
export PATH=/tmp/llvm-3.5.0-1/bin:$PATH
export CRYSTAL_CONFIG_VERSION=ci
export CRYSTAL_CACHE_DIR=/tmp/crystal
script:
- make crystal spec
- find samples -name "*.cr" | xargs -L 1 ./bin/crystal build --no-build
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/crystal/command.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Crystal
def self.tempfile(basename)
Dir.mkdir_p ".crystal"
".crystal/crystal-run-#{basename}.tmp"
Dir.mkdir_p Config.cache_dir
File.join(Config.cache_dir, "crystal-run-#{basename}.tmp")
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/compiler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module Crystal
if @cross_compile_flags
output_dir = "."
else
output_dir = ".crystal/#{sources.first.filename}"
output_dir = File.join(Config.cache_dir, sources.first.filename)
end

Dir.mkdir_p(output_dir)
Expand Down
5 changes: 5 additions & 0 deletions src/compiler/crystal/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ module Crystal
module Config
PATH = {{ env("CRYSTAL_CONFIG_PATH") || "" }}
VERSION = {{ env("CRYSTAL_CONFIG_VERSION") || `(git describe --tags --long 2>/dev/null)`.stringify.chomp }}
CACHE_DIR = ENV["CRYSTAL_CACHE_DIR"]? || ".crystal"

def self.cache_dir
@@cache_dir ||= File.expand_path(CACHE_DIR)
end
end
end