TFS 2015 Artifacts always empty upon build - tfs-2015

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.

Related

How do I set up the MSBuild script to use the outdirectory's set in the csproj files while building the entire solution?

I'm not sure how I can get the MSBuild script to use the outputpath, outputdirectory values from the CSproj files. I've seen examples where I set the outputpath in the MSscript but that dumps the all the output in one big folder. I want the individual projects to have their own output paths and MSbuild to build the solution in such a way that the output for the projects and created in the corresponding output directories. Thanks.
There is not an easy way. One option is to extend MSBuild and have it copy the output from each project to a common folder.
If you look at the Microsoft.Common.Targets file in the c:\Windows\Microsoft.Net\Framework\v4.*\ you can see how it does load a custom targets file at both the beginning and end of that folder. If you add a Custom.After.Microsoft.Common.Targets to the C:\Program Files (x86)\MSBuild\v4\ folder you can have it load a file say $(SolutionDir)\Solution.targets. This will allow you to extend each solution differently and you can add any custom actions you want inside every solution that applies to every project. I use this and it works great.
Thanks for your answers guys. I found a way to run the solution without giving a specific output folder. I had to fix the output folder path to /bin in the csprojs and then running MSbuild with the solution was able to pick up those paths from the csprojs and build the output into those folders.

How to have Bamboo artifacts collect a whole folders?

I have one simple plan with one simple job.
Tasks:
Source code checkout
MSBuild
Run tests
Generate test report
In four steps, my utility generates a test report with screenshots. The report contain absolute links to images. (for example: onclick="window.open('./Screenshots/66ef3a03-8b82-4b40-b49d-b0155e273738.png');return false;").
If I open the report on my local machine, the report works fine, but on Bamboo I receive the error "Page Not Found", because Bamboo has not collected "Screenshots" folder.
How can I set up the Artifact Definition to collect folder with files?
P.S. I tried to set the \*.* copy pattern, but Bamboo collected only files (without folders and subfolders)
You just have to give the folder Location, like "build/", for instance, and then, in the Copy Pattern you can put **/*.* That should copy all the files you want.
Please note that:
The location is relative to the build directory. Do not use the absolute path to refer to the location.
Asterisks are not supported for Location. For this field, provide the folder name where the file would be located.
Plus, you can define as many Artifact Definitions as you want.
The best way of doing this is to zip all you artifact together. I created a bash script to do this
cd "toArtifactFolder"
zip -r Artifact .
Then in bamboo project settings you have to edit the Artifact and changed the location to where ever the artifact zip file is
Then in the Copy Pattern just enter the zip file eg Artifact.zip
Bamboo uses the "Ant file copy pattern".
Matching recursively against all files: **/*
This does include almost everything
Unfortunately this does not include dot-files, at least in my test on a linux build agent. I could not find a workaround apart from a second artifact (pattern **/.*) or the creation of an archive.
Matching against all files in any subfolder: */*
This does not include foo/bar/test.xyz
This does include both foo/test.xyz and bar/test.xyz
You can do more advanced matching; e.g. you can use build/**/*.jar to copy all jars from a build directory.
For further info see the docs

What does Main.1 output file do in XCode?

I made a sample project called "Stack", but realized that i needed some more data structures, so i renamed everything - the project, made 2 new folders & their matching groups in XCode, modified the Target Build path to look for "Main/DataStructures-Prefix.pch" instead. But there's one file i don't understand -> earlier, i had gotten a "Stack.1" in my folder, so i just renamed it to "Main.1" and it doesn't seem to be affecting the build process, but i'm pretty skeptical. What does this "Main.1" do? is it the linked intermediate file like in C/C++?
here's a picture:
"Main.1" is a template for creating a "man page" (i.e. an on-line manual page) for your program. You can verify that by calling
man ./Main.1
on the command line in the directory where "Main.1" is located.
If you run
xcodebuild install
on the command line then the manual page is copied to the
$DSTROOT/usr/share/man/man1/
directory, where DSTROOT is the "Installation Build Products Location". The file is not used otherwise in the build process.
If you don't need a man page, you can just remove the file from the Xcode project.

How do i navigate through folders in code behind?

I need to address a file in my code. this file isn't located in my main project, but in a library project. When i call AppDomain.CurrentDomain.BaseDirectory, i end up in the start project's (let's call it mainproject) debug folder. What i want to to is call appdomain.cd.bd and go up 3 levels, so i leave debug, then bin and then mainproject. Then i would navigate to libraryproject and to folder where file is located.
What i've tried so far is do AD.CD.BD\..\.. or AD.CD.BD/../..
I thought i remembered those, but it's a no go.
Does anyone know how to do this.
Thanks in advance
It is concerning to see you wanting to codify paths based on project build paths. What happens when you release the project and these project directories don't exist.
I would recommend that if there is a file your project needs to execute is from a library project that doesn't get copied across during the build that you use a post build step to copy this file to the same location as your assembly. Alternatively you may be able to set the build action on the file in your project which might get this file to your main project build output directory.
Three levels up would be ../../../ wouldn't it?

Bamboo artifacts

I am very new to Bamboo. I have got a html file generated using log4j. I wish to put it in user-defined artifacts but don't know how.
It is in surefire-reports folder so I tried giving Source directory as "**/target/surefire-reports/" and Artifact Copy Pattern as "**/*.html" but it doesn't seems to work.
Any idea how to configure it?
Try to change copy pattern to
*.html
and verify your complete path.
I wanted to get all surefire reports from each module, so I created a new Artifact definition with:
Name = Surefire Reports
Location =
Copy Pattern = /target/surefire-reports/.*
This was using Bamboo 3.2.2.
The Location field does not provide the Ant file copy pattern feature, only a fixed path is accepted relative to the working directory.
Set the Location as target/surefire-reports
and the Copy pattern as **/*.html
Also make sure that the Shared checkbox is set, otherwise other jobs will not be able to download the artifact.