howardpang / androidNativeBundle

a gradle plugin that support publish c/c++ headers to 'aar' and depend those 'aar'
Apache License 2.0
71 stars 14 forks source link

Need to be ableto give filter for header files #4

Closed igagis closed 4 years ago

igagis commented 4 years ago

Recently there was a pull request which made the plugin only to include .h files to generated AAR package. This is good, but not flexible.

Need to add possibility to set an option in gradle file like includeHeaderFiles which can be set to something like ['*.h', '*.hpp', '*.hxx']. Then the plugin will only add header files which satisfy the given filter.

igagis commented 4 years ago

@paulo-raca FYI

howardpang commented 4 years ago

New version 1.0.5 will include all files in headerDir, if you want you exclude some files set excludeHeaderFiles option, read README for detail

@paulo-raca FYI

igagis commented 4 years ago

I see your approach, but it still has problems this way. Sometimes there are not only .cpp files stored along with headers, but also other files like makefiles or build artifacts from non-android build, etc. And it might be not flexible to add exclude filters for all possible file types there can be.

It would be better to have option includeHeaderFiles.add(**/*.hxx) and only include files which satisfy the filter. But, if filter is not set, then include all files. Is it possible to do it that way?

igagis commented 4 years ago

By the way, readme file has excludeHeaderFiles.add("**/**.cpp"). Is it **/**.cpp or should it be **/*.cpp, is it a typo?

howardpang commented 4 years ago

By the way, readme file has excludeHeaderFiles.add("**/**.cpp"). Is it **/**.cpp or should it be **/*.cpp, is it a typo?

the two way is also correct

howardpang commented 4 years ago

I have add includeHeaderFilter option as you suggest in new version 1.0.6

igagis commented 4 years ago

It works well now! Thank you for the quick fix!