I imported the sass files in my main.scss b/w
// bower:scss
#import "bootstrap-sass-official/assets/stylesheets/_bootstrap.scss";
#import "custom/app.scss";
// endbower
Whenever there is a style change or my app is getting restarted the imported scss files are missing.
The generator probably has generated a gulp/gruntfile that uses something like wiredep to try find references (in this case, SCSS files) and inject them between the two 'magical' comments. The only references it will find are for components that are installed through Bower. But it will first throw away anything that it considers obsolete (it assumes you have removed the Bower component and since it can not find it).
To fix this, just declare your #imports after the magic comments.
As a side note, it is good practice to use Bower to install components such as Bootstrap. Will make updating them and integrating them into the build process a bit easier.
(I hope this answered your question - I did make a few assumptions: I'm assuming that the files aren't get removed but the #import statements are. If the actual SCSS files are removed, as could be interpreted from the question, then this answer is not valid).
Related
I'm trying to bundle a ESM source file that includes dynamic imports like e.push(import("./polyfills/dom.js")). Not my code, so I can't change it.
With --experimentalCodeSplitting, Rollup would try to code split, but I actually want a single all-in-one bundle.
Is it possible with Rollup to include all these imports in one file?
It turned out that I was using an older version of Rollup (0.58.2). It works fine with never versions (0.60.1).
the Dropbox iOS SDK has its own Framework bundle but in order to customize it easily I ve chosen to include its Xcode project as a subproject.
How should i refer to its .h classes?
I ve added the .xcodeproj from the "Add files" button and I ve added in the Header Search Path the following value:
$(PROJECT_DIR)
The subproject looks to be at the same level with the main project.
Shouldn't the importing itself link the dependencies?
(I m really frustrated by the import system in Xcode)
Your basic approach seems sound (and is pretty close to how I handle lots of vendor projects). Since you've added $(PROJECT_DIR) to your header search path, and assuming that the framework is in a directory named "Dropbox", then you can refer to the packages a couple of ways:
#import <Dropbox/Header.h>
#import "Dropbox/Header.h"
I prefer to think of the sub-projects as "system-like" and so tend to use angle-brackets, reserving double-quotes for internal code. But either approach is really fine.
Shouldn't the importing itself link the dependencies?
No. You still need to link the dependencies. #import does just exactly one thing: inserts the requested file into the current file. That's all it does. It is identical to you taking the referenced file and copy/pasting it into your code (that's basically how it's implemented in the pre-processor). That this is used for "header" files is a matter of convention. It has nothing to do with how the compiler works. You technically could import a .m file that included a method in it as a way to do code reuse. (I've seen that done in projects I've worked on. Please don't do this....)
When dealing with ObjC modules, it's a little different (using #import rather than #import). But if you're just importing headers as you seem to be, think of it as "stick this other file right here, exactly as written."
Finally taking on pods. Everything seems to work, for example, dropped in Parse, install pod'd, see it in a view controller.m file just fine.
BUT.. now i want to drop Parse into the pch as i use it so often. My pre-pods line was:
#import "Parse/Parse.h"
I tried this, and
#import <Parse/Parse.h>
and
#import <Parse.h>
.. and every variant i can think of, no luck. I can of course drop imports where required, but this is more convenient, despite the suggestions not to use this route.
What i find most confusing is that the UI pre-fills in the path for me for second option, so it finds it, but on build, it fails with
'Parse/Parse.h' file not found.
Thanks for suggesting a working syntax.
This may not be the perfect answer, as there are so my cocoapods fans using the repo that this is likely due to my newness to it, but i had to manually create an entry into User Header Search Paths which was "Pods" and set it recursive.
Then all was good.
I am trying to include SBJsonlibrary in my project that does not use ARC. Since I cannot include source files, I've followed the steps described: here. However I end up with the same problems described in this SO question.
When I add libsbjson-ios.a to my project, it is shown in red, which I assume means the library is missing.
Although the compiling of the project goes fine, when I try to add #import "SBJson.h" I get
"SBJson.h: no such file or directory" error.
How do I solve this? My project is too large and I cannot change everyting to use ARC.
you simply need to drag all the files into your project rather than importing the library. i suggest to see https://github.com/stig/json-framework/ and follow the read me file to install in your project.
to use this in your projects
download the zip file from above link.
In the Finder, navigate into the src/main/objc folder.
Select all the files and drag-and-drop them into your Xcode project.
Tick the Copy items into destination group's folder option.
Use #import "SBJson.h" in your source files.
As an aside, a project can use ARC for just some files, so you could have compiled SBJson's classes with ARC and the rest of the project without.
A better way would be to just use SBJson from CocoaPods if you need to support iOS4. Or just switch to NSJSONSerialisation if you don't.
I added the new Google Maps API framework to a project and checked it into subversion. The framework has the usual Apple structure which includes alias files that point to the actual static library and includes. Apparently XCode these days allows the use of the standard framework structure so you don't have to put header or library references in any more, merely adding the framework is sufficient.
However it appears that storing these in subversion does not work as the alias files seem to break when you check them out.
Anyone have an idea how to make this work? Clearly I can add manual references to the includes directory and the static library in the framework, ie the old fashioned way. It would be nice for this to just work somehow since people are shipping SDKs as proper frameworks now (Google, Crashlytics).
Update: The symbolic links inside the frame work are supposed to be stored in SVN marked as svn:special. However what I get back from checking this framework out is a symlink to the library, but with actual folders for Headers and Resources instead. This of course no longer matches the SVN repository. I wonder if my svn client (Versions) might be messing it up.
I avoided putting symbolic links into SVN by copying the real GoogleMaps file and the real Headers and Resources folders from GoogleMaps.framework/Versions/A/ up into the GoogleMaps.framework folder, overwriting the symbolic links (and then I removed the Versions folder).
This is probably not the 'right' way to do it, but it seems to be working okay so far :)
Update SVN global ignores:
Open terminal and execute:
vi ~/.subversion/config
Then search for global-ignores, and uncomment same line (remove # in first char). Then remove .a in same line
Someone's client was messing up the checkin. Versions OSX seems to do it correctly but once it's checked in wrong, strange things start to happen. The solution is to remove it from the repository and check it in with the command line or a client that works correctly like Versions.