Cocoapods not including additional files - swift

I have a cocoapod I've built which makes use of Apples new coreml library. As such it has several .mlmodel files that it makes use of to do data categorization etc.
The issue I am facing is that when I add the pod to another project and run a pod install it installs the pod as required, but the .mlmodel files are all missing - meaning the class files they generate are not found, so as such if I try to do a build, it fails. I know that .mlmodel files are a bit special as they are static files that generate a class on compilation, but I'm not sure how to force them to be included as files in the pod.
I have tried using smaller models in case it was a file size issue, ala the 100MB limit that git has for example, but this did not help. I'm not sure how to deal with it, as a static image file, for example, works fine.
Currently, I just manually drag the .mlmodel files into the pod folder after I've done an install, but this obviously is not a feasible method for build servers etc.

Use preserve_paths in the podspec for the .mlmodel files.

Related

How to specify buildroot build process variable to be called on make <package>-dirclean

Is there anyway I can just call into a define such as LIBFOO_DIRCLEAN, and just do what was implemented in the define?
Inside HOST_LIBFOO_INSTALL_CMDS, I copy files to the target directory, and would like the 'make package-dirclean' to delete what was copied into the target directory. 'make clean', would obviously do this(any many more), but that is much more than I want to do.
I see the following buildroot variables. LIBFOO_EXTRACT_CMDS, LIBFOO_CONFIGURE_CMDS, LIBFOO_BUILD_CMDS, HOST_LIBFOO_INSTALL_CMDS, LIBFOO_INSTALL_TARGET_CMDS, etc.
make foo-dirclean is a simple tool that just deletes the package build directory. In most cases, when the list of files installed by a package does not change over time (only files content changes) you can simply rebuild the package and the target directory will be rebuilt correctly.
If you want you can implement your own foo-myclean step that implements your own logic. However you must understand deleting files in the target directory is not supported by Buildroot and thus you are on your own.

How to include custom library files in Unity build

When I run my Unity app in the editor, it is able to read my .dlls and other custom files the .dlls need and it works fine. However, when I make a build, it only includes the .dll files in the Plugins folder of the build and not the other custom files. Is there a way to force Unity to include the other files as well? I have tried putting them both in the Plugins and Resources folder before building and in both cases it only keeps the .dlls.
The custom files are .obf, but I don't think that's relevant
It is extremely relevant. Unity does not support all type of libraries.
Here are the supported library extensions:
For Windows, you can use .dll.
For Linux, .so is supported.
For Android, you can only use .aar, rar and .so.
For iOS, .a is used but you can also use the non compiled code such as ,.m,.mm,.c and .cpp.
There is no support for .obf. If you want to add it to your project so that you can load and execute it then you are out of luck.
If you just want to make Unity include it to your final project build so that you can read it then you can. This doesn't mean you can load and execute it.
First, rename the extension from ".obf" to ".bytes". Place it in the Resources folder and read it as TextAsset with the Resources.Load function. You can the access the data with TextAsset.bytes.
TextAsset dataAsset = (TextAsset)Resources.Load("YourObfName", typeof(TextAsset));
byte[] data = dataAsset.bytes;
Not sure how helpful just reading it is but this is here to show you how to include it to the build and read it but you can't execute it unless there is a C# API to do so and I don't think that any API of such kind exist.

PNChart-swift not working

I wanna use some charts in my swift project, actually I was using PNChart before, but now I need to move on to PNChart-swift.
https://github.com/kevinzhow/PNChart-Swift
as the readme saids I added some lines in Podfile, and I
pod install
then I get "no such module PNChart-swift"
I think Pod is cloning the wrong Codes from the PNChart-swift repository.
Is there any way I can clone the codes and use as the library without using Pod?
Thank you.
For manual installation you could just download the repo as zipfile and than drag the .xcodeproj file into your project.
This will create the required reference so that you can use it.
You may also need to add it as embedded framework in your project settings.

CocoaPods having your pod to be a different project while you're developing it to avoid export/import cliff issues

I am localizing my pod and it has dependencies. What's happening is when I try to export xliff file it contains all keys form related pods and also when I translated xliff and try to import this language I got many issues and conflicts.
So is it possible so my pod will be different project and localization will only touch my files?
Just created empty project and dropped string files that should be localized... that all

Creating a new cocoapods pod

I'm trying to create my first pod, and, as per the recommendation on the website, am doing so at the command line with pod lib create <mylib>. The trouble is lib create assumes I want to create an iOS library, when in fact I'm developing for OS X. I've grep'ed my way through the cocoapod files on my computer looking for the template on which the generated project is based, but have come up empty-handed. Does anyone know how I might fiddle with these settings, wherever they are, to get the configuration I'm after?
If you already have your library created and just want to create a sample podspec you should use:
pod spec create
Instead. You can also pass this a URL to set that as the source automatically. See
pod spec create --help
For more info.