Nuget how to add files to solution folder - powershell

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.

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.

Configure Project / Clean to delete temp files

Is there a way to configure the clean functionality of eclipse?
For example that all *.sqlite files are deleted if i execute the function.
This is necessary in my project cause i haver diverent temp outputs like csv or sqlite files. And it is anojing to delete them all by hand.
The fastest way is by create a batch file located
For example in your desktop contains some thing like that :
del C:\blablabla\yourprojectBath\*.svc
del C:\blablabla\yourprojectBath\*.sqlite
The clean functionality of Eclipse is limited to cached information and metadata associated with a project. It does not delete free form files.
The only solutions that I can recommend are:
Have your code clean up previously generate files
Use a solution as presented by Ahmed above.
Make use of Ant functionality inside of Eclipse. Create an ant
build.xml file with a clean target. Then click once on the file to highlight it and right click->Run As->Clean. The menu should show you the
different targets you can run.

Deployment Package doesn't contain all latest files

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'

How to have different file links to an Eclipse project (not importing it)?

I noticed when I import a file, the file is copied to the work space, but can I just create a file link in a Eclipse project? So when I modify the files in Eclipse, the files in the linked location is modified. In this way, I can version control the files using SVN. And I don't need to copy the modified files back to its dedicated directory when deployment.
The following is a more detailed description of my problem:
I have a cgi application located and runs in apache. The app runs with diff configuration files for different 'projects' which is more like showing different dataset with its corresponding configuration file. My task is to write the configurations files which will require some perl callback functions, css files and images. All these files have their own dedicated directories located in different places in the company server which i have not much control with.. So far, I just use command line to modify files and keeping old copies for version control. If I can do something like my above description, I will be able to have a central place to work on and do SVN. Or do you have a better idea how I should set up my work environment?
Thanks heaps in advance.
Yes you can,
File -> New File -> Advanced (at the bottom) -> Link to file in the file system
Manu
I have figured out a way to conveniently to version control files from different places and can deploy them to the correct directories after modified. It's ....... using..... the ANT build file... I just have all files imported to a single project and use an ANT build to distribute them back to their corresponding destination.
Use svn:external http://svnbook.red-bean.com/en/1.0/ch07s03.html
One drawback though, you have to update your other projects once you commit a shared files.

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.