Questions tagged [prebuild]
87 questions
53
votes
6 answers
Prebuild event in Visual Studio replacing $(SolutionDir) with *Undefined*
I believe the problem is documented here moved here and looks like it might be a bug in visual studio, but I'm wondering if anyone knows of a workaround.
Basically I have the following two lines (among other things) one right after the other in the…

Davy8
- 30,868
- 25
- 115
- 173
38
votes
5 answers
Pre-build step in makefile
How can I run a script, which must execute before all other makefile commands? And it will be nice (but not mandatory) to the script is not executed if there is nothing to build.
I've searched SO and Google, but can't find anything.
I have this…

zxcat
- 2,054
- 3
- 26
- 40
35
votes
6 answers
Swallowing errors in pre-build steps in Visual Studio 2010
My solution has a bunch of projects one of which is a windows service; I have a prebuild step to stop the service and a postbuild step to restart it (this way the windows service exe is not locked when VS is building/overwriting it).
on pre-build:…

Andrey
- 20,487
- 26
- 108
- 176
30
votes
7 answers
How to run copy task with android studio into assets folder
So far I have added the following to the end of my "build.gradle"
task copyFiles(type: Copy)
copyFiles {
description = 'Copies html5 files from the common library...'
from '../../www'
into 'assets/www'
include('**/*')
}
Now I just…

Svikaren
- 301
- 1
- 3
- 5
24
votes
3 answers
Multiple Pre-Build Events in Visual Studio?
I've followed a blog post by Scott Hanselman for managing configuration with PreBuild Events and have it working fine.
I now want to split up my configuration into a couple of different files, so need to exectue the command again before the build.…

Kirschstein
- 14,570
- 14
- 61
- 79
22
votes
4 answers
Pre-build MSBuild task to update AssemblyInfo not in sync with built exe
I am using a pre-build task in Visual Studio 2008 that invokes msbuild:
C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe $(MSBuildProjectDirectory)\version.targets /p:Configuration=$(ConfigurationName)
Inside version.targets, I am updating the…

Richard Morgan
- 7,601
- 9
- 49
- 86
17
votes
2 answers
MS-Build BeforeBuild not firing
I'm customizing a .csproj project to run some custom tasks before the main build. However, I can't get the tasks to execute at all.
I uncommented the element in the .csproj file and added a simple Message task, but when…

Steve Cooper
- 20,542
- 15
- 71
- 88
17
votes
1 answer
How to kill process that may not exist on prebuild step in Visual studio?
Problem is if this process doesn't exist, build fails. I try to write something like this
tasklist /nh /fi "imagename eq XDesProc.exe" | find /i "XDesProc.exe" && (
TASKKILL /F /IM "XDesProc.exe"
) || (
echo XAML designer is not running
)
But…

Eugene Maksimov
- 1,504
- 17
- 36
13
votes
1 answer
Is there a way to add pre-build step for Jenkins pipeline?
Currently I'm able to use a post directive in my Jenkinsfile. Is there a way to trigger a pre-build step similar to this ?
post {
always {
sh '''rm -rf build/workspace'''
}
}

mirza
- 5,685
- 10
- 43
- 73
11
votes
2 answers
Visual Studio pre-build event check to see if a directory (and file) exists and delete it if it does
Every time I do a build I would like for this Pre-build event to occur:
del $(ProjectDir)\obj\Debug\Package\PackageTmp\web.config
This works fine if the directory is there. But if the directory is not there then it will cause the build to fail. …

ashlar64
- 1,054
- 1
- 9
- 24
10
votes
2 answers
How to add pre-build step in qmake/qtcreator?
I want the compiled application to have the commit number, source files checksums and other things to be available during the compilation.
In plain Makefiles I do like this:
prog: VERSION source.c
gcc -DVERSION=\"$(shell cat VERSION)\" source.c…

Vi.
- 37,014
- 18
- 93
- 148
8
votes
2 answers
How can I compile auto-generated C files in pre-build?
I have an Eclipse project that I need to auto-generate some files before compiling it. I do not want to put this auto-generated files in my repository, so each time I compile the projetct I perform a pre-build to auto-generate this files.
The…

Eduardo Montenegro
- 81
- 2
8
votes
1 answer
How do I call my script before all the builds for only once in a multi-targeting project
I would like to run my powershell script for only one time before the build process. In my mind this should be easily done, simply calling the script before the PreBuildEvent would be OK. Well, it does work for normal projects.
However, for…

Jaren Duan
- 155
- 2
- 10
8
votes
2 answers
Add prebuilt apk to AOSP build
I tried to include a prebuilt google apk (with no .so file) to my marshmallow AOSP build based on the information found in this link as follows:
In my vendor/manufacturer/device/proprietary/system/app, I created a folder named 'Testapk'.
I saved…

Phil
- 313
- 1
- 3
- 11
6
votes
2 answers
Pre-build event to run before any project in a solution is built
I have a little program I wrote to download all NuGet packages for a solution. I would like to setup a pre-build event that would run this program every time I build.
But I need it to run before the first project starts to build. I could look at…

Vaccano
- 78,325
- 149
- 468
- 850