Remove Structure from Copy - tfs-2015

I have a Task on my TFS build to Copy files to the staging folder:
Currently, this builds the staging folder with all the subfolder structure, e.g. \MyProject\bin\release\
Is there a way to set this so that it dumps to just \MyProject\, without the bin\release portions?

You can try change the output path :
Configure the build configuration output path, eg set ".\" as
out path (In solution right click the project > properties > Build > Output > Output path).
Specify the output path in MSBuild Arguments such as
/p:OutputPath=$(Build.BinariesDirectory) then copy from $(Build.BinariesDirectory) directly. Reference screenshot below.
Besides, you can also try to copy the contents to stage folder first. then add another Copy Files step to copy the \MyProject\bin\release\** to \MyProject

Related

Copy files from one path to another path in TFVC repository using Powershell

I am trying to copy files from one folder path to another folder path in the TFVC repository using Powershell script in CI as mentioned below.
Get-Item -path $/SCSM/CMC/1.1.0.0/Dev/1.1.1.0/TSC/ServiceRuleScript - Destination $/SCSM/CCB/1.0.0.0/Dev/1.0.1.0/TSC/RulesEngine
When trying the above script getting the below error:
Copy-Item : Cannot find path 'C:\privateagent\_work\66\s\$/SCSM/CMC/1.1.0.0/Dev/1.1.1.0/TSC/ServiceRuleScript
We tried with the copy file task in CI, it is getting executed but we are unable to see the file in the destination folder path
enter image description here
Please help me out with this task.
The problem is that your Source Folder is wrong.
Use this Predefined variables:
$(Build.SourcesDirectory)\{your folder want to be copied}
It works on my side:
We are trying to call file from one path "Masters\DbProject\V1.0.0.1\PowershellScripts
and we are using the copy task to call file in another path "CCM/1.0.0.0/1.1.0.0/Dev/1.1.1.0". Both are different paths. When we are trying to call the file using copy file task getting the below error.
##[error]Unhandled: Not found SourceFolder: C:\privateagent_work\66\s\Masters\DbProject\V1.0.0.1\PowershellScripts
But the file which we are trying to call is in the below path: "C:\privateagent_work\79\s\Masters\DbProject\V1.0.0.1\PowershellScripts
We have mentioned the below path in our copy task
Source folder in copy task - $(Build.SourcesDirectory)\Masters\DbProject\V1.0.0.1\PowershellScripts
The problem here in the copy task is - The copy file task should call file from "C:\privateagent_work\79\s\Masters\DbProject\V1.0.0.1\PowershellScripts" but it is trying to call the file from "C:\privateagent_work\66\s\Masters\DbProject\V1.0.0.1\PowershellScripts
Please share your inputs.

Xcode Build path and copying additional files

I'm writing a plugin for Elgato Stream Deck. https://developer.elgato.com/documentation/stream-deck/sdk/overview/
Basically it is a binary command line tool written in C++/OBJ-C/Swift combined with a JSON manifest and optionally some HTML and JS files as well as different assets (.png, ...). All files have to be included in a folder (com.companyname.pluginname.sdPlugin) which lives in Library/Application Support/com.elgato.StreamDeck/Plugins/
At the moment, I'm building the binary to the default build path (derived data, ...) and manually copy it to the above folder. But I need to build and run that binary with an executable (Stream Deck app) defined in the scheme for debugging under Xcode. The JSON manifest and assets also lives in my xcode project folder and have to be copied manually.
So Before:
After:
So my question: how can I automate that under Xcode? I assume I can do some sort of post build scripting, but I have no knowledge about all that stuff.
Thanks
Solution:
go to target -> build settings
Deployment Location = YES
Installation Build Products Location = / (empty this one!)
Installation Directory = path to folder (= $INSTALL_PATH)
this will copy your binary to the defined installation path
go to target -> build phases
new phase -> run script
cp -r "$SRCROOT"/<FILE OR FOLDER NAME> "$INSTALL_PATH"/<FILE OR FOLDER NAME>
repeat this for all files and folders you need to be copied to the installation path. be careful with empty spaces in the folder/file names, they won't be recognized correctly and you have to use quotation marks

How to use "Copy Files to:" task two time in same pipeline in Azure Devops

I have created one Azure pipeline in which i have added two "Copy Files to" task to copy reports from two different folders. But second one is not working it copy previous task only.
First you need to check if the reports files are generated and which directory the reports are located from the build log.
If Copy files task failed to copy the files. Most likely the Source Folder or the File patterns in the Contents are wrongly specified, which causes the files cannot be found.
So you need to check if the files you want to copy resides in Source Folder you specified. And make sure the file paths match the patterns you specified in the Contents field. See below screenshot example.
Check here to learn more about the usage of Copy files task.

TFS 2015 Artifacts always empty upon build

I have created build definition which runs successfully. Now I want to create a release definition on the successful build, for which it is asking for artifacts.
When I tried browsing "Drop" folder, I found it empty.
Below are the images from Copy Files step and Publish build artifacts step.
I also tried instructions from The item MY_ARTIFACT_NAME in container XXX could not be found
But no luck. Please help.
I believe that you should use $(build.sourcesdirectory) (or a path relative to) as the source folder if you want to copy files which are not checked in.
Also, from the documentation of the Copy Files step
The pattern is used to match only file paths, not folder paths. So you should specify patterns such as **\bin\** instead of of **\bin.
Try changing the contents pattern to **\bin\** and see if that helps.

How can I filter which files are included in a workspace using MSBuild?

It seems that MsBuild creates a folder called, "BuildType" on the build server and this folder is where the .proj file is copied. In source control I have several files that are in the same folder as the build project file. I have a workspace mapped to this location.
I would like to be able to specify explicitly which files from this workspace location should be copied to the build machine. Is this possible?
Thanks!
You cannot do this on file level but if you organize your build type folder with subfolders you can cloak the folders that you want to exclude.