Monday 15 August 2011

xml - Can I have a `pre-build` script decide whether to build or skip the project? -


TL; DR

Do I have a visual studio pre-build event that projects without any visible error?

Description

I have a project that has a custom XML file and a powerhall script which produces a resource file from XML during pre-build Event

My goal is to build this project only if the XML file changes. I can already determine that the file has changed, but I can not notify Visual Studio to leave the build, or I can either 0 (which allows to continue) or somebody Also stops the script with the exit code of the other number (which shows an ugly error in the error list).

Do I have a pre-build script to decide whether to create or skip this project?

example

  # Check to see if the current file is copied from the file during the build Is it different or not? If ((test-path $ buildXmlFile) -and (Get-Content $ projectXmlFile) -Various object (Get-content $ buildXmlFile)) {Write-host "Change! Get rebuilt!" } Else {Write-Host "No changes found!" Skipping Build "# Exit 0 will still motivate to make it ... exit # 1, exit 1, etc. The reason for showing a big error will be ... # how do I leave ???}  

I was able to do this work here, here:

  • Output directory - Typically
  • Code> .bin \ debug \ or .bin \ release
  • Step:

    1. On the build, call the input file to the output directory. Note: Change the input file to the previous input file (currently output directory).
    2. Enter the script BeforeBuild < Run as / code> target, such as:

    Since the generated file is only in the output directory, so to compare it to MSBuild There is nothing for this means that it will only create a complete if the input file is from the input file Which was copied before (remember, copy only after the build, but the comparison is already build).


    No comments:

    Post a Comment