Skip to content
Permalink
Browse files

Add support for Clojure with Leiningen (#522)

  • Loading branch information...
rads authored and tj committed Jan 1, 2018
1 parent c9844a3 commit 9119743743db586968effd06d43996daa3bb3c91
Showing with 19 additions and 1 deletion.
  1. +18 −0 config.go
  2. +1 −1 internal/zip/zip.go
@@ -206,6 +206,8 @@ func (c *Config) inferRuntime() error {
javaMaven(c)
case util.Exists("build.gradle"):
javaGradle(c)
case util.Exists("project.clj"):
clojureLein(c)
case util.Exists("main.cr"):
crystal(c)
case util.Exists("package.json"):
@@ -344,6 +346,22 @@ func javaMaven(c *Config) {
}
}

// clojure lein config.
func clojureLein(c *Config) {
if c.Proxy.Command == "" {
c.Proxy.Command = "java -jar server.jar"
}

if c.Hooks.Build.IsEmpty() {
// assumes package results in a shaded jar named server.jar
c.Hooks.Build = config.Hook{`lein uberjar && cp target/*-standalone.jar server.jar`}
}

if c.Hooks.Clean.IsEmpty() {
c.Hooks.Clean = config.Hook{`lein clean && rm server.jar`}
}
}

// crystal config.
func crystal(c *Config) {
if c.Hooks.Build.IsEmpty() {
@@ -44,7 +44,7 @@ func Build(dir string) (io.ReadCloser, *archive.Stats, error) {
gitignore,
strings.NewReader("\n!node_modules/**\n!.pypath/**\n"),
upignore,
strings.NewReader("\n!main\n!server\n!_proxy.js\n!byline.js\n!up.json\n!pom.xml\n!build.gradle\n"))
strings.NewReader("\n!main\n!server\n!_proxy.js\n!byline.js\n!up.json\n!pom.xml\n!build.gradle\n!project.clj\n"))

filter, err := archive.FilterPatterns(r)
if err != nil {

0 comments on commit 9119743

Please sign in to comment.
You can’t perform that action at this time.