Fixed
Status Update
Comments
kn...@google.com <kn...@google.com> #2
This doesn't repro for me. Steps:
(1) Create new C++ project
(2) Run the app (this create's the binary directories
(3) Do something to cause a gradle Sync
(4) Look for files under .externalNativeBuild. They're there:
jomof@jomof:~/projects/client/src/android/MyApplication4/app$ find "." -name "*.o"
./.externalNativeBuild/cmake/debug/x86/CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
Please add repro steps so I can get a better idea of what's happening.
>> It should only delete the CMake binary directories *if and only if* parameters change in Gradle that cause cmake toolchain parameters to change (such as platform version, abi, toolchain) or parameters passed to CMake to change.
This is the way it's design to work and it is working that way for the cases I know
(1) Create new C++ project
(2) Run the app (this create's the binary directories
(3) Do something to cause a gradle Sync
(4) Look for files under .externalNativeBuild. They're there:
jomof@jomof:~/projects/client/src/android/MyApplication4/app$ find "." -name "*.o"
./.externalNativeBuild/cmake/debug/x86/CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
Please add repro steps so I can get a better idea of what's happening.
>> It should only delete the CMake binary directories *if and only if* parameters change in Gradle that cause cmake toolchain parameters to change (such as platform version, abi, toolchain) or parameters passed to CMake to change.
This is the way it's design to work and it is working that way for the cases I know
pa...@disney.io <pa...@disney.io> #3
I realized that there were a few things we were doing that were questionable. Specifically, we set up our CMake command line params in a variable at the root build.gradle script. We were generating build dates and such in gradle and passing those down to CMake. I think things like this may be causing the CMake args to change too often, possibly resulting in this behavior. I'm in the process of eliminating a lot of this, so I'll make sure to report back the results.
hf...@google.com <hf...@google.com> #4
So even after making my changes, I still see this behavior. My repro steps:
1. Make a change to a CMake script
2. Switch to Android Studio. I am prompted to do gradle sync, and so I do it.
On next build, a full rebuild is performed. For some reason it is not performing a delta build. Some libraries are rebuilding that should not be rebuilt. So obviously a "ninja clean" is happening somewhere. There's simply no other explanation for this.
Jomo, can you please reopen? This is still a very real problem.
1. Make a change to a CMake script
2. Switch to Android Studio. I am prompted to do gradle sync, and so I do it.
On next build, a full rebuild is performed. For some reason it is not performing a delta build. Some libraries are rebuilding that should not be rebuilt. So obviously a "ninja clean" is happening somewhere. There's simply no other explanation for this.
Jomo, can you please reopen? This is still a very real problem.
Description
[1]