richardszalay / helix-publishing-pipeline

Unified publishing for Sitecore Helix solutions that extends existing Visual Studio and command line workflows
MIT License
68 stars 18 forks source link

AdditionalFilesToRemoveFromTarget feature isn't removing files #52

Closed muso31 closed 5 years ago

muso31 commented 5 years ago

This feature doesnt appear to remove any files from the webroot

Configuration can be found here https://github.com/muso31/Helixbase/blob/master/src/Website/code/Properties/PublishProfiles/Local.pubxml#L21

richardszalay commented 5 years ago

Just to clarify before I dive into this, AdditionalFilesToRemoveFromTarget only removes files if they aren't going to get published (ie. it's an old, since-renamed, assembly). It also won't work with publishUrl being a URL.

Based on the above, do you think the feature itself is still an issue?

muso31 commented 5 years ago

Providing AdditionalFilesToRemoveFromTarget is a webroot clean... I've got the publishUrl set to a path. If I rename a binary in the webroot and then publish with hpp the assembly still exists in the webroot even though it should be caught in the wildcard in the publish profile

muso31 commented 5 years ago

Example is...

Path config: https://github.com/muso31/Helixbase/blob/master/src/Website/code/Properties/PublishProfiles/Local.pubxml#L12

Wildcard: https://github.com/muso31/Helixbase/blob/master/src/Website/code/Properties/PublishProfiles/Local.pubxml#L22

Unless it should be *Website\bin\Helixbase..dll** I believe it could be a defect

richardszalay commented 5 years ago

No, bin\Helixbase.*.dll is correct. Sounds like a bug.

(I'm assuming you haven't run your rename script, right? That wouldn't catch the old file name)

muso31 commented 5 years ago

Yep all vanilla, no rename!

richardszalay commented 5 years ago

I'll take a look. Btw, if you set define a EnablePackageProcessLoggingAndAssert property as true, the files to be removed will be emitted to AdditionalFilesToRemoveFromPublish.txt in the obj\Release\Package\Logs (from memory) directory

rkeitel commented 5 years ago

It doesn't work. I also tried to set EnablePackageProcessLoggingAndAssert to true, but the file AdditionalFilesToRemoveFromPublish.txt is missing after publishing.

richardszalay commented 5 years ago

@rkeitel What version of HPP are you using, and what is your publishing target (package, filesystem, etc)?

Oh, and are you using packages.config or PackageReference?

richardszalay commented 5 years ago

@rkeitel Also, is DeleteExistingFiles set to true in your publish profile? HPP's remove additional files functionality only runs if WPP isn't going to just nuke everything (as there's be no point). There was also a bugfix for this behavior in 1.5.2 so make sure you're using at least that.

Also, be careful about commenting on closed issues since I might not see it. Create a new one if you're experiencing bugs that are supposed to be resolved.