Lucas Stadler лет назад: 11
Родитель
Сommit
c2a8e6e600
3 измененных файлов с 19 добавлено и 0 удалено
  1. 16 0
      go/detect/detect.go
  2. 2 0
      go/examples/hello.idr
  3. 1 0
      go/examples/hello.jl

+ 16 - 0
go/detect/detect.go

31
		goDefault},
31
		goDefault},
32
	&Project{"haskell/cabal", Commands{"build": "cabal build", "run": "cabal run", "test": "cabal test"}, haskellCabal},
32
	&Project{"haskell/cabal", Commands{"build": "cabal build", "run": "cabal run", "test": "cabal test"}, haskellCabal},
33
	&Project{"haskell/default", Commands{"run": "runhaskell {file}"}, haskellDefault},
33
	&Project{"haskell/default", Commands{"run": "runhaskell {file}"}, haskellDefault},
34
	&Project{"idris/default", Commands{"run": "idris -o $(basename {file} .idr) {file} && ./$(basename {file} .idr)"},
35
		idrisDefault},
34
	&Project{"java/maven", Commands{"build": "mvn compile", "test": "mvn compile test"}, javaMaven},
36
	&Project{"java/maven", Commands{"build": "mvn compile", "test": "mvn compile test"}, javaMaven},
35
	&Project{"javascript/npm", Commands{"build": "npm install", "test": "npm test"}, javascriptNpm},
37
	&Project{"javascript/npm", Commands{"build": "npm install", "test": "npm test"}, javascriptNpm},
36
	&Project{"javascript/meteor", Commands{"run": "meteor"}, javascriptMeteor},
38
	&Project{"javascript/meteor", Commands{"run": "meteor"}, javascriptMeteor},
37
	&Project{"javascript/default", Commands{"run": "node {file}"}, javascriptDefault},
39
	&Project{"javascript/default", Commands{"run": "node {file}"}, javascriptDefault},
40
	&Project{"julia/default", Commands{"run": "julia {file}"}, juliaDefault},
38
	&Project{"python/django", Commands{"build": "python manage.py syncdb", "run": "python manage.py runserver",
41
	&Project{"python/django", Commands{"build": "python manage.py syncdb", "run": "python manage.py runserver",
39
		"test": "python manage.py test"}, pythonDjango},
42
		"test": "python manage.py test"}, pythonDjango},
40
	&Project{"python/default", Commands{"run": "python {file}"}, pythonDefault},
43
	&Project{"python/default", Commands{"run": "python {file}"}, pythonDefault},
44
	&Project{"ruby/default", Commands{"run": "ruby {file}"}, rubyDefault},
47
	&Project{"ruby/default", Commands{"run": "ruby {file}"}, rubyDefault},
45
	&Project{"rust/cargo", Commands{"build": "cargo build", "run": "cargo run", "test": "cargo test"}, rustCargo},
48
	&Project{"rust/cargo", Commands{"build": "cargo build", "run": "cargo run", "test": "cargo test"}, rustCargo},
46
	&Project{"rust/default", Commands{"run": "rustc {file} && ./$(basename {file} .rs)"}, rustDefault},
49
	&Project{"rust/default", Commands{"run": "rustc {file} && ./$(basename {file} .rs)"}, rustDefault},
50
	&Project{"cmake", Commands{"build": "mkdir .build && cd .build && cmake .. && make"}, cmakeDefault},
47
	&Project{"make", Commands{"run": "make", "test": "make test"}, makeDefault},
51
	&Project{"make", Commands{"run": "make", "test": "make test"}, makeDefault},
48
	&Project{"procfile", Commands{}, procfileDefault},
52
	&Project{"procfile", Commands{}, procfileDefault},
49
}
53
}
103
	return hasFile(file, "project.clj")
107
	return hasFile(file, "project.clj")
104
}
108
}
105
109
110
func cmakeDefault(file string) bool {
111
	return hasFile(file, "CMakeLists.txt")
112
}
113
106
func coffeescriptDefault(file string) bool {
114
func coffeescriptDefault(file string) bool {
107
	return matchingFileOrDir(file, "*.coffee")
115
	return matchingFileOrDir(file, "*.coffee")
108
}
116
}
131
	return matchingFileOrDir(file, "*.hs") || matchingFileOrDir(file, "*.lhs")
139
	return matchingFileOrDir(file, "*.hs") || matchingFileOrDir(file, "*.lhs")
132
}
140
}
133
141
142
func idrisDefault(file string) bool {
143
	return matchingFileOrDir(file, "*.idr")
144
}
145
134
func javaMaven(file string) bool {
146
func javaMaven(file string) bool {
135
	return hasFile(file, "pom.xml")
147
	return hasFile(file, "pom.xml")
136
}
148
}
147
	return matchingFileOrDir(file, "*.js")
159
	return matchingFileOrDir(file, "*.js")
148
}
160
}
149
161
162
func juliaDefault(file string) bool {
163
	return matchingFileOrDir(file, "*.jl")
164
}
165
150
func makeDefault(file string) bool {
166
func makeDefault(file string) bool {
151
	return hasFile(file, "Makefile")
167
	return hasFile(file, "Makefile")
152
}
168
}

+ 2 - 0
go/examples/hello.idr

1
main : IO ()
2
main = putStrLn "Hello, World!"

+ 1 - 0
go/examples/hello.jl

1
println("Hello, World!")