forked from hound-search/hound
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tools to make local building easier.
- Added the Makefile and Sublime Text project file that I use. - Created a tool to symlink the tools and copy a working config. - Updated the README to use this setup exclusively.
- Loading branch information
Showing
7 changed files
with
130 additions
and
80 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,5 +1,4 @@ | ||
.vagrant | ||
.build | ||
config.json* | ||
.DS_Store | ||
*.exe |
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,21 @@ | ||
ALL: commands | ||
|
||
ASSETS=$(shell find src/github.com/etsy/Hound/ui/assets) | ||
|
||
bin/go-bindata: | ||
GOPATH=$(shell pwd) go get github.com/jteeuwen/go-bindata/... | ||
|
||
src/github.com/etsy/Hound/ui/bindata.go: bin/go-bindata $(ASSETS) | ||
mkdir -p build/ui | ||
rsync -r --exclude '*.js' src/github.com/etsy/Hound/ui/assets/* build/ui | ||
jsx --no-cache-dir src/github.com/etsy/Hound/ui/assets/js build/ui/js | ||
$< -o $@ -pkg ui -prefix build/ui -nomemcopy build/ui/... | ||
|
||
commands: src/github.com/etsy/Hound/ui/bindata.go | ||
GOPATH=$(shell pwd) go install github.com/etsy/hound/cmds/... | ||
|
||
clean: | ||
rm -rf bin/hound bin/houndd build | ||
|
||
test: | ||
GOPATH=$(shell pwd) go test github.com/etsy/hound/... |
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,8 @@ | ||
{ | ||
"dbpath" : "data", | ||
"repos" : { | ||
"Hound" : { | ||
"url" : "https://www.github.com/etsy/Hound.git" | ||
} | ||
} | ||
} |
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,40 @@ | ||
#!/usr/bin/env python2.7 | ||
|
||
import os | ||
import shutil | ||
import sys | ||
|
||
def get_tools_directory(): | ||
""" get the location of the Hound tools directory """ | ||
return os.path.realpath(os.path.dirname(__file__)) | ||
|
||
def has_valid_location(tools): | ||
""" ensure that the repository is in the GOPATH """ | ||
parts = [x.lower() for x in tools.split(os.sep)] | ||
return parts[-5:-1] == ['src', 'github.com', 'etsy', 'hound'] | ||
|
||
def process(src, dst, filenames, op): | ||
""" process the filenames from source and use op to produce them in dst """ | ||
for filename in filenames: | ||
target = os.path.join(dst, filename) | ||
if os.path.exists(target): | ||
continue | ||
op(os.path.join(src, filename), target) | ||
|
||
def main(): | ||
tools = get_tools_directory() | ||
if not has_valid_location(tools): | ||
print >> sys.stderr, "The Hound repository should be in a directory like:" | ||
print >> sys.stderr, "src/github.com/etsy/Hound" | ||
print >> sys.stderr, "" | ||
print >> sys.stderr, "Follow the directions at https://github.com/etsy/Hound#editing--building" | ||
return 1 | ||
work = os.path.join(tools, '..', '..', '..', '..', '..') | ||
|
||
process(tools, work, ['Makefile', 'hound.sublime-project'], os.symlink) | ||
process(tools, work, ['config.json'], shutil.copy) | ||
|
||
return 0 | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
Oops, something went wrong.