← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nskaggs/ubuntu-filemanager-app/add-dep-cache into lp:ubuntu-filemanager-app

 

Nicholas Skaggs has proposed merging lp:~nskaggs/ubuntu-filemanager-app/add-dep-cache into lp:ubuntu-filemanager-app.

Commit message:
Add dependency cache for click depends downloads

Requested reviews:
  Jenkins Bot (ubuntu-core-apps-jenkins-bot): continuous-integration
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~nskaggs/ubuntu-filemanager-app/add-dep-cache/+merge/288713

Add dependency cache for click depends downloads
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~nskaggs/ubuntu-filemanager-app/add-dep-cache into lp:ubuntu-filemanager-app.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2015-10-20 18:28:30 +0000
+++ CMakeLists.txt	2016-03-10 22:12:44 +0000
@@ -73,22 +73,40 @@
 
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json filemanager.apparmor ${CONTENT_HUB_EXPORTER} DESTINATION ${CMAKE_INSTALL_PREFIX})
 
-	MESSAGE("Grabbing upstream libs to ${CMAKE_CURRENT_BINARY_DIR}/upstream-libs")
-    execute_process(
-        COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/upstream-libs
-        COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/get-click-deps -d ${CMAKE_CURRENT_SOURCE_DIR}/filemanager-libs.json ${CLICK_ARCH} ${CMAKE_CURRENT_BINARY_DIR}/upstream-libs
-    )
-	MESSAGE("Installing upstream libs from ${CMAKE_CURRENT_BINARY_DIR}/upstream-libs/usr/lib/${ARCH_TRIPLET}/ to ${DATA_DIR}lib/${ARCH_TRIPLET}")
-	file(GLOB_RECURSE UPSTREAM_LIBS "${CMAKE_CURRENT_BINARY_DIR}/upstream-libs/usr/lib/${ARCH_TRIPLET}/*")
-	foreach(ITEM ${UPSTREAM_LIBS})
-	   IF( IS_DIRECTORY "${ITEM}" )
-	      LIST( APPEND DIRS_TO_DEPLOY "${ITEM}" )
-	   ELSE()
-	      LIST( APPEND FILES_TO_DEPLOY "${ITEM}" )
-	   ENDIF()
-	endforeach()
-	MESSAGE("Following files to install:- ${FILES_TO_DEPLOY}")
-	INSTALL( FILES ${FILES_TO_DEPLOY} DESTINATION ${DATA_DIR}lib/${ARCH_TRIPLET} )
+        set(UPSTREAM_LIBS_DIR ${CMAKE_BINARY_DIR}/upstream-libs)
+
+    #grab dependencies
+    set(GET_CLICK_DEPS_TOOL ${CMAKE_SOURCE_DIR}/get-click-deps)
+    set(DEPS_MANIFEST ${CMAKE_CURRENT_SOURCE_DIR}/filemanager-libs.json)
+    MESSAGE("Grabbing upstream libs to ${UPSTREAM_LIBS_DIR}")
+
+    get_filename_component(BLD_CONFIGURATION_NAME ${CMAKE_BINARY_DIR} NAME)
+    set(UPSTREAM_CACHE $ENV{HOME}/dev/upstream-libs-filemanager/${BLD_CONFIGURATION_NAME})
+    MESSAGE("Upstream libs cache path: ${UPSTREAM_CACHE}")
+
+    if(EXISTS "${UPSTREAM_CACHE}")
+      MESSAGE("Upstream libs cache exists.")
+      file(COPY ${UPSTREAM_CACHE}/upstream-libs/ DESTINATION ${UPSTREAM_LIBS_DIR} PATTERN * )
+    else()
+      MESSAGE("Cache miss, downloading from network.")
+      execute_process(
+        COMMAND mkdir ${UPSTREAM_LIBS_DIR}
+        COMMAND ${GET_CLICK_DEPS_TOOL} -d ${DEPS_MANIFEST} ${CLICK_ARCH} ${UPSTREAM_LIBS_DIR}
+      )
+      # Cache for next usage.
+      file(COPY ${UPSTREAM_LIBS_DIR} DESTINATION ${UPSTREAM_CACHE} )
+    endif()
+    MESSAGE("Installing upstream libs from ${CMAKE_CURRENT_BINARY_DIR}/upstream-libs/usr/lib/${ARCH_TRIPLET}/ to ${DATA_DIR}lib/${ARCH_TRIPLET}")
+    file(GLOB_RECURSE UPSTREAM_LIBS "${CMAKE_CURRENT_BINARY_DIR}/upstream-libs/usr/lib/${ARCH_TRIPLET}/*")
+    foreach(ITEM ${UPSTREAM_LIBS})
+       IF( IS_DIRECTORY "${ITEM}" )
+          LIST( APPEND DIRS_TO_DEPLOY "${ITEM}" )
+       ELSE()
+          LIST( APPEND FILES_TO_DEPLOY "${ITEM}" )
+       ENDIF()
+    endforeach()
+    MESSAGE("Following files to install:- ${FILES_TO_DEPLOY}")
+    INSTALL( FILES ${FILES_TO_DEPLOY} DESTINATION ${DATA_DIR}lib/${ARCH_TRIPLET} )
 else(CLICK_MODE)
     execute_process(
         COMMAND qmake -query QT_INSTALL_QML

=== modified file 'README-Mergeproposal'
--- README-Mergeproposal	2015-12-19 07:34:45 +0000
+++ README-Mergeproposal	2016-03-10 22:12:44 +0000
@@ -26,3 +26,7 @@
 The above checklist is more of a guideline to help file manager app trunk stay buildable,
 stable and up to date.
 
+
+Jenkins
+=======
+In addition to manual reviews, merge proposals are subject to being run in jenkins to ensure the application builds and any unit tests are successful. For more information on jenkins and how it works, see the [Core Apps Jenkins Wiki](https://wiki.ubuntu.com/Touch/CoreApps/Jenkins)

=== modified file 'tests/autopilot/filemanager/__init__.py'
--- tests/autopilot/filemanager/__init__.py	2016-01-14 16:44:26 +0000
+++ tests/autopilot/filemanager/__init__.py	2016-03-10 22:12:44 +0000
@@ -606,7 +606,7 @@
     """FileDetailsPopover Autopilot emulator."""
 
     def get_path(self):
-        return self.select_single('Label', objectName='pathLabel').text
+        return self.select_single('UCLabel', objectName='pathLabel').text
 
 
 class PathBar(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):

=== modified file 'tests/autopilot/filemanager/tests/__init__.py'
--- tests/autopilot/filemanager/tests/__init__.py	2015-03-12 20:58:23 +0000
+++ tests/autopilot/filemanager/tests/__init__.py	2016-03-10 22:12:44 +0000
@@ -32,6 +32,8 @@
 
 import filemanager
 from filemanager import fixture_setup as fm_fixtures
+import gi
+gi.require_version('Click', '0.4')
 from gi.repository import Click
 
 logger = logging.getLogger(__name__)

=== modified file 'tests/autopilot/filemanager/tests/test_filemanager.py'
--- tests/autopilot/filemanager/tests/test_filemanager.py	2015-03-10 21:41:40 +0000
+++ tests/autopilot/filemanager/tests/test_filemanager.py	2016-03-10 22:12:44 +0000
@@ -312,13 +312,10 @@
 
     def test_copy_directory(self):
         # Set up a directory to copy and a directory to copy it into.
-        destination_dir_path = os.path.join(self.fakehome,
-                                            'destination')
+        destination_dir_path = self.make_directory_in_home()
         destination_dir_name = os.path.basename(destination_dir_path)
-        os.mkdir(destination_dir_path)
-        dir_to_copy_path = os.path.join(self.fakehome, 'to_copy')
+        dir_to_copy_path = self.make_directory_in_home()
         dir_to_copy_name = os.path.basename(dir_to_copy_path)
-        os.mkdir(dir_to_copy_path)
 
         folder_list_page = self.app.main_view.get_folder_list_page()
         self._assert_number_of_files(2)
@@ -349,13 +346,10 @@
 
     def test_cut_directory(self):
         # Set up a directory to cut and a directory to move it into.
-        destination_dir_path = os.path.join(self.fakehome,
-                                            'destination')
+        destination_dir_path = self.make_directory_in_home()
         destination_dir_name = os.path.basename(destination_dir_path)
-        os.mkdir(destination_dir_path)
-        dir_to_cut_path = os.path.join(self.fakehome, 'to_cut')
+        dir_to_cut_path = self.make_directory_in_home()
         dir_to_cut_name = os.path.basename(dir_to_cut_path)
-        os.mkdir(dir_to_cut_path)
 
         folder_list_page = self.app.main_view.get_folder_list_page()
         self._assert_number_of_files(2)