Automatically Compressing Published Files Into a .ZIP File - msbuild

I am currently using Teamcity to automatically build and publish our solution to a directory specified in the system.PublishProfile property (i.e. C:\Deployment Files).
Is it possible that after publishing TC will automatically .zip them into one file with a custom set file name?

When you define Artifacts paths inside General Settings tabs, you can set:
./out/Deploy => %BuildName%.zip
And, inside Parameters, you can specify the BuildName value.
This will produce a zipped artifact.

Related

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 properly specify DocumentationFile in MsBuild 15 .csproj with multitargeting

I am using the latest preview of MsBuild 15 and I have a multitarget project file targeting both net40 and netstandard1.6.
I am struggling with specifying <DocumentationFile> correctly.
For any path I would specify, the resultant xml file after the build will be both in that path and two target output directories.
For instance, if I specify
<DocumentationFile>doc.xml</DocumentationFile>
Then the xml file will be generated both in my project dir and bin\net40 and bin\netstandard1.6.
I need those xml documentation files only in my bin\net40 and bin\netstandard1.6 directories. How can I achieve that?
Also, with the current behavior, it is not clear which documentation file is copied to my project dir, because those xml documents can differ for two targets.
In earlier project versions I used to specify documentation xml path separately for Debug and Release build configurations with paths like bin\Debug\doc.xml, but with the newest MsBuild 15 it is possible to do multitargeting and the number of such paths double if I specify the dir for all possible combinations of target and build configuration.
Is there any generic good way to specify documentation file path once and get it to the right output places only?
From my testing if you specify
<DocumentationFile>bin\Debug\netstandard1.0\MyProjectName.xml</DocumentationFile>
it will create doc file in each multi-targeted folder so it'll create
netstandard1.0\MyProjectName.xml
net45\MyProjectName.xml
netcoreapp1.0\MyProjectName.xml
netstandard2.0\MyProjectName.xml
etc.

Where can I find the rootfolder for my VB.net project

I am making a project that will be put on a disc to use. This means that all of the files that I call upon have to be on that disc. How and where do I put my files to ensure that they will stay with the project? Does it go in the bin folder? And when I am calling on that file what file path do I use?
In general, the bin folder is not a place you should be storing anything that you want to persist with the project.
When you build, Visual Studio will copy the files needed to run the program into the bin folder, such as libraries and web.config or app.config files.
For other files you want included, add them to your project and set their build action property to Content:
Content - The file is not compiled, but is included in the Content output group.
For example, this setting is the default value for an .htm or other
kind of Web file.

How can I write into a file within an Eclipse bundle?

I have an xml configuration file located into my plugin resources. I want to update this file whenever in the plugin happens some event. I found some methods to find and read the contents of a file located my plugin classpath, but I'm looking for a way to write into such a file.
Is there any way?
Many thanks.
That location (the install directory) is intended to be read-only since it may be shared in a network install scenario. I suggest you instead write the XML file to your plugin's state location which is intended for just this purpose:
String path = Activator.getDefault().getStateLocation().toString();
I should add that this gives you a fully qualified path to the directory created by Eclipse for any files your plugin wants to store. This directory is unique to your plugin.

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.