func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	fname := filepath.Base(files[0])

	stdout, stderr, err := cmd.Run(workDir, "kotlinc", fname)
	if err != nil {
		return stdout, stderr, err
	}

	return cmd.RunStdin(workDir, stdin, "kotlin", className(fname))
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])

	args := append([]string{"scalac"}, files...)
	stdout, stderr, err := cmd.Run(workDir, args...)
	if err != nil {
		return stdout, stderr, err
	}

	return cmd.RunStdin(workDir, stdin, "scala", "Main")
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	binName := "a.out"

	stdout, stderr, err := cmd.Run(workDir, "idris", "-o", binName, files[0])
	if err != nil {
		return stdout, stderr, err
	}

	binPath := filepath.Join(workDir, binName)
	return cmd.RunStdin(workDir, stdin, binPath)
}
Exemple #4
0
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	binName := "a.out"

	sourceFiles := util.FilterByExtension(files, "cpp")
	args := append([]string{"clang++", "-std=c++11", "-o", binName}, sourceFiles...)
	stdout, stderr, err := cmd.Run(workDir, args...)
	if err != nil {
		return stdout, stderr, err
	}

	binPath := filepath.Join(workDir, binName)
	return cmd.RunStdin(workDir, stdin, binPath)
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	binName := "a.exe"

	sourceFiles := reverse(util.FilterByExtension(files, "fs"))
	args := append([]string{"fsharpc", "--out:" + binName}, sourceFiles...)
	stdout, stderr, err := cmd.Run(workDir, args...)
	if err != nil {
		return stdout, stderr, err
	}

	binPath := filepath.Join(workDir, binName)
	return cmd.RunStdin(workDir, stdin, "mono", binPath)
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])

	// Compile all files except the first
	for _, file := range files[1:] {
		stdout, stderr, err := cmd.Run(workDir, "erlc", file)
		if err != nil {
			return stdout, stderr, err
		}
	}

	// Run first file with escript
	return cmd.RunStdin(workDir, stdin, "escript", files[0])
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	jsName := "a.js"

	// Find all typescript files and build compile command
	sourceFiles := util.FilterByExtension(files, "ts")
	args := append([]string{"tsc", "-out", jsName}, sourceFiles...)

	// Compile to javascript
	stdout, stderr, err := cmd.Run(workDir, args...)
	if err != nil {
		return stdout, stderr, err
	}

	return cmd.RunStdin(workDir, stdin, "node", jsName)
}
Exemple #8
0
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])

	// Move bootstrap files into work dir
	stdout, stderr, err := cmd.RunBash(workDir, "cp -rf /bootstrap/* .")
	if err != nil {
		return stdout, stderr, err
	}

	// Compile elm to javascript
	stdout, stderr, err = cmd.Run(workDir, "elm-make", files[0], "--output", "elm.js")
	if err != nil {
		return stdout, stderr, err
	}

	// Run javascript with node via app.js from bootstrap
	return cmd.RunStdin(workDir, stdin, "node", "app.js")
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	objName := "a.o"
	binName := "a.out"

	stdout, stderr, err := cmd.Run(workDir, "nasm", "-f", "elf64", "-o", objName, files[0])
	if err != nil {
		return stdout, stderr, err
	}

	stdout, stderr, err = cmd.Run(workDir, "ld", "-o", binName, objName)
	if err != nil {
		return stdout, stderr, err
	}

	binPath := filepath.Join(workDir, binName)
	return cmd.RunStdin(workDir, stdin, binPath)
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	sourceFiles := util.FilterByExtension(files, "ex")
	args := append([]string{"elixirc"}, sourceFiles...)
	return cmd.RunStdin(workDir, stdin, args...)
}
Exemple #11
0
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	return cmd.RunStdin(workDir, stdin, "ruby", files[0])
}
Exemple #12
0
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	return cmd.RunStdin(workDir, stdin, "nim", "--hints:off", "--verbosity:0", "compile", "--run", files[0])
}
func Run(files []string, stdin string) (string, string, error) {
	workDir := filepath.Dir(files[0])
	return cmd.RunStdin(workDir, stdin, "java", "-cp", "/usr/share/java/clojure.jar", "clojure.main", files[0])
}