I have set up a hosted mac os preview build for a Xamarin app. All the steps complete except for 'deploy ipa' The publish artifact says nothing will be added. Here is are the settings from the copy files to as well as the output
Seems you set the incorrect Source Folder or Contents pattern in Copy Files step. That caused no files were copied to target folder for publishing.
Please check the logs of Copy Files step to see if the *.ipa files are really copied to $(build.artifactstagingdirectory).
If no files copied, then just check the build logs to get the real working directory (Source Folder in copy step) and make sure the *.ipa files are generated in the directory. (By default it's $(system.defaultworkingdirectory) on my side.)
If the real working directory is just the Source Folder $(Build.SourcesDirectory) you specified in Copy step, then the problem should be the contents pattern.
Contents specify minimatch pattern filters (one on each line) that you
want to apply to the list of files to be copied. For example:
** copies all files in the root folder.
**\ * copies all files in the root folder and all files in all sub-folders.
**\ bin copies files in any sub-folder named bin.
Related
Say I have certain file d:\homework\week1.pdf which requires constant backup to another folder e:\backup. How can I get windows10 to automatically copy and overwrite the file week1.pdf from source folder to target folder when I make change to it? I don't want other files except week1.pdf in source folder copied.
Similar to the question here: Copy one file in target directory on deploy from visual studio team services, I am trying to copy the contents of the app.publish directory of a ClickOnce application via VSTS build/release.
This is the Copy Publish Artifact step of the Build
This obviously outputs everything in the bin folder to the drop folder on the server share.
This is the Copy Files step of the Release
This copies only the files in the app.publish folder but it builds out the entire hierarchy to the folder app.publish folder; however, it builds out the full folder structure. i.e. bin\Release\app.publish or bin\Debug\app.publish.
I like the idea of being able to publish and store different configurations (debug/release) but I don't like that I'm having to specify the InstallUrl in the msbuild arguments in order to pick up debug/release in the folder path. Even if I didn't try to maintain multiple configurations, the configuration would still be in the path.
So my question is: Is there a way to use the copy files task to just copy the app.publish folder and/or the contents to another location, without it creating the full hierarchy?
You need to specify the copy root in Source Folder of Copy Files, in your example, the copy root should be like:
Source Folder: $(System.DefaultWorkingDirectory)\$(Build.DefinitionName)\bin\$(BuildConfiguration)\
Contents: **\app.publish\**
In this way, you should only have app.publish in your Target Folder.
Configure the "Copy Root" of "Copy Publish Artifacts" step in your build definition to the path of build configuration folder and "Content" to "**".
For example, if the path of your build output is:
C:\a\1\s\SolutionFolder\ProjectFolder\bin\Relase\app.publish...
You can set the Copy Root to:
$(build.sourcesdirectory)\SolutionFolder\ProjectFolder\bin\$(BuildConfiguration)
And Content set to:
**
What is the difference of the working directory vs the output path in visual studio?
Is it bad to set both setting to the same directory like '....\bin\'
By default they are the same. Assuming you're debugging some application it will be bin\debug.
Output Directory is where your output files goes. By default, Visual Studio builds each project in a solution in its own folder inside the solution. You can change the build output paths of your projects to force all outputs to be placed in the same folder
Working Directory is the location which Specifies the working directory of the program being debugged. It is the default place in which a program is looking up it's files. Normally the working directory is the directory the application is launched from \bin\debug by default.
So every opened file will be opened relative to the working folder.Let's say if you have an application installed in c:\myapp with all lib files in the same directory then you will set your working directory to myapp folder and you can do so from project properties.
By default, working directory is the output directory. Both can be changed, you can set another directory or common directory for all projects for output directory that determines a relative path for the output file that might be an executable or a static library.
Working directory also provides a relative path to put files that are used by the program. You can put a log file into a place that you can use its directory as a relative path in the code instead of absolute path. If your working directory is myproject\src and your log file is in myproject\src\log\log.txt then you can open or write the log file with log\log.txt in the code rather than c:\blabla\myproject\src\log\log.txt.
I'm writing a cocoa application which should copy files to a given directory. The files should be part of the app, but not compiled. I'm thinking of a folder, e.g. "MySources", where I want to add all .a, .m and .xip files, which should not be compiled. These files should be left as they are - so plain and editable text. Then my app provides a button and when a user clicks on that button, the app copies all files within the "MySources" folder to a given directory.
Add a Copy Files build phase, configure it to copy to the desired destination within the app bundle, and add the desired files to that build phase.
In Target > Build Phases remove the appropriate files in Compile Resources and add Copy Files build phases to copy the files to the destination locations in the bundle.
When you add a folder that contain subfolders and files to the Xcode project, the Xcode ask you about the folder option:
Create groups for any added folders.
Create folder references for any added folders.
I want to download the folder from a server. When the download is complete, the folder option will be 1 or 2? How can I set the folder option to option 2?
When Xcode references a folder, it uses whatever files are stored at that location on your local disk. If you download a new file to that folder or copy a file into that folder, it will show up in your Xcode project. If you change a file in that folder (by overwriting it in the Finder, or by using another app to download another copy of the file over the existing one), Xcode will use the new one.