Code Monkey home page Code Monkey logo

swift-package-list's People

Contributors

dependabot[bot] avatar felixherrmann avatar m4p avatar makcakir avatar mmllr avatar tunous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

swift-package-list's Issues

Support for visionOS

The project is already building on visionOS, just need to add it as a supported platform.

Feature Request: add `LicenseName` field to the output

I want to start with saying: I love this software! Thanks for creating it!

I was wondering if there is an easy way to add the license name as a field to the output? The output files right now have a license file with the raw text of the license, but I was wondering if you would be open to add the licenseName, in the form of an SPDX license identifier to the output as well?

Background: In our software attributions list, we list all the included components, their name, version and license identifier. Then, when one clicks on a license, the full text appears, but we first want to start by showing just the license identifier.

In our use case we are using the json output of the package list.

Support for Swift Package Projects

Currently there is no support for SPM projects. We have everything we need to accomplish that (underlying Xcode workspace, derived-data directory etc.).

Package List Revision

Currently there is one top-level function that handles the entire package-list reading from a bundle; this is not very flexible, especially in the UI target.

Add customFileName Option

Hi,

I'd like to be able to specify the output file name.

Can't see that in the options, just the path?

Thanks,

Jules.

Repositories with file-extensions in name not working

For example, integrating SQLite with https://github.com/stephencelis/SQLite.swift results in a runtime error: The file "SQLite" couldn't be opened because there is no such file; adding the optional git extension like https://github.com/stephencelis/SQLite.swift.git works.

Dependency Tree is missing

The Swift Package Manager can show you a Dependency-Tree. But that works only on packages directly, not on projects. So you can never see a Dependency-Tree for your project.

If this tool could build a Depdency-Tree for your project, that would be fantastic.

I build a script for that, but having it in your tool would be better, especially since I don't have your experience and am not 100% sure if that's 100% resistent against edge-cases:

if [[ $1 == "" ]]; then
  echo "Missing build dir as 1st parameter"
  exit 1
fi

if [[ $2 == "" ]]; then
  echo "Missing project dir as 2nd parameter"
  exit 1
fi

BUILD_DIR=$1
PROJECT_DIR=$2

echo "Build dependencies tree"
cd "$BUILD_DIR/../../SourcePackages/checkouts"
exportFile="$PROJECT_DIR/dependencies-tree.md"
echo "# Dependencies trees for each Swift-Package" > "$exportFile"
echo "" >> "$exportFile"
echo "Build date: $(date '+%Y-%d-%m %a %H:%M:%S %Z')" >> "$exportFile"
echo "" >> "$exportFile"
for directory in */; do
  echo "Tree for $directory"
  echo "" >> "$exportFile"
  echo "## Tree for $directory" >> "$exportFile"
  pushd $directory
  swift package show-dependencies >> "$exportFile"
  echo "" >> "$exportFile"
  echo "" >> "$exportFile"
  popd
done

Swift Package Plugin Configuration

Currently there is a plugin for each output-type; this causes multiple problems:

  1. Multiple plugins cannot share code with each other. This results in a lot of duplication and things could be overseen when the CLI tool changes.
  2. There is no way to configure the plugin and users have to rely on the decided defaults.
  3. Because of 2. projects inside workspaces cannot tell the plugin to use the workspace file, instead they will keep using the project file and therefore will no longer use the correct Package.resolved data.

No such module 'AppKit'

Hi,

I have an iOS project and am using the AcknowledgmentsList from SwiftPackageListUI.

I've selected the ..

SwiftPackageListUI
Swift-Package-List

.. spm packages...

However, I'm getting an error from the PDFBuilder

image

As the error mentions, think it needs and if statement etc...

Jules.

Support for Xcode Workspaces

I keep getting the following error message: No checkouts-path found in your DerivedData-folder

Xcode 13.2.1, macOS Monterey 12.2

Full DocC documentations

Currently there is only the basic documentation and a big README describing everything. This can be improved by configuring a proper and interactive DocC documentation.

Question re. swift-package-list

I have updated SwiftPackageList to 1.4.0. This caused a package called swift-argument-parser v1.0.3 to get added to the SPM. Is this OK?

Following the new instructions, I downloaded project and ran make update and received the following error:

sh uninstall.sh
sh: uninstall.sh: No such file or directory
make: *** [update] Error 127

Thought I would try uninstall and install:

make uninstall returns rm -f "/usr/local/bin/swift-package-list"

make install returns the following:

swift build --configuration release
Fetching https://github.com/apple/swift-argument-parser from cache
Fetched https://github.com/apple/swift-argument-parser (0.57s)
Computing version for https://github.com/apple/swift-argument-parser
Computed https://github.com/apple/swift-argument-parser at 1.0.3 (0.62s)
Creating working copy for https://github.com/apple/swift-argument-parser
Working copy of https://github.com/apple/swift-argument-parser resolved at 1.0.3
[13/13] Build complete!
cp -f ".build/release/SwiftPackageListCommand" "/usr/local/bin/swift-package-list"
cp: .build/release/SwiftPackageListCommand: No such file or directory
make: *** [install] Error 1

Am I doing something wrong?

Support for Tuist 4

Once Tuist 4 is released CI will fail because the test examples have the old project format and tuist dump can no longer compile it.

Error: The file “swift-package-list” couldn’t be opened because there is no such file

Would love to try out your tool, but regardless of the installation method I get the same error (see below). You got any idea? I double checked the $PATH already but this seems fine.

Version: 4.0.1

Mint

mint run swift-package-list Test.xcodeproj
Error: The file “swift-package-list” couldn’t be opened because there is no such file.

Homebrew

swift-package-list Test.xcodeproj
Error: The file “swift-package-list” couldn’t be opened because there is no such file

Xcode Build Plugin

Run script build phase 'SwiftPackageListPlugin' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked.

PhaseScriptExecution SwiftPackageListPlugin <HIDDEN>

Error: The file “swift-package-list” couldn’t be opened because there is no such file.
LLVM Profile Error: Failed to write file "default.profraw": Operation not permitted
Command PhaseScriptExecution failed with a nonzero exit code

Error: The file “swift-package-list” couldn’t be opened because there is no such file.

LLVM Profile Error: Failed to write file "default.profraw": Operation not permitted

Command PhaseScriptExecution failed with a nonzero exit code

Support Tuist 4.x.x

New Tuist version no longer uses Tuist/Dependencies.swift but rather Tuist/Package.swift. In the current state running the command produces:

No build directory found in /Users/anurag.ajwani/Library/Developer/Xcode/DerivedData for ...

Command:

swift-package-list Tuist/Package.swift \
    --output-type settings-bundle \
    --output-path App/Resources

AppKit not being found

Hi,

Thanks a lot for this Swift package first of all!

I just integreated in my iOS app, and unfortunately I'm unable to make it work, as I'm getting an error in PDFGenerator complaining with No such module AppKit.

I following the steps in the README installing it via Homebrew, then generating the package-list.json, adding it to the Xcode project and adding the build phase.

Have I done something incorrectly? I've currently imported all three packages (the binary too) when adding your package dependency to my project.

Thanks!

Build phase - Build input files cannot be found

Hi,

I added the SPM, added the executable and the ui...

I assumed I didn't have to install (Aka using mint) as I used the SPM ?

Added the build phase and I'm getting this error...

error: Build input files cannot be found: '/Users/jm/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/ArgumentParser.o', '/Users/jm/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/ArgumentParserToolInfo.o' (in target 'swift-package-list' from project 'SwiftPackageList')

Any ideas ?

Thanks,

Jules.

Feature request: Support for -clonedSourcePackagesDirPath

First of all, love this software :)

If I run xcodebuild -resolvePackageDependencies with an additional argument of -clonedSourcePackagesDirPath ~/Packages swift-package-list cannot find the workspace-state.json.

Enhancement

In addition to --derived-data-path can you also provide an alternative --source-packages-data-path to override this?

Rationale

  • Some CI scenarios benefit from clearing derived data, so xcodebuild provides the ability to resolve packages to a different location.

Is this a feature you could add, please?

Improve error handling

Currently we print the error message and then return in the run method. This can easily be replaced with throwing an error with description.

Build Package.resolved version system

Xcode 13.3 introduced a new Package.resolved version (2). The entire object structure has changed (as shown in #19) and we need a system to support version 1, 2 and any upcoming versions. Version 2 gets also rid of the package name... we have to switch to the last path component of the repository URL (which is not ideal but better than the new identity parameter).

Support for Tuist Projects

Hello. Thanks for your great tool.

I have a suggestion to add some improvements to your tool.
For now, we can define the path to xcodeproj/xcworkspace because we need the Package.resolved file.
But for now, in iOS community, teams are using Tuist to configure their project. With using Tuist you don't have Package.resolved file like other standard projects. Instead, you have a .package.resolved file that creates by Tuist when you setup the project.

What do you think about it?

Issue Generating Package List with Tuist 4 Project Structure

Hi @FelixHerrmann,

First off, thanks for developing such an incredible package. It's been a game-changer for my projects. Currently, I'm working on integrating it into a new project, structured as follows, with dependencies managed via Package.swift that is consumed by Tuist 4.

.
├── App
   ├── App.xcodeproj
   ├── Project.swift
   ├── Tests
   └── iOS
├── Frameworks
   ├── AppFeature
   ├── Core
   ├── DesignSystem
   └── HomeFeature
├── Package.resolved
├── Package.swift
├── Qualifly-PPL-H.xcworkspace
├── Tuist
   ├── Config.swift
   └── ProjectDescriptionHelpers
└── Workspace.swift

However, I've encountered an issue when executing swift-package-list with the error message:

> swift-package-list Package.swift                                    
Error: No build directory found in /Developer/Xcode/DerivedData for project Developer/ProjectName/Package.swift

Could anyone provide insights or suggestions on how to resolve this error?

Project Revision

The Core target has some limitations. The following things would be helpful for future development:

  • Project type protocol-based
  • some of the internal file/directory logic could be represented by a type
  • scan subcommand can be represented by a new output type of the generate subcommand
  • this eliminates the need for a subcommand for the main functionality

Build script phase not working

First of all, thank you for making this! It works beautifully when I run it from the terminal!

Unfortunately, I have not been able to get it to work as a build script phase. I installed swift-package-list on my machine beforehand, but it still doesn't work. I also tried adding it as a package dependency to my project, but that also didn't work. Either way it gives the warning "swift-package-list not installed". I am just using an xcodeproj, not xcworkspace. I'm happy to give any additional details that might be helpful. Thank you!

4.0 Migration Guide

4.0 has a lot of API, it's a good opportunity to start writing migration guides.

Feature Request: Resolving Package name instead of repository name

Hi, thank you for maintaining this great tool!

Looking at the output it seems like that the dependency name from Package.resolved is always the repository name but not the Package name as in the name as defined in the Package.swift file.

As an example see the following output:

{
    "license" : "Copyright 2015 Catamorphic, Co.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
    "name" : "ios-client-sdk",
    "repositoryURL" : "https:\/\/github.com\/launchdarkly\/ios-client-sdk",
    "revision" : "89d87b2b492624dab41dc407fd11b18ebb3e90cf",
    "version" : "8.3.1"
  },

name is defined as ios-client-sdk here.

When looking at the Package.swift file in the dependencies repo however we see that the Package name is in fact LaunchDarkly.
I think it would be beneficial if this script could fetch the 'user facing' dependency name resolved from the Package file.

SPLPackageList returning nil

The validation checks on the Serialization classes are wrong, they only check in the opposite direction, we can simply get rid of them.

Feature Request: Output into stdout

Thanks for the very useful tool!

I would like to suggest that outputting into stdout might be a very useful addition to using this tool in various pipelines :-)

Currently I was able to capture the output by using mkfifo and juggling around with it, but if something goes wrong (e.g. Package.resolved is not in a current state so the tool crashes with a "file not found" error), the other end of the pipeline reading from the fifo gets stuck and has to time out...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.