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

Anders Bertelrud anders at apple.com
Thu May 26 12:44:06 CDT 2016


On 2016-05-26, at 00.43, Rob Allen <rob at akrabat.com> wrote:

> Looks nice and consistent to me. I like it.

Great!

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

It’s been removed, since:

a) it is non-standard, and
b) it can be easily achieved using -v -v

I didn’t change the behavior that each occurrence of -v increments the verbosity level.

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

That’s a good point.  “specifier” would be the obvious suggestion for a long-form name.  Does that sound good to you?

Thanks!

Anders

> Regards,
> 
> Rob...
> 
> 
>> On 26 May 2016, at 00:13, Anders Bertelrud via swift-build-dev <swift-build-dev at swift.org <mailto: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 <mailto:swift-build-dev at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-build-dev
> 
> -- 
> Development thoughts at http://akrabat.com <http://akrabat.com/>
> Daily Jotter for Mac OS X at http://dailyjotter.com <http://dailyjotter.com/>

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


More information about the swift-build-dev mailing list