Deployment Package doesn't contain all latest files - deployment

I'm trying to deploy a solution, but every time I try to deploy (either using one click deployment in visual studio or teamcity). My deployment doesn't seem to have all the files that should be there.
I've set up the publish profile using Webdeploy in visual studio. What I have noticed is that the deployment package (which ends up in an Obj folder within the project directory) doesn't seem to include the files as I would expect them to. E.G, there was a file in my App_Config folder which I renamed, the package doesn't have either the file (in the old/new format)...
I've tried deleting everything on the target machine, so I am sure that the deployment is working, it just doesn't seem to be packaging correctly before deployment
Any ideas?
Thanks
Nav

I've been trying to work out why some files haven't been deploying, it seems that you can define the build action on a per file basis, for some reason this one file I needed didn't have the the same build action as other similar files.
If you have similar problems, hopefully you'll find this answer and won't spend days trying to resolve it like I did with trial and error. All you need to do is;
Right click on the file in solution explorer,
Click properties
Set the appropriate 'Build Action' (for me it seems the appropriate Build Action was Content.)
Make sure that the 'Copy To Output Directory' has the appropriate configuration for your needs. For my purposes I set this to 'Copy Always'

Related

Unable to get xcode project to index appropriate directories

So I had to delete my project and then reclone it from my repository, but when I clone down the project and I open it, other files from some time ago show in there, how is this possible?
Example this is the cloned directory:
But when I open the project, it shows this project structure:
Also it produces the following error when attempting to build the project:
Build input file cannot be found: '/Users/Development/Projects/MapGlider/Application/Utilities/Extensions.swift'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
All help will be appreciated!
The structure of the project as you see it in Xcode is a combination of file system + information about your project in YourProject.xcodeproj/project.pbxproj file. So you have a mismatch between file system and that file, which is typically a result of inaccurate checkin (for example some changes were done directly in file system, and the project was not updated), or a bad merge (developer A did everything right, developer B, or even the same developer on a different branch, overrode those changes incorrectly).
So what you need to do is to fix those errors one by one.
Note: the steps below assume the project is in your control. If you are using some script or tool to generate the project, you will have to address those issues via that tool or script instead.
First, fix the project structure:
Make sure Inspectors on the right side in Xcode are open. Choose File inspector tab
Focus on a folder inside Xcode, and check Name, Location and Full Path of the folder. Especially notice the Full Path, if it's incorrect, change it to a correct one. Here's the example how. Repeat for all folders and files you want to have in the project
Delete all folders and files you don't want to have in the project from Xcode. For example you can delete Extensions which appears as a file in your project, while it's actually a folder. Typically while deleting you should be able to delete them from file system as well if it exists, but if not, you can double check in file system and delete files / folders from there as well.
Add folders and files missing from the project if needed. Follow Add existing files and folders to a project section in the linked page.
Once you cleaned up the project, you need to review / fix all your project targets:
To fix the Project targets
Try to build each target. If it succeeds, most likely everything is resolved (although watch out for runtime errors for resource files - so you may need to test your app to ensure nothing is missing too).
If building a target fails, you will need to see why. For example
if file is missing from the target, but you already added it to the Xcode project, you can add it to the target (see this page).
if file is missing from the target and is not visible in Xcode, go back to step 4 of the previous procedure and add those files to Xcode project, and then add them to the target
if a file is nowhere to find and is not needed, you can delete it from target. If it was needed, then... well, you have a problem and need to locate your missing code in your source repo or rewrite it.

Specify Eclipse CDT Default Launch Config

PAIN POINT:
Using Eclipse CDT - the launch configs I need are rather complex (little settings that are non-default values and other misc things) too many little things to remember, and easy to skip then stuff does not work. I want to be able to semi-automate this process in project makefiles.
Background:
I have multiple projects, not stored in the workspace (my users "import the project"). In some cases projects are some what generated (they are external makefile projects.
Requirement: Specifically depending on what build configuration is required the launch config needs to change/tweak, the external Makefile can do that, or I can create one launch file for each config. Or I can pre-populate them when I create the project
[example is normal development, debug/release but with unit-test variations]
The user might tweak the settings of course and want to save them.
Requirement: So that the launch files "travel with the project" - I want to check the into GIT, thus I want the .launch files kept in the same directory as the .project and .cproject files - as described here (thus they can be checked in and things are "self contained)
Store run configuration with project in Eclipse
PROBLEMS and QUESTIONS
1) Given existing launch configurations files (.launch files) in the ".project" directory, how can I browse/select from the list of existing ones that Eclipse does seem to previously know about.
{Example: Create a launch config called "FOO", copy this to "BAR", edit the BAR config file, replacing internal occurrences of FOO with BAR)
The BROWSE button in the "common" tab lets me select a directory to save but does not allow me to select an existing file
2) How can I tell eclipse File (X) is the default launch configuration for this project, or config(X) uses file(A) and config(Y) uses file (B)
3) Is there a way within the ".project" or ".config" or ".cproject" files to specify where to look for launch configurations, where to offer them?
4) Sure would be nice to have a file (or place in the .project, or .cproject) file that says: Launch configs for this project are in this directory - offer the user a list based on the files present in that directory
bottom line:
I'm sort of stuck - I can create launch files "correctly" with all required settings but I seem to have no means to tell Eclipse to use select/use them.
No amount of automation here seems to work, and I end up having to go back to manually creating and humanly forgetting settings in the project files.
Places I've looked:
Sort of the issue but not exactly
https://superuser.com/questions/521537/remove-launch-from-run-debug-drop-down-in-eclipse
Below - ARM describes the IMPORT process, but in my case all ".launch" files are grayed out and not selectable I don't know why and that is a different problem
I'd like to not make this a multi-step process - also see above about removing stale launch configs - you end up with too many launch configs in the history.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0446h/CJADBBIA.html
There are numerous other places but all seem to be "click here" or "use this menu item" and not addressing the external file issue.

Nuget how to add files to solution folder

I have a package that contains some files that I want added at a solution level rather than a project level. I am able to add a folder at the solution level, but cannot determine how to add my files into to this folder.
You can do this by placing your code in the init.ps1 file. install.ps1 only executes with project-level packages. Because the code will be in init.ps1, it will run every time the solution loads - not just at install. so you will need to safeguard against re-execution. See this post for a code example - You'll just need to add a step to copy from the tools folder to the solution folder.

Resources check

hey I am frequently uploading my XCode iPhone projects to an svn repository to be build on another machine.
My problem is that when I add resources to my project sometimes I forget to add the resource as relative to the project.
I know one answer is to be more careful (not easy when your tired!) but if there was a way to run a script to check my resource paths are relative when I build and warn me if they are not it would be a great time saver for me.
How would I go about doing this?
Thanks
Chris
You can select all the files in your project and set the Path Type for all of them in one go. While this isn't a script this does save a lot of time over doing the files individually
I think the best approach to script this would be to look in the .xcodeproj file - the file paths are listed in there. If your project is called MyProject you need to open (either by using Show Package Contents in Finder or just the usual cd in Terminal) the MyProject.xcodeproj directory.
In here you'll find a file called project.pbxproj - open this in a editor that won't mess up your formatting and have a peek around the file. If you search for one of your files in the project you should be able to see how Xcode stores references to the project files.
Look for a section named /* Begin PBXFileReference section */. In here all your files are listed, along with where they are relative to the project, e.g.:
... path = Classes/MyClass.h; sourceTree = SOURCE_ROOT
If you can parse this file you should be able to acheive what you want - but remember to back up the file, otherwise you might corrupt your project.
How would it be if you instead write a script that asks the SCM if anything in the project is not committed? For example, think of this scenario
Project Root
Codex
Project.xcodeproj
…
Design
anImage.png
where anImage.png being outside of Codex, where the Xcode project sits (its path starts with a ../). A strong .pbxproj parser would have to support all the variants in which Xcode references files to know exactly if there are stray files.
OTOH, the SCM knows where everything is all the time (you mentioned up-ping to a SVN server), so why not ask it instead.
We have a Ruby script that prints a warning in Xcode’s Build Log if anything in the project is not committed.

Why are static library headers not found?

I've used Clint Harris' tutorial to set up code sharing between projects, and everything works just as expected on my computer. But on my co-worker's machine, it seems the compiler doesn't find the header file from the static library project when he builds.
My co-worker got my project by cloning a git repository. We've gone through all relevant build flags and XCode settings n times, but the project simply refuses to compile on his machine.
This is what I asked my co-worker to do, mostly copied and pasted from the tutorial:
Make sure there is NO blank space in the complete path to the projects' directory.
Inside the projects directory, create another folder called "build_output".
In XCode, under “XCode > Preferences" choose the "Building” tab and set “Place Build Projects in” to “Customized location” and specify the path to the common build directory you created.
Set “Place Intermediate Build Files in” to “With build products.”
Choose the “Source Trees” tab and create a new Source Tree variable by clicking on the “+” button and filling in the columns. In both "Setting Name" and "Display Name", put
[the name of the shared project which created the static library]. In path, you put the full path to the framework folder.
Following these steps, the project that uses the static library should compile the same on his machine as on mine. But it doesn't. Basically, the error he gets is:
error: TheFrameworkHeader.h: No such file or directory
and then a string of other errors caused by the missing header.
Any strategies for trouble-shooting this? Or anyone who had a similar experience and could share some hard-earned knowledge? Is anything missing from the instructions I've summarized? Do I need to set the roles of headers in the Copy Headers build phase when compiling a static library?
Despite some helpful advice, I never figured this one out, but here's a little info for anyone in a similar situation. I created the library and dependent project by splitting an original project into two. At first, the library and application were just two targets within the same project. Later, I moved the app to a separate project. Everything seemed to work, and I pushed both projects to remote git repositories. When these were cloned on other computers, however, the library headers were not found.
Later, I discover that the same error occurred when I cloned the projects on the original computer. After a lot of struggle, I pinned it down to one scary detail: the name of the dependent project's folder! (That is, the project with the application, not the library.) Not the name of the .xcodeproject package, not the application identifier, but the name of the containing folder. As soon as I change that, everything works. If I change it back to the original name (on any computer), again the headers are not found.
If anyone has any insight on this, please post an answer!
EDIT: Since I posted this, the same problem occured with another project, and again, merely renaming the folder that contains the .xcodeproject folder fixed the problem.
I don't think it is Git, I think it's xcode. I got a very similar problem here, where xcode / xcodebuild resolves an include path falsely (making it a simple .) With the exactly the same library project and xcconfig files (clean checkout from svn repo) but another containing folder - it works. So, thanx for the solution and don't blame Git anymore ;-)
I often forget to check this: are you sure that the missing file (i.e., TheFrameWorkHeader.h" is in the git repository? It may well be that your build settings are correct, but the file somehow did not get added to git correctly.
If you're having trouble building on a particular machine, then the problem likely is a machine or user setting. Such as an environment variable (perhaps INCLUDE_PATH or one of its relatives -- XCode uses GCC). You may have a "." in one of these variables.
The best way to fix this would be to add the needed folder path to the -I switch in the build script.
Double check that the "Search Paths->User Header Search Paths" build setting (for all configurations) points to the directory containing the shared Xcode project (you can use the new Source Tree variable you created).