In xCode I can add resources (folders, documents) to "Copy Bundle Resources phase". The first time, the resources gets deployed correctly. But after that each time, they don't get updated. I have to clean and rebuild again. Did I miss some important setting? This is especially annoying if you deploy JS files and changed the code in them. The simulator will still run the old JS code.
Related
I'd like to do the inverse of this question/answer:
How to include TypeScript files when publishing?
The thing is that I'm trying to publish an ASP.NET MVC 5 Project. Unfortunately the dreaded Visual Studio and the hungry Jack Typescript interpreter ignores any tsconfig.json file and decides to go deep down and look for any .ts file that is not accompanied by a .js. I have lots of npm packages nested down and some of them have uncompiled typescript files.
Funny thing is, that they are not included in the project (not even an exclamation mark). (I even checked for the .csproj and no files were found).
Is this a bug? How can I prevent this from happening? Using VS 2015.2 (Update 2).
I had a very similar issue. Publish kept failing because it couldn't find foo.js as it wasn't in the same directory as my ts/tsconfig files, even though outDir was set to another location. I don't know if it is a bug or not but I couldn't figure it out using the tsconfig. Instead, I was able to get things working by using the inbuilt TypeScript Build settings instead.
First, I deleted all tsconfig files from my project (I made sure I kept a backup just in case). The TypeScript Build was originally greyed out because I had the tsconfig files in my project.
Next, I created a new folder directly under Scripts to save the js files into.
I then went to Project Properties and selected the TypeScript Build tab. Under Output, I checked the Redirect JavaScript output to directory and browsed to the newly created folder. I repeated this for all build configurations.
Finally, I included the new folder in my project and then built. Folders and files which aren't included in the project can be seen as a ghost icon in the Solution Explorer if you have Show All Files icon selected. I think that if you have multiple TypeScript projects with their own tsconfigs, the file structures are replicated under the chosen output directory but I haven't tested it in many cases so I'm not certain.
Obviously I had to redirect my script bundles to the newly created js structure.
When I first followed this process, I got a few build errors mainly due to my own daft mistakes in my TypeScript code which I'd set the tsconfig to conveniently ignore. Another error was multiple references for objects, which I managed to fix by deleting the definitions files and making sure that the Generate declaration files option was unchecked in Typescript Build. Once I fixed those issues though, I was able to publish without that annoying error - happy days!
Using Visual Studio Express 2013 for Web
Set up bundling and caching as generally described here: http://www.asp.net/mvc/overview/performance/bundling-and-minification
In the VS Solution Explorer, individual file properties for .js and .css files are set to Build Action: Content. I don't know if this was specifically set or a default setting.
When deployed in Debug Mode, individual files are deployed to the destination server's directory structure as expected and the rendered code in the index.aspx head section has a long list of for each individual javascript and css file configured, again, as expected. When loaded, I can see that the files are being loaded individually. Everything works.
When deployed in Release Mode, however, individual files are still being deployed to the destination server's directory structure, non-bundled and non-minified. Index.aspx DOES reflect a rendered reference to each bundled "file" using . When loaded, I can see that things are being loaded via the bundle.
In Release Mode, the individual files deployed to the destination server's directory structure seem to be redundant, and certainly unwanted. However, if I remove them post-deploy I get reference errors. Similarly, if I change file properties for each file's Build Action: Content to Build Action: None, the aforementioned individual files aren't deployed in Release Mode OR Debug Mode and I get reference errors in both scenarios.
Question 1: Am I misunderstanding how bundling and minification works and these individual non-bundled, non-minified files are indeed required in Release Mode?
Question 2: If I understand correctly that these non-bundled, non-minified files are NOT necessary in Release Mode, how do I configure the deploy correctly such that they ARE deployed in Debug Mode and ARE NOT deployed in Release Mode AND I get no reference errors?
Answer 1: Bundling and minification are done at run-time, not at build, compile, or deploy time. The "bundle" that is downloaded is a virtual file, it doesn't actually exist anywhere on disk. Thus the original "source" files are needed.
Answer 2: Sorry but your understanding is not correct. The non-bundled/minified files are required in Release mode as they form the basis for creating the bundled/minified payload that is sent to the client.
I have this project hosted here:
https://github.com/thistleknot/DiffMatchPatch
I was VERY meticulous and verified each of my commit’s ran a successful compiled version.
However, now… no matter what commit I use, by copying to a new directory, or try to create a new blank project and import old header’s, forms, and cpp files in… I can not get the app to run. It builds, just never opens.
I even tried debugging my main function by inserting breakpoints and it just skips right by them.
Any ideas? This happened to me last night when someone was assisting me. The compiled app just exits from task manager with no errors or messages. It does ask if I want to run as admin however. But that’s it.
You're building on a platform that doesn't inform you of things that are wrong. Namely, there are two main symbols in the project. You can't have the test harness and the application under test in one project. Those need to be separate projects.
Simply remove diff_match_patch_test.[cpp|h] from the project and you'll be all set.
I have almost finished the development of a project developed with Symfony2, and wish to put the project online.
However, I suppose there are a lot of things that need to be done so that everything works ok. I suppose, the dev mode needs to be disabled etc....What needs to be done and how?
What are the most important things to do on a Symfony2 project that will be available to everyone on the web?
I suggest you to use Capifony for deployment. It does a lot of stuff out of the box and you can make it run any custom commands you need. See its documentation for details.
Regarding the dev mode, unless you've removed the IP checks from app_dev.php, you don't have to worry about deploying it. Of course, if you wish, you can tell Capifony to delete it on deployment.
The best way to handle deployment is to create "build" script, which will:
Remove all folders and files with tests from your bundles and vendors.
Remove app_dev.php file
Make sure that app/cache and app/logs are fully writable/readable.
Packs your project into archive (rpm f.e.)
Then, before deployment, you should create tag in your project - so it will mean, that certain version of your application is released (I recommend to follow this git branching model).
Create tag.
Run your build script
Upload archive to host
Unpack
Enjoy your project
Im currently researching the same thing.
The first thing you have to consider is "how professional" you want to deploy. There are a lot of tools you can use:
Continous Integration Server ( e.g. Hudson, Jenkins)
Build Tools (e.g. Phing, Capistrano --> Capifony, Shell scripts)
Versioning Tools (e.g. Git, SVN)
I think the simplest setup is using only a Build tool and i guess you are already using some kind of versioning.
Depending on which tool you use, the setup is different, but I think there are some things you should consider with your application (maybe not all are applicable to your application)
Creating a Tag in your Versioning
Copying the new Code in an folder on production
--> if you are in a new folder you dont need to clear the cache and logs, since these shouldnt be in your versioning the first time.
loading composer (if youre using it)
installing vendors
updating database schema
install assets from your bundles
move symlink from current version to the folder of the new site
These are the things I currently need for my application for production deployment, if you deploy to an test environment you should load fixtures and run your testscripts as well.
One other option that is very well described here is to deploy the Symfony2 application with Apache Ant. Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.
I have a solution with a fair few projects, 3 of them web-based (WCF in IIS / MVC site). When the solution builds, it dumps each of the components of this distributed system in a 'Build' folder. Running the 'configurator' part of the whole output will set up the system in the cloud automatically. It's very neat :) However, the Web Deploy Projects are a major pain. They "build" (i.e. deploy) every, single, time I build - even when no changes have been made to their respective projects.
Changed a single line of code? Look forward to waiting around a minute for the 3 web projects to redeploy.
[These projects are VERY straightforward at the moment - two have a single .svc and one .ashx file - the other is an MVC app with ~5 views]
I realise I can change solution configurations to not 'build' them, but I've been doing that and it's very easy to log on the next day and forget about it, and spend a couple of hours tracking down bugs in distributed systems due to something simply having not been built.
Why I use Web Deploy Projects? Well, because I need all pages + binaries from the web project. The build output for the project itself is the 'bin' folder, so no pages. The entire project folder? It has .cs, .csproj and other files I don't want included.
This will be building on build servers eventually, but it's local at the moment. But I want a quick way of getting the actual output files from the web project to my target folder. Any ideas?
Not sure if this will help in your situation, (plug for own project coming up), but I am working on a project to help ease IIS deployments:
https://github.com/twistedtwig/AutomatedDeployments
The idea being you can use config files for IIS (app Pool, applications and websites) to automate the creation and update of sites locally (dev machines) or remotely (test and production machines).
It is still a work in progress but is ready to be used in production systems.
using the package creation as a post build step might get you closer to what you want, (don't believe it includes all the extra files), but that would still build it each time, (although if code hasn't changed it should not rebuild unless you choose rebuild all projects).
In the end I created a utility/tool which, given a project file, XCOPYies the project folder for the web project to a target location, then looks in said project file and deletes anything that doesn't have Build Action set to Content. Very quick and effective.
I know it is still in RC but VS2012 does have a neat feature when doing publish that it detects the changes and publishes only those. Might be something a little deeper down in the build where it does an automatic publish too.
You can take a look to the Octopus project: http://octopusdeploy.com/
Deployment based on nuget packages.