Reputation: 8335
I have an Android project composed of a Java layer for the UI, and a C++ layer for the core of the application that contains most of the code.
These two layers are two separate Visual Studio 2015 projects/solutions, the "UI" project being a "Basic Application (Android, Gradle)" project, and the "Core" project being a "Dynamic Shared Library (Android)" generating a .so
which is loaded by the Java on startup.
I would like my "UI" project to reference the "Core" project without making the C++ code accessible when openning the "UI" project.
What I have thought so far :
Adding a reference to the "Core" project in the "UI" project, which seems to be the clean way to do this, but which also makes the C++ code accessible, which I don't want to be possible.
Not creating a reference to the "Core" project in the "UI" project but simply "referencing" the .so
generated by the "Core" project into the "UI" project. However I don't know how to do that. And because there will not be an actual reference to the "Core" project, compiling the "UI" project will not automatically recompile the "Core" project if a modification was made to it, forcing me to do it manually.
Is there a clean way to do what I want to do ? Thank you.
Upvotes: 0
Views: 63
Reputation: 500
Unfortunatly, you could compile cpp project only if it's in your solution. If you want to hide your code, you should link you lib, but if you'll make changes in cpp code, you'll have to recompile it separately.
I use Android Studio, but methods is not too different. If i want to hide my cpp code and just use libs (for ex I write it in another IDE) I make script file wich runs from AS (from VS in your case, build event maybe) and build my cpp part.
But more frequently I build both parts together and only on release stage I hide my cpp part using external libs
Upvotes: 1