Commit b64f1580 authored by Drew's avatar Drew

Merge pull request #61 from AnarchyTools/incremental_compiles

Support incremental compiles
parents 542d6286 42e72cde
Pipeline #1130 passed with stage
...@@ -21,6 +21,8 @@ import attools ...@@ -21,6 +21,8 @@ import attools
enum Options: String { enum Options: String {
case Overlay = "--use-overlay" case Overlay = "--use-overlay"
case CustomFile = "-f" case CustomFile = "-f"
case Help = "--help"
case Clean = "--clean"
static var allOptions : [Options] { return [Overlay, CustomFile] } static var allOptions : [Options] { return [Overlay, CustomFile] }
} }
...@@ -55,7 +57,7 @@ if Process.arguments.contains("--help") { ...@@ -55,7 +57,7 @@ if Process.arguments.contains("--help") {
print("© 2016 Anarchy Tools Contributors.") print("© 2016 Anarchy Tools Contributors.")
print("") print("")
print("Usage:") print("Usage:")
print("atbuild [-f packagefile] [task]") print("atbuild [-f packagefile] [task] [--clean]")
let package = loadPackageFile() let package = loadPackageFile()
print("tasks:") print("tasks:")
......
...@@ -265,10 +265,14 @@ final class ATllbuild : Tool { ...@@ -265,10 +265,14 @@ final class ATllbuild : Tool {
//We just want to create a state where .atllbuild/objects and .atllbuild/llbuildtmp and .atllbuild/products exists. //We just want to create a state where .atllbuild/objects and .atllbuild/llbuildtmp and .atllbuild/products exists.
//and in particular, without erasing the product directory, since that accumulates build products across //and in particular, without erasing the product directory, since that accumulates build products across
//multiple invocations of atllbuild. //multiple invocations of atllbuild.
let _ = try? manager.removeItemAtPath(workDirectory + "/objects") if Process.arguments.contains("--clean") {
let _ = try? manager.removeItemAtPath(workDirectory + "/llbuildtmp") let _ = try? manager.removeItemAtPath(workDirectory + "/objects")
let _ = try? manager.removeItemAtPath(workDirectory + "/llbuildtmp")
}
let _ = try? manager.removeItemAtPath(workDirectory + "/include") let _ = try? manager.removeItemAtPath(workDirectory + "/include")
let _ = try? manager.createDirectoryAtPath(workDirectory, withIntermediateDirectories: false, attributes: nil) let _ = try? manager.createDirectoryAtPath(workDirectory, withIntermediateDirectories: false, attributes: nil)
let _ = try? manager.createDirectoryAtPath(workDirectory + "/products", withIntermediateDirectories: false, attributes: nil) let _ = try? manager.createDirectoryAtPath(workDirectory + "/products", withIntermediateDirectories: false, attributes: nil)
let _ = try? manager.createDirectoryAtPath(workDirectory + "/objects", withIntermediateDirectories: false, attributes: nil) let _ = try? manager.createDirectoryAtPath(workDirectory + "/objects", withIntermediateDirectories: false, attributes: nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment