ligershark / publish-ignore

Other
8 stars 4 forks source link

Support for different publish profiles? #10

Open ZacP opened 9 years ago

ZacP commented 9 years ago

Is it possible to execute different publish ignore files based on the name of the publish profile?

For example, if we have two publish profiles - one for PublishA and one for PublishB, can we run publishA.ignore and publishB.ignore for these profiles?

sayedihashimi commented 9 years ago

No that's not supported. You can exclude files in the publish profile (.pubxml) but you'll need to author that in MSBuild.

sayedihashimi commented 9 years ago

It may be possible you edit the .pubxml to do what you want. Related code at https://github.com/ligershark/publish-ignore/blob/master/src/ls.pubignore.wpp.targets#L19

ZacP commented 9 years ago

Thanks Sayed.
Is there any way to read the publish profile name in the .wpp.targets file? If so, this would be really easy. For example, if we could get the profile name as $(ProfileName)

  <PubIgnoreFiles Include="$(MSBuildProjectDirectory)\publish-$(ProfileName).ignore" Condition=" Exists('$(MSBuildProjectDirectory)\publish-$(ProfileName).ignore') "/>
sayedihashimi commented 9 years ago

Try PublishProfile, if that doesn't work respond here and I'll look into it. I'm not 100% sure if VS sets that or not, but for cmd line publish that is the property.

ZacP commented 9 years ago

Nope - that property doesn't work. We tried that and a few other variations but it didn't work.
I just tried PublishProfile again to double check but it doesn't work. Thanks for your help

sayedihashimi commented 9 years ago

Ok I will investigate and reply.