Add Sync CL number to AOSP external icing.
The cl number indicate what AOSP is synced to. And will re-generate cxx
files if there is any updates.
Bug:170611579
Test: Manually: 1: checkout on an old branch
2. add denpendencies to cmake (changing cmakelists will invalidate a lot of caches)
3. build and generate cxx files
4. switch to the head branch with the latest version
5. build again w/o any error.
Change-Id: Ic0432abe905cac03bd12458eee21d7d83b5ae772
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e520663..a740924 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,27 +47,6 @@
set(ICU_TARGET_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/icu-target")
add_subdirectory(${ICU_SOURCE_DIR} ${ICU_TARGET_BINARY_DIR})
-# Creates a file deps_name.cmake to save dependencies in it. This file should be
-# treated as part of CMakeLists.txt. This file should stay in .gitignore
-# TODO: When supporting cmake v3.12 or higher, use CONFIGURE_DEPENDS in the glob
-# and remove this section.
-function(update_deps_file deps_name deps)
- set(DEPS_FILE ${deps_name}.cmake.gen)
- set(CONTENT "# generated by make process.\nset(Tmp_${deps_name} ${deps})\n")
- set(EXISTING_CONTENT "")
- if(EXISTS ${DEPS_FILE})
- file(READ ${DEPS_FILE} EXISTING_CONTENT)
- endif()
- # Compare the new contents with the existing file, if it exists and is the same
- # we don't want to trigger a make by changing its timestamp.
- if(NOT EXISTING_CONTENT STREQUAL CONTENT)
- file(WRITE ${DEPS_FILE} ${CONTENT})
- endif()
- # Include the file so it's tracked as a generation dependency we don't
- # need the content.
- include(${DEPS_FILE})
-endfunction(update_deps_file)
-
# Glob Icing proto sources. Results look like this: icing/proto/document.proto
file(
GLOB_RECURSE
@@ -76,7 +55,6 @@
"*.proto")
message(STATUS "Icing_PROTO_FILES=${Icing_PROTO_FILES}")
-update_deps_file("IcingProtoFiles" "${Icing_PROTO_FILES}")
# Run protoc on Icing_PROTO_FILES to generate pb.cc and pb.h files
# The DEPENDS section of add_custom_command could trigger a remake if any proto
@@ -115,7 +93,9 @@
icing/*.cc icing/*.h
)
-update_deps_file("IcingCCSources" "${Icing_CC_SOURCES}")
+# TODO(b/170611579): When supporting cmake v3.12 or higher, use CONFIGURE_DEPENDS
+# in the glob and remove this section.
+include(synced_AOSP_CL_number.txt)
# Exclude the same types of files as Android.bp. See the comments there.
list(FILTER Icing_CC_SOURCES EXCLUDE REGEX "^icing/.*[^a-zA-Z0-9]test[^a-zA-Z0-9].*$")