Closed Niksko closed 7 years ago
I really agree with your point. The problem is that I'm not really familiar with web publish, so any insights about this would help because I don't know if and how I can detect the files that where published.
I'm slowly getting a little better at using gulp and dealing with streams, so I may be able to provide a PR for this in the future.
A web publish is either performed to a location defined in a .pubxml file, or it is defined as a parameter to msbuild.
Two options immediately spring to mind:
I've successfully implemented a wrapper around gulp-msbuild
that implements this functionality. I'd like to submit a pull request to add this functionality, but I'd like some input from @hoffi around the behaviour and options we add.
I propose we add a few options:
emitPublishedFiles
Boolean, when true the published files are emitted as a stream of vinyl files
publishDirectory
String, sets the
PublishDir
argument to msbuild, controls where the files are published to. Defaults to<os temp directory>/<come up with some suitable subfolder>/<uuid v4>
The only other question would be, what validation do we do? I propose we throw an error if a user tries to use the publishDirectory
option without emitPublishedFiles
set to true
. Do we also throw an error if emitPublishedFiles
is set to true
, but the list of targets doesn't contain the Publish
target? Or perhaps just a warning that this option will not do anything because Publish
wasn't passed.
Looks good to me, but i would not validate on the targets. I think that would be to restricitive if someone uses a custom target for this.
Is it possible that emitPublishedFiles
just does not emit anything in that case?
Hi
Not sure if this is possible, and it's sort of been discussed elsewhere, but would it be possible to emit the published files as a readable stream when you're doing a web publish? This would make this module MUCH more gulp like, because then you could simply call this plugin and pipe it to a destination.
If not (and I realize this is asking a lot), but do you have any idea as to how to wrap this module to accomplish this? I've tried a bunch of times, but I can't seem to figure out how to wait until the publish has finished (by waiting for the stream to emit an
end
event) before returning the src stream on the publish location. I run into issues because I need to return some sort of stream from within the task, but I can't really return a stream with agulp.src
until the publish has finished, because the globs in thegulp.src
are evaluated immediately and they find no files.