Import files in objective-c using wildcard - objective-c

Is it possible to import a glob of header files based on wildcard directives? I want to semantically do the following:
#import "*-(Extensions).h"
to import all files in my local directory that end with -(Extensions).h. How might I go about this? Thanks in advance for any help!

Nope.
If you don't want to write a dozen import directives in multiple source files, you could write one header that imports all of your -(Extensions).h files, then import that into your source.
You could generate said header automatically from a directory listing with a bit of shell scripting, then make that shell script a build phase in your Xcode project.

Related

How to add/import a .kt file as a source in main.kt file in idle kotlin (gradle build) project

I'm learning kotlin recently and have experience with python and pycharm. I'm having some problems on importing a file as a source root in IntelliJ IDE.
my problems are,
If I keep my custom .kt file say calculation.kt in the same folder as main.kt i.e..$project$/src/main/kotlin/main.kt file directory I don't have to import or add calculation.kt in main.kt. All functions within the calculation.kt works fine, maybe being implicitly imported.
But if I keep the file in another folder i.e $project$/src/others/calculation.kt and mark the "others" folder as the source root, yet the calculation.kt doesn't get implicitly imported. Maybe I need to do an explicit import of calculation.kt in my main.kt. I need to know how to do that
Do I have to do any addition to build.gradle.kts file? I think I have to do some inclusion in there, please share an example on that.
Thank you.

Protocol Buffers library-dependent location in IntelliJ

I try to use import in my *.proto instructions for Protobuf. In my app, I have a few plugins with these *.proto instructions. But IntelliJ with Protocol Buffers marks imports and classes from the imported files as red.
I found, if I add in Preferences->Languages & Frameworks->Protocol Buffers strong location to my *.proto it will be green. But I have many places with *.proto, for example for each plugin in my app, and some of this *.proto can have an equal name, like featuresDto for each plugin. How can I add library-dependent location instead of strong?
However, the protobuf-generator works as expected.
[screenshot]
I didn't get correctly what do you mean by library-dependent location - could you please explain?
As for protobuf plugin settings: there you can find all directories, where you'll be able to import files from. E.g. if the protobuf file is located in /foo/bar/MyService.proto, and you want to be able to import it as import "bar/MyService.proto";, you should add /foo/ directory to the plugin settings.
In fact those settings mean exactly the same as directories one specifies with proto-path cli argument: if any proto file can not be resolved against one of given proto-paths, compilation will not succeed.
Also you may find useful the following issues about simplifying solving imports-related problems: https://youtrack.jetbrains.com/issue/IDEA-283099 and https://youtrack.jetbrains.com/issue/IDEA-283097

How to include a (compiled) JS file in NuxtJS

I’ve a NuxtJS app and want to include a file called app.js (located in assets/js/app.js).
Contents of that file:
// imports from node_modules
import 'focus-visible';
import 'other-package';
…
What I am doing at the moment is to import that packages inside layouts/default.vue … but it doesn’t feel right.
How would you do it?
Importing the assets file is no different than importing any other JavaScript file from another src directory:
import '#/assets/js/app'
It's hard to say whether this usage is "right" without more context, but I don't see anything wrong with doing that.

How to import MathTool in Velocity in file template in IntelliJ

I am working on adding a file template of a Java class in IntelliJ using Apache Velocity. I want to use pow() function in the template but I don't know how to import it. According to the official guide https://velocity.apache.org/tools/1.4/generic/MathTool.html#pow() I need to add
<tool>
<key>math</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.MathTool</class>
</tool>
But I don't know where to put this xml file. File template is just a single class template file created in .idea directory which has no application structure. Does anyone know how to import this?
IntelliJ IDEA doesn't support this kind of imports. Feature request is welcome.

WebStorm: How to trigger a Less compilation only on the main.less file while watching multiple files?

I have a .less files directory with:
main.less (just import the dependencies)
dep1.less
dep2.less
etc.
I want that modifying a dependency triggers the compilation of the main.less file ONLY.
For now here is my configuration in WebStorm Less watcher. What scope and arguments I need?
Thx to #LazyOne comments I manage to find the right settings.
set the watch scope to the entire folder
put ../$FileNameWithoutExtension$.css at the end of less command arguments
uncheck Create output file from stdout causing empty output file (don't know why)
check Track only root files. Which is not very explicit in my case. Indeed it does not really watch the root file but all the #import dependencies and ONLY COMPILE THE ROOT FILE.
If you prefix your partial files with an underscore
(_dep1.less,_dep2.less)
they wont be compiled. And that doesn't even effect how you call them: #import _dep1.less will import _dep1.less.