atbuild
supports a variety of built-in configurations:
debug
, the default, a configuration for interactive debuggingrelease
, a configuration for production-quality, released buildstest
, a configuration for automated testingbench
, a configuration for performance-sensitive testing or benchmarkingnone
, a “plain” or “no-magic” configuration. Use this to opt out of any configuration behavioratbuild
also supports custom configurations.
To specify a configuration, pass it on the command line:
atbuild --configuration release
.
Tools adjust their behavior to your chosen configuration automatically. You can also provide your own settings in an atbuild.configuration.[configurationname]
overlay.
configurations are exported to swift via the ATBUILD_DEBUG
, ATBUILD_RELEASE
, ATBUILD_TEST
and ATBUILD_BENCH
preprocessor defines. Custom configurations are exposed as ATBUILD_\(name)
. none
has no associated define.
atbuild
provides a rich internal API. Properties are exposed on the configuration object as well as via environment variable for shell / external tools.
ATBUILD_CONFIGURATION
/ currentConfiguration
This is the active configuration. Note that using this value directly is discouraged; it’s preferred to use one of the other APIs which are more future-proof to changes in the configuration definitions.
ATBUILD_CONFIGURATION_OPTIMIZE
Whether to produce optimized software.
A boolean property that can be true
, false
, or nil
/absent (meaning we don’t know the correct value).
ATBUILD_CONFIGURATION_FAST_COMPILE
/ fastCompile
Whether to prioritize compile speed over compile quality. When this is true
, you might be in the middle of a compile-run-test loop, so avoid doing anything expensive.
A boolean property that can be true
, false
, or nil
/absent (meaning we don’t know the correct value).
ATBUILD_CONFIGURATION_TESTING_ENABLED
/ testingEnabled
Whether to compile “for testing”. This may control behaviors such as whether tests are compiled at all, whether the build product can be imported with @testable
, or unlock other behavior related to testing.
A boolean property that can be true
, false
, or nil
/absent (meaning we don’t know the correct value).
ATBUILD_CONFIGURATION_NO_MAGIC
/ noMagic
Whether we should “opt out” of all magical behavior and rely only on explicit task options. For example, no SDK might be selected, requiring the user to specify one manually. Builds may be single-threaded. Etc.
A boolean property that can be true
, false
, or nil
/absent (meaning we don’t know the correct value).
ATBUILD_CONFIGURATION_DEBUG_INSTRUMENTATION
/ debugInstrumentation
What type of debug instrumentation (e.g. debug symbols) should be used. Choices are omitted
(no instrumentation) included
(instrumentation in the target) or stripped
(instrumentation in a separate file).
© 2016 Anarchy Tools and contributors.