A weird phenomenon in Ember-CLI dist/, I cannot modify anything inside it - ember-cli

In my Ember-cli project, I put some static assets, such as images and icons into the /dist/static/image directory. Then I build the project (I forgot the details in this part).
Then when I tried to modified some picture inside that folder (I wanted to change some parts to be transparent), I found that I cannot change anything inside.
For example, when I used a new pic to replace the old one, and then I run ember, I found that the new pic was replaced by the old one automatically.
I am not so sure about the internal mechanism, and I tried to use git, but that didn’t help.

/dist is just that - it gets wiped out on each build and reloaded with the distributable files. What you are looking for is /public

Related

Re-generating assets for Flame Game with Very Good Ventures template

So I'm building a Flame Game, and I found this template (the actual code that comes with the template is here) made by Very Good Ventures (it's the one used in the Pinball project made for Google I/O).
I'm just writing my code, and added my assets in the assets/ folder, so far I only need images so I deleted all the other assets that came with the template and the unnecessary folders. Thing is, I don't know how to re-generate the gen/assets.gen.dart file to reflect the changes I've made to the assets/ directory. I've tried running my app but I obviously get an error because the assets I'm trying to load are not defined.
I tried to look up what command is needed to regenerate the assets file, and most solutions I found included this line of code which requires the build_runner, flutter_gen and flutter_gen_runner dependencies.
Now, I don't mind adding new libraries if necessary, but if they are needed, shouldn't those be in the pubspec.yaml of the template to begin with? I even checked the Pinball project repo to see if they had to add those dependencies and their pubspec.yaml does not include any of the runners or flutter_gen.
Anyway, I still tried adding the libraries and running the command flutter packages pub run build_runner build, which manages to regenerate the assets.gen.dart file to include my images and delete unnecessary directories but I still get an error.
When I do
loadSprite(Assets.images.ramp.path);
(just like they do in the VGV template), I get a red screen error because apparently Assets.images.ramp.path gets evaluated to assets/images/assets/images/ramp.png (there's an extra assets/images/).
After checking the assets.gen.dart file it seems like the VGV template creates the class AssetGenImage extends AssetImage while the flutter packages ... command creates an AssetGenImage that doesn't extend AssetImage.
I'm pretty sure I'm missing something here, because both the VGV template and the I/O pinball project manage to regenerate the assets files without issue. I just don't really know what I'm supposed to be doing.
(just in case, I have not changed anything else in the pubspec.yaml apart from removing the lines that pointed to the other assets directories I didn't need like assets/audio/ and adding the 3 new dependencies)
so you are probably getting this error because Flame by default adds a the assets/images/ prefix path on its image loading code.
That is why on your error, you are seeing that part duplicated.
To properly use flutter gen, which generates the full path of the assets, you can simply "clear that prefix", which you can do just by doing so on your game class, you can do this as the first line of your onLoad method
images.prefix = '';

What should be stored in source control for an Asp.Net Core MVC application?

With the new Asp.net Core MVC projects such as:
There are a lot of unfamiliar folders there, like bower_components, wwwroot, Dependencies, etc..
What should be stored in source control?
Anything that is a project setting, or that you directly change you should store. Anything that is directly downloaded (references, bower/node) or is directly based on those (lib folder getting copied by gulp) should be ignored.
So, in your case, ignore bower, node, and project\wwwroot\lib. You want the wwwroot folder if you have custom css or js.
I went with
(With green being yes, red being no)
The only unlisted exception was the .xproj (and for TFS the .xproj.vspscc).
I deleted the folder from my local workspace (after backing up to somewhere else) and restored from source control and everything seems to behave as it should, once all the packages restored themselves.
This assumes that the gulpfile.js is configured to move the needed css, js, font components into wwwroot.
Also since I wrote this, there is a launchSettings.json within the properties folder that I've source controlled (Not sure why it's only just generated).
My .tfsignore file is currently:
project\wwwroot
!project\wwwroot\web.config
project\node_modules
project\bower_components
(which seems to be OK so far, but would potentially change if other static resources such as JS, CSS and Images were added in.)

Are images copied to Xcode project

Ive had some svn woes with an Xcode project and now using an older version from another user (we've taken it out of svn now).
Trouble is it looks like images have been lost on the way. Or more correctly, they load in the app when testing locally, but when I Archive the app and add to Testflight the images arent complied with the .ipa
There are alot of images and its really hard to tell what has been copied to the project and what is being taken locally. Is there a method of finding out how to do this more easily than deleting the image out of the app's file system, then from inside xcode then re-adding them from a local copy?
Answer was to go into the Build Rules, delete all the image from the Copy Bundle Resources section and re add them to the project - fun!
Go to SCM from Left hand side project explorer.
Expand SCM -> you will find images in red color which are in SCM but not on your local.
You have to right click-> Update it
Then open you project in Finder and find your image and just create relative path in your project.
Hope it helps....

How can I tell xCode to recheck project resources that have been modified?

I'm working with a designer friend on an iPhone app and he likes to refine all sorts of images relating to the project we're working on. All these images have been added to the project previously (and added to the project folder by xcode) and then are modified in their new location. When I preview the images in xCode, the updated images show up but building and running in the simulator or on a device doesn't pick up the new image. In fact, if I do a clean build it seems to ignore the image all together and blank spaces appear where images should be.
Now, I can delete these files from the project and re-add them and everything works peachy again. But there are a lot of them and I'd rather not do that every time an image is updated. Is there a way to get xCode to review and "learn" about these modified images? Is there a good reason for why it's not doing that automatically?
You didn't specify how you're including those image resources into your project, but I'd guess you're including them directly. So unless there's an underlying process that's changing the file in-place (are you using an SCM like Subversion or Perforce?) you're going to be forced to manually overwrite the files whenever your artist friend updates them.
You should include art assets in the project using a folder reference instead. (I'm still assuming you have some sort of SCM set up to handle exchanging data -- if you don't, set one up ASAP.) However, there are still some outstanding Xcode bugs related to picking up changes to files in a nested folder hierarchy included by reference, but at least you can work around that by doing clean builds when necessary.

How do I properly add existing source code files to my Xcode project?

I'm new to iPhone development and I'm still getting familiar with the Mac dev environment, including Xcode. I want to add some 3rd party code to my iPhone project, but when I add the "existing files" to my Xcode project, I'm presented with a dialog box that has far too many options that I don't understand and, as such, my project isn't working. When I #import headerfilename.h, I get a build error that reads headerfilename.h: No such file or directory.
alt text http://joecrotchett.com/images/misc/fileadd.jpg
Can anyone explain to me what all these options mean or give me a link to some documentation that can? I'm having a hard time finding anything in Apple's docs.
Which options do I want to choose to add existing source code files to my Xcode project? I should note that the source code files that I'm trying to add are located in my project/Classes/frameworkname/ directory.
After they're added, do I need to reference this new code directory in my project settings anywhere (i.e. some kind of header file directory variable)?
Thanks so much!
Update: I found the following answers/responses on the apple dev forums that were very useful and helped me fix my issue...
To make it simple :
- if you do not check the copy option, the file stay where it is.
- if you check it, it is copied in your project folders In the first case
(what it seems you are doing) you need
to tell the compiler that the header
files are in another directory :
- project info -> build -> search paths -> User Header Search Path : add
the directory from where you took the
header file Hope this will help
You have discovered the most confusing
dialog box that ever came out of
Cupertino. Six years of Xcode, and
this thing still is partly a mystery
to me. To even get that far, I had to
make many test projects to try and
reverse-engineer what this thing does.
The "Copy" box means that it will copy
the files as they are right now, into
the project. If this box is not
checked, then it just references those
files during a build and copies them
as they are at THAT time. For source
code, you want the Copy box checked.
The "relative to" is a total mystery
to me and I can't help you with that.
I usually leave it however it is
already set. Does it mean relative to
where they are on disk, or the
arrangement in Xcode, or in the
bundle? Who knows. The last 2 radio
buttons SEEM to mean that it will
either re-create the folder structure
of the folder you are adding, or just
put "fake" folders in Xcode that point
to the real folders. This is probably
your problem - you are adding source
code that is not all at the top level,
and when it goes to find it, it does
not re-create the hierarchy. Others
can supply a better way, hopefully,
but what I would do is put all of the
source in one folder and add that,
using the Copy box. Then in Xcode you
can make whatever bogus folders you
want and put the source file names in
those fake folders.
This is from the Xcode user guide:
"The project navigator shows projects, groups, folders, and files:
The project or projects in your workspace window are the highest level
of the hierarchy in the project navigator. Open the project’s
disclosure triangle to see the groups, folders, and files in the
project. Select the project to display the project editor, where you
can view and edit project and target settings.
A group appears in the project navigator as a yellow folder icon. The
group does not represent a folder on disk. Although you can organize
your project in Xcode to reflect the organization of files on disk,
moving files into and out of groups does not affect the content of the
folders on disk, and moving files on disk into and out of folders does
not affect the content of the groups in the project navigator.
A folder is a reference to a folder on disk and appears in the project
navigator as a blue folder icon. The contents of the folder in the
project navigator reflect the contents of the folder on disk. It’s
important to note, however, that the files that appear in a folder
icon in the project navigator are not part of your project unless you
have added them to the project explicitly (in which case they appear
directly under the project or in a group, as well as in the folder).
You can view and edit the files in a folder, but to move files in and
out of the folder you must use the Finder.
A file in the project navigator is a reference to a file on disk."
I think usually the default option is the best one. If you want to add into some group, you can tick on the "Copy Item to Destination group"
You don't have to change any project settings after adding
And if you want to add the whole framework code, please choose add existing framework
Copy items into destination group's
folder (if needed)
Well, only if you want it to copy the files. If you are happy with their existing location and don't want it to copy them, don't select it (that's what I do).
Reference Type:
A total mystery to me
Text Encoding
Self explanatory
Recursively create groups for any
added folders Create Folder References
for any added folders
Leave this as the default and then organize the folders in your Xcode project any way you want.
Add to targets
If you add an additional target to your project, e.g. for iPhone vs. iPad versions, then not noticing that it has by default added the files to just one of them (at random?) can cause headaches.
Also, make sure you add the new header directory to your search paths in Project Settings > Build > Search paths. I think that's what's causing your problem.
Hope this helps, I remember how confusing this was to me at first.
If you want to add an Framwork Bundle, just add is as one. Add -> Existing Frameworks