Skip to content

[SE-0301] Add swift package add-product command and supporting library #7477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

DougGregor
Copy link
Member

Introduce support for adding a new product to the package manifest,
both programmatically (via PackageModelSyntax) and via the
swift package add-product command. Help for this command is:

OVERVIEW: Add a new product to the manifest

USAGE: swift package add-product <name> [--type <type>] [--targets <targets> ...] [--url <url>] [--path <path>] [--checksum <checksum>]

ARGUMENTS:
  <name>                  The name of the new product

OPTIONS:
  --type <type>           The type of target to add, which can be one of
                          'executable', 'library', 'static-library',
                          'dynamic-library', or 'plugin' (default: library)
  --targets <targets>     A list of targets that are part of this product
  --url <url>             The URL for a remote binary target
  --path <path>           The path to a local binary target
  --checksum <checksum>   The checksum for a remote binary target
  --version               Show the version.
  -h, -help, --help       Show help information.

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor force-pushed the se-0301-package-add-product branch from 77fa066 to cf9142f Compare April 22, 2024 19:27
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test Windows

Introduce support for adding a new product to the package manifest,
both programmatically (via PackageModelSyntax) and via the
`swift package add-product` command. Help for this command is:

    OVERVIEW: Add a new product to the manifest

    USAGE: swift package add-product <name> [--type <type>] [--targets <targets> ...] [--url <url>] [--path <path>] [--checksum <checksum>]

    ARGUMENTS:
      <name>                  The name of the new product

    OPTIONS:
      --type <type>           The type of target to add, which can be one of
                              'executable', 'library', 'static-library',
                              'dynamic-library', or 'plugin' (default: library)
      --targets <targets>     A list of targets that are part of this product
      --url <url>             The URL for a remote binary target
      --path <path>           The path to a local binary target
      --checksum <checksum>   The checksum for a remote binary target
      --version               Show the version.
      -h, -help, --help       Show help information.
@DougGregor DougGregor force-pushed the se-0301-package-add-product branch from cf9142f to 7a9ba7a Compare April 23, 2024 04:11
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor enabled auto-merge (squash) April 23, 2024 04:11
@DougGregor
Copy link
Member Author

@swift-ci please test Windows

@DougGregor DougGregor merged commit a408054 into swiftlang:main Apr 23, 2024
5 checks passed
@DougGregor DougGregor deleted the se-0301-package-add-product branch April 23, 2024 14:37
DougGregor added a commit to DougGregor/swift-package-manager that referenced this pull request Apr 24, 2024
swiftlang#7477)

Introduce support for adding a new product to the package manifest,
both programmatically (via PackageModelSyntax) and via the
`swift package add-product` command. Help for this command is:

    OVERVIEW: Add a new product to the manifest

USAGE: swift package add-product <name> [--type <type>] [--targets
<targets> ...] [--url <url>] [--path <path>] [--checksum <checksum>]

    ARGUMENTS:
      <name>                  The name of the new product

    OPTIONS:
--type <type> The type of target to add, which can be one of
                              'executable', 'library', 'static-library',
'dynamic-library', or 'plugin' (default: library)
--targets <targets> A list of targets that are part of this product
      --url <url>             The URL for a remote binary target
      --path <path>           The path to a local binary target
      --checksum <checksum>   The checksum for a remote binary target
      --version               Show the version.
      -h, -help, --help       Show help information.

(cherry picked from commit a408054)
DougGregor added a commit that referenced this pull request Apr 25, 2024
#7494)

* **Explanation**: Implement package manifest editing commands (`swift
package add-dependency`, `swift package add-target`, `swift package
add-product`) described in
[SE-0301](https://github.com/apple/swift-evolution/blob/main/proposals/0301-package-editing-commands.md),
using swift-syntax under the hood to perform the edits.
* **Original PR**:
#7467,
#7476,
#7477
* **Risk**: Very low. All new code for new commands.
* **Reviewed by**: @ahoppen , @bnbarham , @owenv , @MaxDesiatov 
* **Testing**: New tests.

---------

Co-authored-by: Rintaro Ishizaki <rishizaki@apple.com>
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
swiftlang#7477)

Introduce support for adding a new product to the package manifest,
both programmatically (via PackageModelSyntax) and via the
`swift package add-product` command. Help for this command is:

    OVERVIEW: Add a new product to the manifest

USAGE: swift package add-product <name> [--type <type>] [--targets
<targets> ...] [--url <url>] [--path <path>] [--checksum <checksum>]

    ARGUMENTS:
      <name>                  The name of the new product

    OPTIONS:
--type <type> The type of target to add, which can be one of
                              'executable', 'library', 'static-library',
'dynamic-library', or 'plugin' (default: library)
--targets <targets> A list of targets that are part of this product
      --url <url>             The URL for a remote binary target
      --path <path>           The path to a local binary target
      --checksum <checksum>   The checksum for a remote binary target
      --version               Show the version.
      -h, -help, --help       Show help information.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
swiftlang#7477)

Introduce support for adding a new product to the package manifest,
both programmatically (via PackageModelSyntax) and via the
`swift package add-product` command. Help for this command is:

    OVERVIEW: Add a new product to the manifest

USAGE: swift package add-product <name> [--type <type>] [--targets
<targets> ...] [--url <url>] [--path <path>] [--checksum <checksum>]

    ARGUMENTS:
      <name>                  The name of the new product

    OPTIONS:
--type <type> The type of target to add, which can be one of
                              'executable', 'library', 'static-library',
'dynamic-library', or 'plugin' (default: library)
--targets <targets> A list of targets that are part of this product
      --url <url>             The URL for a remote binary target
      --path <path>           The path to a local binary target
      --checksum <checksum>   The checksum for a remote binary target
      --version               Show the version.
      -h, -help, --help       Show help information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants