Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better regularity between mlton and smlnj makefile process
- Loading branch information
1 parent
00de36c
commit 581ce23
Showing
7 changed files
with
102 additions
and
30 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 |
---|---|---|
|
@@ -7,5 +7,4 @@ Group is | |
src/posix-symlink.sml | ||
src/smackage-path.sml | ||
src/smacklib.sml | ||
src/configure.sml | ||
src/main.sml |
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 |
---|---|---|
|
@@ -7,5 +7,4 @@ Group is | |
src/posix-symlink.sml | ||
src/smackage-path.sml | ||
src/smacklib.sml | ||
src/configure.sml | ||
src/main.sml |
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
$(SML_LIB)/basis/basis.mlb | ||
(*src/posix-symlink.sml*) | ||
(*src/bullshit-symlink.sml*) | ||
|
||
src/semver.sml | ||
src/protocol.sml | ||
src/spec.sml | ||
src/install.sml | ||
src/version-index.sml | ||
src/get-git.sml | ||
src/get-http.sml | ||
src/conductor.sig | ||
src/conductor.sml | ||
(*src/smackage-path.sml*) | ||
(*src/smacklib.sml*) | ||
|
||
$(SML_LIB)/basis/basis.mlb | ||
util/sources.mlb | ||
|
||
(* Smackage data types *) | ||
src/protocol.sml | ||
src/semver.sml | ||
src/spec.sml | ||
|
||
(* Managing local data *) | ||
src/fsutil.sml | ||
src/version-index.sml | ||
src/configure.sml | ||
src/install.sml | ||
|
||
(* Obtaining and manipulating code and packages *) | ||
src/get-git.sml | ||
src/conductor.sig | ||
src/conductor.sml | ||
src/http-downloader.sig | ||
src/curl-lib.sml |
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,67 @@ | ||
|
||
structure FSUtil:> | ||
sig | ||
(* Run a system command, get the output, clean up. *) | ||
val systemStr: string -> string | ||
|
||
(* Get all the lines from a file. | ||
* Trims leading whitespace, trailing newlines, and #linecomments. *) | ||
val getLines: string -> string list | ||
|
||
(* Write lines to a file; adds newlines. *) | ||
val putLines: string list -> string -> unit | ||
end = | ||
struct | ||
fun systemStr cmd = | ||
let | ||
val tmpName = OS.FileSys.tmpName () | ||
val _ = OS.Process.system (cmd ^ " > " ^ tmpName) | ||
val tmp = TextIO.openIn tmpName | ||
val cleanup = fn () => OS.FileSys.remove tmpName | ||
in | ||
(TextIO.inputAll tmp before (TextIO.closeIn tmp; cleanup ())) | ||
handle exn => | ||
( (TextIO.closeIn tmp; cleanup ()) handle _ => () | ||
; raise exn) | ||
end | ||
|
||
fun trim s = | ||
let | ||
fun trimStart (#" "::t) = trimStart t | ||
| trimStart (#"\t"::t) = trimStart t | ||
| trimStart l = l | ||
|
||
fun trimEnd (#"#"::t) = [] | ||
| trimEnd (#"\n"::t) = [] | ||
| trimEnd (h::t) = h :: trimEnd t | ||
| trimEnd [] = [] | ||
in | ||
String.implode (trimEnd (trimStart (String.explode s))) | ||
end | ||
|
||
fun getLines' file accum = | ||
case TextIO.inputLine file of | ||
NONE => rev accum before TextIO.closeIn file | ||
| SOME s => getLines' file (trim s :: accum) | ||
|
||
fun getLines fileName = | ||
let val file = TextIO.openIn fileName | ||
in | ||
getLines' file [] | ||
handle exn => (TextIO.closeIn file handle _ => (); raise exn) | ||
end | ||
|
||
fun putLines' file lines = | ||
case lines of | ||
[] => TextIO.closeOut file | ||
| line :: lines => | ||
(TextIO.output (file, line ^ "\n"); putLines' file lines) | ||
|
||
fun putLines lines fileName = | ||
let val file = TextIO.openOut fileName | ||
in | ||
putLines' file [] | ||
handle exn => (TextIO.closeOut file handle _ => (); raise exn) | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
|
||
$(SML_LIB)/basis/basis.mlb | ||
sort.sml | ||
dict.sig | ||
dict-list.sml | ||
|