MartinP7r / AckGen

Generate a list of license information for all Swift packages used in your project. For easy *Acknowledgement* views.
MIT License
39 stars 11 forks source link

AckGen not found... #6

Open JulesMoorhouse opened 2 years ago

JulesMoorhouse commented 2 years ago

Hi,

I'm constantly getting the ... AckGen not found. Please install the package via SPM (https://github.com/MartinP7r/AckGen#installation) ... message

I've had a bit of look around and can't find the folder it's looking for.

I've had this issue with Xcode 13.3, and now 13.4.

Any ideas ?

Thanks,

Jules.

MartinP7r commented 2 years ago

Sorry, I haven't had a chance to look at that. Maybe I get to it in the coming days.
Are you running this from a ScriptPhase script as described in the readme?

MartinP7r commented 1 year ago

@JulesMoorhouse are you by any chance using something other than SPM to install this package?
If so the package will not reside in DIR=$PROJECT_TEMP_DIR/../../../SourcePackages/checkouts/AckGen, so you would need to change the path in your RunScript accordingly.

MartinP7r commented 1 year ago

@JulesMoorhouse I'll close this for now. Please feel free to reopen if the issue still happens. Please let me know.

PS:

I've had a bit of look around and can't find the folder it's looking for.

You can find the folder it's looking for by printing $PROJECT_TEMP_DIR from your run script and investigate from there.

beekeweerts commented 1 year ago

I had the same issue with Xcode 14.3.1. The data path has probably changed. The problem can be easily solved by replacing the path from the readme with this one: DIR=$PROJECT_TEMP_DIR/../../../../../../SourcePackages/checkouts/AckGen

MartinP7r commented 1 year ago

@beekeweerts Hallöchen!

Thanks for sharing.
I just tried with Xcode 14.3.1 and it works normally for me, so I'm thinking there might we some difference between our Xcode environments.

As mentioned above, for investigation. Could you print $PROJECT_TEMP_DIR and share the output? Since mine looks like below, yours must be at least 3 folders deeper.

/Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[APPNAME]-fkztgoovyeymvbaqsqyonvjdlabf/Build/Intermediates.noindex/JDict.build

Also, if you are able to share a minimum reproducible example project, that would be helpful.

beekeweerts commented 1 year ago

@MartinP7r Moin!

My path looks like this: /Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[APPNAME]-fhcoiujjikncqmfokafxfpjlodgs/Build/Intermediates.noindex/ArchiveIntermediates/[TARGET-NAME]/IntermediateBuildFilesPath/[APP-NAME].build

I'm not really sure why that differs in our environments. Some run script like this could help to address this issue:

current_dir=$PROJECT_TEMP_DIR
target="SourcePackages/checkouts/AckGen"
while [ "$current_dir" != "/" ]; do
    # Check if the target path exists in the current directory
    if [ -e "$current_dir/$target" ]; then
        DIR="$current_dir/$target"
        exit 0
    else
        # Move one directory up
        current_dir=$(dirname "$current_dir")
    fi
done