[swift-build-dev] Package Manager command line option clean-up

Rob Allen rob at akrabat.com
Thu May 26 02:43:20 CDT 2016


Looks nice and consistent to me. I like it.

It seems like `-vv` is not documented though or has it been removed?

Also, it seems slightly strange that there's not a long-form name for test's `-s` option.

Regards,

Rob...


> On 26 May 2016, at 00:13, Anders Bertelrud via swift-build-dev <swift-build-dev at swift.org> wrote:
> 
> Hello all,
> 
> Now that the `package` subcommand has been implemented (see https://github.com/apple/swift-evolution/blob/master/proposals/0085-package-manager-command-name.md <https://github.com/apple/swift-evolution/blob/master/proposals/0085-package-manager-command-name.md>), some of the options have ended up with awkward syntax.  For example, the old `--init` option took an optional package type parameter, and after the command renaming, the syntax has become somewhat awkward:  `package init=library`.
> 
> In order to clean this up, we have added some flags for the newly introduced subcommands, and I wanted to run them by the list to get any feedback before making the change.
> 
> The command line interface vended by the new `package` subcommand introduced by SE-0085 is shown in its help text:
> 
> OVERVIEW: Perform operations on Swift packages
> 
> USAGE: swift package [command] [options]
> 
> COMMANDS:
>   init [--type <type>]                   Initialize a new package (executable|library)
>   fetch                                  Fetch package dependencies
>   update                                 Update package dependencies
>   generate-xcodeproj [--output <path>]   Generates an Xcode project
>   show-dependencies [--format <format>]  Print dependency graph (text|dot|json)
>   dump-package [--output <path>]         Print Package.swift as JSON
> 
> OPTIONS:
>   --chdir <path>       Change working directory before any command [-C]
>   --color <mode>       Specify color mode (auto|always|never)
>   --verbose            Increase verbosity of informational output [-v]
>   -Xcc <flag>          Pass flag through to all C compiler instantiations
>   -Xlinker <flag>      Pass flag through to all linker instantiations
>   -Xswiftc <flag>      Pass flag through to all Swift compiler instantiations
> 
> NOTE: Use `swift build` to build packages, and `swift test` to test packages
> 
> The changes are to introduce new flags for the parameters that were previously passed to the subcommand names themselves.  The last three flags listed (-Xcc, -Xlinker, and -Xswiftc) are unchanged to maintain compatibility with the swift compiler — this will likely be revisited at a later time.
> 
> As described in SE-0085, the `build` subcommand stays.  It how has this interface:
> 
> OVERVIEW: Build sources into binary products
> 
> USAGE: swift build [mode] [options]
> 
> MODES:
>   --configuration <value>   Build with configuration (debug|release)
>   --clean [<mode>]          Delete artifacts (build|dist)
> 
> OPTIONS:
>   --chdir <path>       Change working directory before any other operation [-C]
>   --build-path <path>  Specify build directory
>   --color <mode>       Specify color mode (auto|always|never)
>   --verbose            Increase verbosity of informational output [-v]
>   -Xcc <flag>          Pass flag through to all C compiler instantiations
>   -Xlinker <flag>      Pass flag through to all linker instantiations
>   -Xswiftc <flag>      Pass flag through to all Swift compiler instantiations
> 
> NOTE: Use `swift package` to perform other functions on packages
> 
> Finally, the `test` subcommand remains largely unmodified, with this interface:
> 
> OVERVIEW: Build and run tests
> 
> USAGE: swift test [specifier] [options]
> 
> SPECIFIER:
>   -s TestModule.TestCase         Run a test case subclass
>   -s TestModule.TestCase/test1   Run a specific test method
> 
> OPTIONS:
>   --chdir              Change working directory before any other operation [-C]
>   --build-path <path>  Specify build directory
> 
> NOTE: Use `swift package` to perform other functions on packages
> 
> Questions / comments / concerns?
> 
> Anders
> 
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev

-- 
Development thoughts at http://akrabat.com
Daily Jotter for Mac OS X at http://dailyjotter.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20160526/6376b679/attachment.html>


More information about the swift-build-dev mailing list