How to add subdirectories and specific files to Android assets - android-gradle-plugin

In my repo root I have my data directory, Android project directory, and some other things. I'm trying to add my data directory as a subdirectory of the assets dir. I've tried the below code, but in only puts all the files from my data dir into assets.
sourceSets {
main {
assets.srcDirs '../../../data'
}
}
How can I add the data dir with sub files and dirs to assets using Gradle? The data dir is needed by other projects than just the android project, so I don't want to move it to android-project/app/src/main/assets
Also, how can I add a specific file to assets with Gradle? I don't want to add it's parent dir to assets.srcDirs because I don't want everything in the dir, I just want this one file. Once again, this specific file is needed by other projects than just the android project, so I don't want to move it to android-project/app/src/main/assets
I'm trying to use Gradle to achieve an assets structure like this:
- assets
- mySpecificFile
- data
- file1
- file2
- etc

Related

Xcode Build path and copying additional files

I'm writing a plugin for Elgato Stream Deck. https://developer.elgato.com/documentation/stream-deck/sdk/overview/
Basically it is a binary command line tool written in C++/OBJ-C/Swift combined with a JSON manifest and optionally some HTML and JS files as well as different assets (.png, ...). All files have to be included in a folder (com.companyname.pluginname.sdPlugin) which lives in Library/Application Support/com.elgato.StreamDeck/Plugins/
At the moment, I'm building the binary to the default build path (derived data, ...) and manually copy it to the above folder. But I need to build and run that binary with an executable (Stream Deck app) defined in the scheme for debugging under Xcode. The JSON manifest and assets also lives in my xcode project folder and have to be copied manually.
So Before:
After:
So my question: how can I automate that under Xcode? I assume I can do some sort of post build scripting, but I have no knowledge about all that stuff.
Thanks
Solution:
go to target -> build settings
Deployment Location = YES
Installation Build Products Location = / (empty this one!)
Installation Directory = path to folder (= $INSTALL_PATH)
this will copy your binary to the defined installation path
go to target -> build phases
new phase -> run script
cp -r "$SRCROOT"/<FILE OR FOLDER NAME> "$INSTALL_PATH"/<FILE OR FOLDER NAME>
repeat this for all files and folders you need to be copied to the installation path. be careful with empty spaces in the folder/file names, they won't be recognized correctly and you have to use quotation marks

Vue.js: folder is missing when publish

When I publish the project: npm run build a folder that I created with images is missing from the dist folder.
I created this folder inside the src folder.
assets folder is also missing.
Where is it?
If you just want some folders included verbatim, put them in the public folder.
Any static assets placed in the public folder will simply be copied and not go through webpack. You need to reference them using absolute paths.
Things within src are only included if they're part of the bundle (ie they have been imported / required) and even then, any folder structure won't be preserved. Bundled items are typically renamed with a hash checksum and all put into a single folder like js, css, images, etc.

quasar can't build asset folder

My project has static folder and asset folder.
I use quasar dev to build project and the building project is stored in dist folder. But in the dist folder, it only has static folder, it doesn't has asset folder.
How can I let asset be packaged in dist folder?
I also had some struggle working with these two directories in Quasar. So I was very happy when I found this page in the documentation. The difference between assets and statics is described as follows:
Assets vs Statics
Files in the “assets” folder are only included in your build if they have a
literal reference in one of your Vue files. Every file and folder from the > “statics” folder are copied into your production build as-is, no matter what.
So I guess that you currently do not use any of the files inside the assets directory in at least one of your components.
Example: One possible way to make logo.png be part of the dist folder is to use the asset in a Vue component like this (also taken from the docs): <img src="~assets/logo.png">. Afterwards run quasar build and check the output in your dist folder. Good luck!

Mark symlink to folder outside a project as a source folder

Suppose I have a scala project like this:
And I symlink another folder /tmp/outside as scala/outside (outside may contain subdiretories), how can I make it appear as a source folder in intellij?

where to place images upload directory on a gradle project

I am using gradle and I have the default folder structure set by IntelliJ.
I am wondering where should I place an images uploads folder in this folder structure so that I can use it for running and testing?
I am thinking that it has something to do with gradle configuration file.