Commit b2ba7bbe authored by Drew's avatar Drew

Implement configurations

This implements, more or less, the scaffolding described in #36.  This commit does not actually make tools behave differently in any configuration (so this is mostly a placebo) but after this, tools can adjust their behavior.

Notable additions/departures from the original proposal include:

* Support for "custom" configurations outside the built-in set
* The addition of `test` and `bench` as built-in configurations, since 2/2 developers use them
* Internal API has new "helper" methods for common "tool questions" (should we optimize, are we testing, etc.)  Ideally, custom configurations could indicate their own values for these questions, although that's outside the scope of this patch.

Doc PR to follow.
parent 9c1beb20
Pipeline #1975 passed with stage
......@@ -34,6 +34,7 @@ enum Options: String {
case Clean = "--clean"
case Toolchain = "--toolchain"
case Platform = "--platform"
case Configuration = "--configuration"
static var allOptions : [Options] { return [
Overlay,
......@@ -41,7 +42,8 @@ enum Options: String {
Help,
Clean,
Toolchain,
Platform
Platform,
Configuration
]
}
}
......@@ -66,6 +68,10 @@ for (i, x) in Process.arguments.enumerated() {
let platformString = Process.arguments[i+1]
Platform.targetPlatform = Platform(string: platformString)
}
if x == Options.Configuration.rawValue {
let configurationString = Process.arguments[i+1]
currentConfiguration = Configuration(string: configurationString)
}
}
//build overlays
......@@ -78,6 +84,8 @@ for (i, x) in Process.arguments.enumerated() {
}
overlays.append(contentsOf: Platform.targetPlatform.overlays)
overlays.append("atbuild.configuration.\(currentConfiguration)")
print("enabling overlays \(overlays)")
var package: Package! = nil
......
Subproject commit 8bc9044e61abefc16fce80fbd8f442e4d26a6fe8
Subproject commit c117fd19c1dd192410124b0256b82665512ef645
// Copyright (c) 2016 Anarchy Tools Contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
public enum Configuration {
///Built-in configurations
///The default configuration.
///Choose settings suitable for interactive debugging, like O0, -g, etc.
///Generally, operations that slow down compile times should be avoided.
case Debug
///A configuration appropriate for distribution.
///Choose settings suitable for final, production-quality software.
case Release
///A configuration appropriate for unit (correctness) tests.
case Test
///A configuration appropriate for performance-sensitive tests or benchmarks
case Benchmark
///A "plain" or "no-magic" configuration
///Do not assume anything about the user's intent
///Provide only default behavior
case None
///Like "None", but with a custom name.
case User(String)
public init(string: String) {
if string == "debug" { self = .Debug }
else if string == "release" { self = .Release }
else if string == "test" { self = .Test }
else if string == "bench" { self = .Benchmark }
else if string == "none" { self = .None }
else {self = .User(string)}
}
}
extension Configuration:CustomStringConvertible {
public var description: String {
switch(self) {
case .Debug: return "debug"
case .Release: return "release"
case .Test: return "test"
case .Benchmark: return "benchmark"
case .None: return "none"
case .User(let str): return str
}
}
}
/// The default configuration is Debug
///- warning: Switching on this value directly is discouraged; instead switch on one of its ivars.
public var currentConfiguration = Configuration.Debug
///Helper configuration options
///The following options may be more convenient than working with configurations directly
extension Configuration {
///Whether tools should produce optimized software
var optimize: Bool? {
switch(self) {
case .Benchmark, .Release: return true
case .Debug, .Test: return false
case .User, .None: return nil
}
}
///Whether tools should prefer compile speed over compile quality
var fastCompile: Bool? {
switch(self) {
case .Debug, .Test: return true
case .Release, .Benchmark: return false
case .User, .None: return nil
}
}
///Whether tools should compile "for testing".
///This value is appropriate for deciding whether to compile tests at all, or whether `-enable-testing` should be used
var testingEnabled: Bool? {
switch(self) {
case .Benchmark, .Test: return true
case .Debug, .Release: return false
case .User, .None: return nil
}
}
///Whether tools are explicitly asked to compile "without magic"
var noMagic: Bool? {
switch(self) {
case .Debug, .Release, .Benchmark, .Test: return false
case .None: return true
case .User: return nil
}
}
}
\ No newline at end of file
......@@ -28,6 +28,10 @@ import atpkg
*/
final class Shell : Tool {
static private func mysetEnv(_ key: String, _ val: String) {
setenv(key,val,1)
}
///Sets the environment for the specified task.
static func environvironment(task: Task, block: () -> ()) {
setenv("ATBUILD_PLATFORM", "\(Platform.targetPlatform)", 1)
......@@ -36,6 +40,20 @@ final class Shell : Tool {
setenv("ATBUILD_PACKAGE_VERSION", version, 1)
}
setenv("ATBUILD_CONFIGURATION", "\(currentConfiguration)",1)
if let o = currentConfiguration.optimize {
mysetEnv("ATBUILD_CONFIGURATION_OPTIMIZE", o ? "1":"0")
}
if let o = currentConfiguration.fastCompile {
mysetEnv("ATBUILD_CONFIGURATION_FAST_COMPILE", o ? "1":"0")
}
if let o = currentConfiguration.testingEnabled {
mysetEnv("ATBUILD_CONFIGURATION_TESTING_ENABLED", o ? "1":"0")
}
if let o = currentConfiguration.noMagic {
mysetEnv("ATBUILD_CONFIGURATION_NO_MAGIC", o ? "1":"0")
}
//does bin path not exist?
//let's create it!
let binPath = try! FS.getWorkingDirectory().appending("bin")
......
......@@ -14,6 +14,8 @@ commands:
sources: ["atpkg/atfoundation/src/charset.swift", "atpkg/atfoundation/src/date/date.swift", "atpkg/atfoundation/src/date/timeinterval.swift", "atpkg/atfoundation/src/filesystem/file.swift", "atpkg/atfoundation/src/filesystem/fileinfo.swift", "atpkg/atfoundation/src/filesystem/fs.swift", "atpkg/atfoundation/src/filesystem/path.swift", "atpkg/atfoundation/src/logger.swift", "atpkg/atfoundation/src/string/replace.swift", "atpkg/atfoundation/src/string/search.swift", "atpkg/atfoundation/src/string/split.swift", "atpkg/atfoundation/src/string/substring.swift", "atpkg/atfoundation/src/string/whitespace.swift", "atpkg/atfoundation/src/string.swift", "atpkg/atfoundation/src/syserror.swift", "atpkg/atfoundation/src/tools.swift", "atpkg/atfoundation/src/url.swift"]
objects: [".atllbuild/objects/charset.swift.o", ".atllbuild/objects/date.swift.o", ".atllbuild/objects/timeinterval.swift.o", ".atllbuild/objects/file.swift.o", ".atllbuild/objects/fileinfo.swift.o", ".atllbuild/objects/fs.swift.o", ".atllbuild/objects/path.swift.o", ".atllbuild/objects/logger.swift.o", ".atllbuild/objects/replace.swift.o", ".atllbuild/objects/search.swift.o", ".atllbuild/objects/split.swift.o", ".atllbuild/objects/substring.swift.o", ".atllbuild/objects/whitespace.swift.o", ".atllbuild/objects/string.swift.o", ".atllbuild/objects/syserror.swift.o", ".atllbuild/objects/tools.swift.o", ".atllbuild/objects/url.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/charset.swift.o", ".atllbuild/objects/date.swift.o", ".atllbuild/objects/timeinterval.swift.o", ".atllbuild/objects/file.swift.o", ".atllbuild/objects/fileinfo.swift.o", ".atllbuild/objects/fs.swift.o", ".atllbuild/objects/path.swift.o", ".atllbuild/objects/logger.swift.o", ".atllbuild/objects/replace.swift.o", ".atllbuild/objects/search.swift.o", ".atllbuild/objects/split.swift.o", ".atllbuild/objects/substring.swift.o", ".atllbuild/objects/whitespace.swift.o", ".atllbuild/objects/string.swift.o", ".atllbuild/objects/syserror.swift.o", ".atllbuild/objects/tools.swift.o", ".atllbuild/objects/url.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
is-library: true
module-name: atfoundation
module-output-path: .atllbuild/products/atfoundation.swiftmodule
......
......@@ -14,6 +14,8 @@ commands:
sources: ["atpkg/src/CollectSources.swift", "atpkg/src/ExternalDependency.swift", "atpkg/src/Package.swift", "atpkg/src/parsing/Parser.swift", "atpkg/src/parsing/Scanner.swift", "atpkg/src/parsing/Tokenization.swift", "atpkg/src/Substitutions.swift", "atpkg/src/Task.swift"]
objects: [".atllbuild/objects/CollectSources.swift.o", ".atllbuild/objects/ExternalDependency.swift.o", ".atllbuild/objects/Package.swift.o", ".atllbuild/objects/Parser.swift.o", ".atllbuild/objects/Scanner.swift.o", ".atllbuild/objects/Tokenization.swift.o", ".atllbuild/objects/Substitutions.swift.o", ".atllbuild/objects/Task.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/CollectSources.swift.o", ".atllbuild/objects/ExternalDependency.swift.o", ".atllbuild/objects/Package.swift.o", ".atllbuild/objects/Parser.swift.o", ".atllbuild/objects/Scanner.swift.o", ".atllbuild/objects/Tokenization.swift.o", ".atllbuild/objects/Substitutions.swift.o", ".atllbuild/objects/Task.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
is-library: true
module-name: atpkg
module-output-path: .atllbuild/products/atpkg.swiftmodule
......
......@@ -10,10 +10,12 @@ commands:
<atllbuild-swiftc>:
tool: swift-compiler
executable: "/usr/local/bin/swiftc"
inputs: ["attools/src/atllbuild.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
sources: ["attools/src/atllbuild.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
objects: [".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
inputs: ["attools/src/atllbuild.swift", "attools/src/Configuration.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
sources: ["attools/src/atllbuild.swift", "attools/src/Configuration.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
objects: [".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/Configuration.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/Configuration.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
is-library: true
module-name: attools
module-output-path: .atllbuild/products/attools.swiftmodule
......@@ -21,7 +23,7 @@ commands:
other-args: ["-j8", "-D", "ATBUILD", "-I", ".atllbuild/products/"]
<atllbuild>:
tool: shell
inputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
inputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/Configuration.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
outputs: ["<atllbuild>", ".atllbuild/products/attools.a"]
args: ["/bin/sh","-c",rm -rf .atllbuild/products/attools.a; ar cr '.atllbuild/products/attools.a' '.atllbuild/objects/atllbuild.swift.o' '.atllbuild/objects/CustomTool.swift.o' '.atllbuild/objects/Nop.swift.o' '.atllbuild/objects/PackageAtbin.swift.o' '.atllbuild/objects/PackageFramework.swift.o' '.atllbuild/objects/PlatformPaths.swift.o' '.atllbuild/objects/Shell.swift.o' '.atllbuild/objects/TaskRunner.swift.o' '.atllbuild/objects/Tools.swift.o' '.atllbuild/objects/XCTestRun.swift.o']
args: ["/bin/sh","-c",rm -rf .atllbuild/products/attools.a; ar cr '.atllbuild/products/attools.a' '.atllbuild/objects/atllbuild.swift.o' '.atllbuild/objects/Configuration.swift.o' '.atllbuild/objects/CustomTool.swift.o' '.atllbuild/objects/Nop.swift.o' '.atllbuild/objects/PackageAtbin.swift.o' '.atllbuild/objects/PackageFramework.swift.o' '.atllbuild/objects/PlatformPaths.swift.o' '.atllbuild/objects/Shell.swift.o' '.atllbuild/objects/TaskRunner.swift.o' '.atllbuild/objects/Tools.swift.o' '.atllbuild/objects/XCTestRun.swift.o']
description: "Linking Library: .atllbuild/products/attools.a"
\ No newline at end of file
......@@ -14,6 +14,8 @@ commands:
sources: ["atbuild/src/main.swift"]
objects: [".atllbuild/objects/main.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/main.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
module-name: atbuild
module-output-path: .atllbuild/products/atbuild.swiftmodule
temps-path: .atllbuild/llbuildtmp
......
......@@ -14,6 +14,8 @@ commands:
sources: ["atpkg/atfoundation/src/charset.swift", "atpkg/atfoundation/src/date/date.swift", "atpkg/atfoundation/src/date/timeinterval.swift", "atpkg/atfoundation/src/filesystem/file.swift", "atpkg/atfoundation/src/filesystem/fileinfo.swift", "atpkg/atfoundation/src/filesystem/fs.swift", "atpkg/atfoundation/src/filesystem/path.swift", "atpkg/atfoundation/src/logger.swift", "atpkg/atfoundation/src/string/replace.swift", "atpkg/atfoundation/src/string/search.swift", "atpkg/atfoundation/src/string/split.swift", "atpkg/atfoundation/src/string/substring.swift", "atpkg/atfoundation/src/string/whitespace.swift", "atpkg/atfoundation/src/string.swift", "atpkg/atfoundation/src/syserror.swift", "atpkg/atfoundation/src/tools.swift", "atpkg/atfoundation/src/url.swift"]
objects: [".atllbuild/objects/charset.swift.o", ".atllbuild/objects/date.swift.o", ".atllbuild/objects/timeinterval.swift.o", ".atllbuild/objects/file.swift.o", ".atllbuild/objects/fileinfo.swift.o", ".atllbuild/objects/fs.swift.o", ".atllbuild/objects/path.swift.o", ".atllbuild/objects/logger.swift.o", ".atllbuild/objects/replace.swift.o", ".atllbuild/objects/search.swift.o", ".atllbuild/objects/split.swift.o", ".atllbuild/objects/substring.swift.o", ".atllbuild/objects/whitespace.swift.o", ".atllbuild/objects/string.swift.o", ".atllbuild/objects/syserror.swift.o", ".atllbuild/objects/tools.swift.o", ".atllbuild/objects/url.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/charset.swift.o", ".atllbuild/objects/date.swift.o", ".atllbuild/objects/timeinterval.swift.o", ".atllbuild/objects/file.swift.o", ".atllbuild/objects/fileinfo.swift.o", ".atllbuild/objects/fs.swift.o", ".atllbuild/objects/path.swift.o", ".atllbuild/objects/logger.swift.o", ".atllbuild/objects/replace.swift.o", ".atllbuild/objects/search.swift.o", ".atllbuild/objects/split.swift.o", ".atllbuild/objects/substring.swift.o", ".atllbuild/objects/whitespace.swift.o", ".atllbuild/objects/string.swift.o", ".atllbuild/objects/syserror.swift.o", ".atllbuild/objects/tools.swift.o", ".atllbuild/objects/url.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
is-library: true
module-name: atfoundation
module-output-path: .atllbuild/products/atfoundation.swiftmodule
......
......@@ -14,6 +14,8 @@ commands:
sources: ["atpkg/src/CollectSources.swift", "atpkg/src/ExternalDependency.swift", "atpkg/src/Package.swift", "atpkg/src/parsing/Parser.swift", "atpkg/src/parsing/Scanner.swift", "atpkg/src/parsing/Tokenization.swift", "atpkg/src/Substitutions.swift", "atpkg/src/Task.swift"]
objects: [".atllbuild/objects/CollectSources.swift.o", ".atllbuild/objects/ExternalDependency.swift.o", ".atllbuild/objects/Package.swift.o", ".atllbuild/objects/Parser.swift.o", ".atllbuild/objects/Scanner.swift.o", ".atllbuild/objects/Tokenization.swift.o", ".atllbuild/objects/Substitutions.swift.o", ".atllbuild/objects/Task.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/CollectSources.swift.o", ".atllbuild/objects/ExternalDependency.swift.o", ".atllbuild/objects/Package.swift.o", ".atllbuild/objects/Parser.swift.o", ".atllbuild/objects/Scanner.swift.o", ".atllbuild/objects/Tokenization.swift.o", ".atllbuild/objects/Substitutions.swift.o", ".atllbuild/objects/Task.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
is-library: true
module-name: atpkg
module-output-path: .atllbuild/products/atpkg.swiftmodule
......
......@@ -10,10 +10,12 @@ commands:
<atllbuild-swiftc>:
tool: swift-compiler
executable: "/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc"
inputs: ["attools/src/atllbuild.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
sources: ["attools/src/atllbuild.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
objects: [".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
inputs: ["attools/src/atllbuild.swift", "attools/src/Configuration.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
sources: ["attools/src/atllbuild.swift", "attools/src/Configuration.swift", "attools/src/CustomTool.swift", "attools/src/Nop.swift", "attools/src/PackageAtbin.swift", "attools/src/PackageFramework.swift", "attools/src/PlatformPaths.swift", "attools/src/Shell.swift", "attools/src/TaskRunner.swift", "attools/src/Tools.swift", "attools/src/XCTestRun.swift"]
objects: [".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/Configuration.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/Configuration.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
is-library: true
module-name: attools
module-output-path: .atllbuild/products/attools.swiftmodule
......@@ -21,7 +23,7 @@ commands:
other-args: ["-j8", "-D", "ATBUILD", "-I", ".atllbuild/products/", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"]
<atllbuild>:
tool: shell
inputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
inputs: ["<atllbuild-swiftc>", ".atllbuild/objects/atllbuild.swift.o", ".atllbuild/objects/Configuration.swift.o", ".atllbuild/objects/CustomTool.swift.o", ".atllbuild/objects/Nop.swift.o", ".atllbuild/objects/PackageAtbin.swift.o", ".atllbuild/objects/PackageFramework.swift.o", ".atllbuild/objects/PlatformPaths.swift.o", ".atllbuild/objects/Shell.swift.o", ".atllbuild/objects/TaskRunner.swift.o", ".atllbuild/objects/Tools.swift.o", ".atllbuild/objects/XCTestRun.swift.o"]
outputs: ["<atllbuild>", ".atllbuild/products/attools.a"]
args: ["/bin/sh","-c",rm -rf .atllbuild/products/attools.a; ar cr '.atllbuild/products/attools.a' '.atllbuild/objects/atllbuild.swift.o' '.atllbuild/objects/CustomTool.swift.o' '.atllbuild/objects/Nop.swift.o' '.atllbuild/objects/PackageAtbin.swift.o' '.atllbuild/objects/PackageFramework.swift.o' '.atllbuild/objects/PlatformPaths.swift.o' '.atllbuild/objects/Shell.swift.o' '.atllbuild/objects/TaskRunner.swift.o' '.atllbuild/objects/Tools.swift.o' '.atllbuild/objects/XCTestRun.swift.o']
args: ["/bin/sh","-c",rm -rf .atllbuild/products/attools.a; ar cr '.atllbuild/products/attools.a' '.atllbuild/objects/atllbuild.swift.o' '.atllbuild/objects/Configuration.swift.o' '.atllbuild/objects/CustomTool.swift.o' '.atllbuild/objects/Nop.swift.o' '.atllbuild/objects/PackageAtbin.swift.o' '.atllbuild/objects/PackageFramework.swift.o' '.atllbuild/objects/PlatformPaths.swift.o' '.atllbuild/objects/Shell.swift.o' '.atllbuild/objects/TaskRunner.swift.o' '.atllbuild/objects/Tools.swift.o' '.atllbuild/objects/XCTestRun.swift.o']
description: "Linking Library: .atllbuild/products/attools.a"
\ No newline at end of file
......@@ -14,6 +14,8 @@ commands:
sources: ["atbuild/src/main.swift"]
objects: [".atllbuild/objects/main.swift.o"]
outputs: ["<atllbuild-swiftc>", ".atllbuild/objects/main.swift.o"]
enable-whole-module-optimization: false
num-threads: 8
module-name: atbuild
module-output-path: .atllbuild/products/atbuild.swiftmodule
temps-path: .atllbuild/llbuildtmp
......@@ -22,5 +24,5 @@ commands:
tool: shell
inputs: ["<atllbuild-swiftc>", ".atllbuild/objects/main.swift.o", ".atllbuild/products/attools.a", ".atllbuild/products/atpkg.a", ".atllbuild/products/atfoundation.a"]
outputs: ["<atllbuild>", ".atllbuild/products/atbuild"]
args: ["/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc", "-o", ".atllbuild/products/atbuild", ".atllbuild/objects/main.swift.o", ".atllbuild/products/attools.a", ".atllbuild/products/atpkg.a", ".atllbuild/products/atfoundation.a"]
args: ["/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc", "-o", ".atllbuild/products/atbuild", ".atllbuild/objects/main.swift.o", ".atllbuild/products/attools.a", ".atllbuild/products/atpkg.a", ".atllbuild/products/atfoundation.a", "-Xlinker", "-dead_strip"]
description: Linking executable .atllbuild/products/atbuild
(package
:name "configurations"
:tasks {
:default {
:tool "shell"
;;print some environment variables set by the configuration
:script "echo \${ATBUILD_CONFIGURATION} \${ATBUILD_CONFIGURATION_OPTIMIZE}"
}
:tool {
:tool "echo.attool"
:always "some flag"
:overlays {
;;if we're in this configuration, set the following value
:atbuild.configuration.custom {
:bond "james bond"
}
}
}
}
)
\ No newline at end of file
......@@ -17,6 +17,29 @@ if ! $ATBUILD package --use-overlay static; then
$ATBUILD package
fi
echo "****************CONFIGURATION TEST**************"
cd $DIR/tests/fixtures/configurations
$ATBUILD > /tmp/configurations.txt
if ! grep "debug 0" /tmp/configurations.txt; then
echo "Invalid configuration behavior"
exit 1
fi
$ATBUILD --configuration release > /tmp/configurations.txt
if ! grep "release 1" /tmp/configurations.txt; then
echo "Invalid configuration behavior"
exit 1
fi
$ATBUILD --configuration custom tool > /tmp/configurations.txt
if ! grep "\-always some flag --bond james bond" /tmp/configurations.txt; then
echo "Invalid configuration behavior"
exit 1
fi
echo "****************BITCODE TEST**************"
cd $DIR/tests/fixtures/bitcode
......
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