From 0dbd8ee3e047d13ed89de0fb65bd83c7556eba0e Mon Sep 17 00:00:00 2001 From: "NORTHAMERICA\\vistepan" Date: Wed, 30 Nov 2016 16:56:16 -0800 Subject: [PATCH] [CMake] Changed tensorboard.cmake to parse dependencies from Bazel files. --- .../contrib/cmake/external/tensorboard.cmake | 87 ++- .../cmake/external/tensorboard_deps.cmake | 600 ------------------ 2 files changed, 86 insertions(+), 601 deletions(-) delete mode 100644 tensorflow/contrib/cmake/external/tensorboard_deps.cmake diff --git a/tensorflow/contrib/cmake/external/tensorboard.cmake b/tensorflow/contrib/cmake/external/tensorboard.cmake index 6b99c11b8c1201..dd2613a15c8395 100644 --- a/tensorflow/contrib/cmake/external/tensorboard.cmake +++ b/tensorflow/contrib/cmake/external/tensorboard.cmake @@ -44,6 +44,91 @@ function(tb_http_file) set(tensorboard_dependencies ${tensorboard_dependencies} ${_TB_NAME} PARENT_SCOPE) endfunction() -include(external/tensorboard_deps.cmake) +# Parse TensorBoard dependency names and URLs from Bazel's WORKSPACE file. +set(tb_dep_names) +file(STRINGS ${PROJECT_SOURCE_DIR}/../../../WORKSPACE workspace_contents) +foreach(line ${workspace_contents}) + if(line MATCHES "# TENSORBOARD_BOWER_AUTOGENERATED_BELOW_THIS_LINE_DO_NOT_EDIT") + set(tb_deps_started 1) + endif() + + if(NOT tb_deps_started) + continue() + endif() + + if(line MATCHES "new_http_archive\\(") + set(tb_dep_is_archive 1) + continue() + elseif(line MATCHES "http_file\\(") + set(tb_dep_is_archive 0) + continue() + endif() + + string(REGEX MATCH "name.*=.*\"(.*)\"" has_name ${line}) + if(has_name) + set(tb_dep_name ${CMAKE_MATCH_1}) + continue() + endif() + + string(REGEX MATCH "url.*=.*\"(.*)\"" has_url ${line}) + if(has_url) + list(APPEND tb_dep_names ${tb_dep_name}) + set(${tb_dep_name}_is_archive ${tb_dep_is_archive}) + set(${tb_dep_name}_url ${CMAKE_MATCH_1}) + endif() +endforeach() + +# Parse the files needed for each TensorBoard dependency from Bazel's bower.BUILD file. +# Due to CMAKE quirkiness, cannot use file(strings) with files that contain '[' and ']'. +file(READ ${PROJECT_SOURCE_DIR}/../../../bower.BUILD bower_build_contents) +string(REPLACE "\[" "OB" bower_build_contents "${bower_build_contents}") +string(REPLACE "\]" "CB" bower_build_contents "${bower_build_contents}") +string(REPLACE ";" "\\\\;" bower_build_contents "${bower_build_contents}") +string(REPLACE "\n" "E;" bower_build_contents "${bower_build_contents}") +foreach(line ${bower_build_contents}) + string(REGEX MATCH "name.*=.*\"(.*)\"" has_name ${line}) + if(has_name) + set(tb_dep_name ${CMAKE_MATCH_1}) + set(${tb_dep_name}_files) + continue() + endif() + + string(REGEX MATCH "srcs.*=.*\"(.*)\"CB" has_single_line_src ${line}) + if(has_single_line_src) + list(APPEND ${tb_dep_name}_files ${CMAKE_MATCH_1}) + continue() + endif() + + if(line MATCHES "srcs.*=.*OB") + set(inside_files_def 1) + continue() + elseif(line MATCHES "CB,") + set(inside_files_def 0) + continue() + endif() + + if(inside_files_def) + string(REGEX MATCH "\"(.*)\"," has_file ${line}) + if(has_file) + list(APPEND ${tb_dep_name}_files ${CMAKE_MATCH_1}) + endif() + endif() +endforeach() + +# Generate a target for each dependency. +foreach(tb_dep_name ${tb_dep_names}) + if (${tb_dep_name}_is_archive) + tb_new_http_archive( + NAME ${tb_dep_name} + URL ${${tb_dep_name}_url} + FILES ${${tb_dep_name}_files} + ) + else() + tb_http_file( + NAME ${tb_dep_name} + URL ${${tb_dep_name}_url} + ) + endif() +endforeach() add_dependencies(tensorboard_copy_dependencies ${tensorboard_dependencies}) diff --git a/tensorflow/contrib/cmake/external/tensorboard_deps.cmake b/tensorflow/contrib/cmake/external/tensorboard_deps.cmake deleted file mode 100644 index e65240ae8b33be..00000000000000 --- a/tensorflow/contrib/cmake/external/tensorboard_deps.cmake +++ /dev/null @@ -1,600 +0,0 @@ -tb_new_http_archive( - NAME d3 - URL "https://github.com/mbostock-bower/d3-bower/archive/v3.5.15.tar.gz" - FILES "d3.js" - "d3.min.js" - "package.js" -) - -tb_new_http_archive( - NAME dagre - URL "https://github.com/cpettitt/dagre/archive/v0.7.4.tar.gz" - FILES "dist/dagre.core.js" - "dist/dagre.core.min.js" -) - -tb_new_http_archive( - NAME es6_promise - URL "https://github.com/components/es6-promise/archive/v2.1.0.tar.gz" - FILES "promise.js" - "promise.min.js" -) - -tb_new_http_archive( - NAME font_roboto - URL "https://github.com/polymerelements/font-roboto/archive/v1.0.1.tar.gz" - FILES "roboto.html" -) - -tb_new_http_archive( - NAME graphlib - URL "https://github.com/cpettitt/graphlib/archive/v1.0.7.tar.gz" - FILES "dist/graphlib.core.js" - "dist/graphlib.core.min.js" -) - -tb_new_http_archive( - NAME iron_a11y_announcer - URL "https://github.com/polymerelements/iron-a11y-announcer/archive/v1.0.5.tar.gz" - FILES "index.html" - "iron-a11y-announcer.html" -) - -tb_new_http_archive( - NAME iron_a11y_keys_behavior - URL "https://github.com/polymerelements/iron-a11y-keys-behavior/archive/v1.1.8.tar.gz" - FILES "index.html" - "iron-a11y-keys-behavior.html" -) - -tb_new_http_archive( - NAME iron_ajax - URL "https://github.com/polymerelements/iron-ajax/archive/v1.2.0.tar.gz" - FILES "index.html" - "iron-ajax.html" - "iron-request.html" -) - -tb_new_http_archive( - NAME iron_autogrow_textarea - URL "https://github.com/polymerelements/iron-autogrow-textarea/archive/v1.0.12.tar.gz" - FILES "index.html" - "iron-autogrow-textarea.html" -) - -tb_new_http_archive( - NAME iron_behaviors - URL "https://github.com/polymerelements/iron-behaviors/archive/v1.0.17.tar.gz" - FILES "index.html" - "iron-button-state.html" - "iron-control-state.html" -) - -tb_new_http_archive( - NAME iron_checked_element_behavior - URL "https://github.com/polymerelements/iron-checked-element-behavior/archive/v1.0.4.tar.gz" - FILES "index.html" - "iron-checked-element-behavior.html" -) - -tb_new_http_archive( - NAME iron_collapse - URL "https://github.com/polymerelements/iron-collapse/archive/v1.0.8.tar.gz" - FILES "index.html" - "iron-collapse.html" -) - -tb_new_http_archive( - NAME iron_dropdown - URL "https://github.com/polymerelements/iron-dropdown/archive/v1.4.0.tar.gz" - FILES "index.html" - "iron-dropdown.html" - "iron-dropdown-scroll-manager.html" -) - -tb_new_http_archive( - NAME iron_fit_behavior - URL "https://github.com/polymerelements/iron-fit-behavior/archive/v1.2.5.tar.gz" - FILES "index.html" - "iron-fit-behavior.html" -) - -tb_new_http_archive( - NAME iron_flex_layout - URL "https://github.com/polymerelements/iron-flex-layout/archive/v1.3.0.tar.gz" - FILES "classes/iron-flex-layout.html" - "classes/iron-shadow-flex-layout.html" - "index.html" - "iron-flex-layout.html" - "iron-flex-layout-classes.html" -) - -tb_new_http_archive( - NAME iron_form_element_behavior - URL "https://github.com/polymerelements/iron-form-element-behavior/archive/v1.0.6.tar.gz" - FILES "index.html" - "iron-form-element-behavior.html" -) - -tb_new_http_archive( - NAME iron_icon - URL "https://github.com/polymerelements/iron-icon/archive/v1.0.11.tar.gz" - FILES "index.html" - "iron-icon.html" -) - -tb_new_http_archive( - NAME iron_icons - URL "https://github.com/polymerelements/iron-icons/archive/v1.1.3.tar.gz" - FILES "av-icons.html" - "communication-icons.html" - "device-icons.html" - "editor-icons.html" - "hardware-icons.html" - "image-icons.html" - "index.html" - "iron-icons.html" - "maps-icons.html" - "notification-icons.html" - "places-icons.html" - "social-icons.html" -) - -tb_new_http_archive( - NAME iron_iconset_svg - URL "https://github.com/polymerelements/iron-iconset-svg/archive/v1.1.0.tar.gz" - FILES "index.html" - "iron-iconset-svg.html" -) - -tb_new_http_archive( - NAME iron_input - URL "https://github.com/polymerelements/iron-input/archive/1.0.10.tar.gz" - FILES "index.html" - "iron-input.html" -) - -tb_new_http_archive( - NAME iron_list - URL "https://github.com/polymerelements/iron-list/archive/v1.3.9.tar.gz" - FILES "index.html" - "iron-list.html" - "test/smoke/avg-worst-case.html" - "test/smoke/dummy-data.html" - "test/smoke/index.html" - "test/smoke/physical-count.html" -) - -tb_new_http_archive( - NAME iron_menu_behavior - URL "https://github.com/polymerelements/iron-menu-behavior/archive/v1.1.10.tar.gz" - FILES "index.html" - "iron-menu-behavior.html" - "iron-menubar-behavior.html" -) - -tb_new_http_archive( - NAME iron_meta - URL "https://github.com/polymerelements/iron-meta/archive/v1.1.1.tar.gz" - FILES "index.html" - "iron-meta.html" -) - -tb_new_http_archive( - NAME iron_overlay_behavior - URL "https://github.com/polymerelements/iron-overlay-behavior/archive/v1.10.1.tar.gz" - FILES "index.html" - "iron-focusables-helper.html" - "iron-overlay-backdrop.html" - "iron-overlay-behavior.html" - "iron-overlay-manager.html" -) - -tb_new_http_archive( - NAME iron_range_behavior - URL "https://github.com/polymerelements/iron-range-behavior/archive/v1.0.4.tar.gz" - FILES "index.html" - "iron-range-behavior.html" -) - -tb_new_http_archive( - NAME iron_resizable_behavior - URL "https://github.com/polymerelements/iron-resizable-behavior/archive/v1.0.3.tar.gz" - FILES "demo/src/x-app.html" - "index.html" - "iron-resizable-behavior.html" -) - -tb_new_http_archive( - NAME iron_scroll_target_behavior - URL "https://github.com/polymerelements/iron-scroll-target-behavior/archive/v1.0.3.tar.gz" - FILES "index.html" - "iron-scroll-target-behavior.html" -) - -tb_new_http_archive( - NAME iron_selector - URL "https://github.com/polymerelements/iron-selector/archive/v1.5.2.tar.gz" - FILES "index.html" - "iron-multi-selectable.html" - "iron-selectable.html" - "iron-selection.html" - "iron-selector.html" -) - -tb_new_http_archive( - NAME iron_validatable_behavior - URL "https://github.com/polymerelements/iron-validatable-behavior/archive/v1.1.1.tar.gz" - FILES "index.html" - "iron-validatable-behavior.html" -) - -tb_new_http_archive( - NAME lodash - URL "https://github.com/lodash/lodash/archive/3.8.0.tar.gz" - FILES "lodash.js" - "lodash.min.js" -) - -tb_new_http_archive( - NAME neon_animation - URL "https://github.com/polymerelements/neon-animation/archive/v1.2.2.tar.gz" - FILES "animations/cascaded-animation.html" - "animations/fade-in-animation.html" - "animations/fade-out-animation.html" - "animations/hero-animation.html" - "animations/opaque-animation.html" - "animations/reverse-ripple-animation.html" - "animations/ripple-animation.html" - "animations/scale-down-animation.html" - "animations/scale-up-animation.html" - "animations/slide-down-animation.html" - "animations/slide-from-bottom-animation.html" - "animations/slide-from-left-animation.html" - "animations/slide-from-right-animation.html" - "animations/slide-from-top-animation.html" - "animations/slide-left-animation.html" - "animations/slide-right-animation.html" - "animations/slide-up-animation.html" - "animations/transform-animation.html" - "demo/card/index.html" - "demo/card/x-card.html" - "demo/card/x-cards-list.html" - "demo/declarative/index.html" - "demo/doc/index.html" - "demo/doc/my-animatable.html" - "demo/doc/my-dialog.html" - "demo/dropdown/animated-dropdown.html" - "demo/dropdown/index.html" - "demo/grid/animated-grid.html" - "demo/grid/fullsize-page-with-card.html" - "demo/grid/index.html" - "demo/list/full-view.html" - "demo/list/index.html" - "demo/list/list-demo.html" - "demo/list/list-view.html" - "demo/load/animated-grid.html" - "demo/load/full-page.html" - "demo/load/index.html" - "demo/reprojection/animated-grid.html" - "demo/reprojection/fullsize-page-with-card.html" - "demo/reprojection/index.html" - "demo/reprojection/reprojected-pages.html" - "demo/tiles/circles-page.html" - "demo/tiles/index.html" - "demo/tiles/squares-page.html" - "index.html" - "neon-animatable.html" - "neon-animatable-behavior.html" - "neon-animated-pages.html" - "neon-animation.html" - "neon-animation-behavior.html" - "neon-animation-runner-behavior.html" - "neon-animations.html" - "neon-shared-element-animatable-behavior.html" - "neon-shared-element-animation-behavior.html" - "web-animations.html" -) - -tb_http_file( - NAME numericjs_numeric_min_js - URL "https://cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js" -) - -tb_new_http_archive( - NAME paper_behaviors - URL "https://github.com/polymerelements/paper-behaviors/archive/v1.0.12.tar.gz" - FILES "index.html" - "paper-button-behavior.html" - "paper-checked-element-behavior.html" - "paper-inky-focus-behavior.html" - "paper-ripple-behavior.html" -) - -tb_new_http_archive( - NAME paper_button - URL "https://github.com/polymerelements/paper-button/archive/v1.0.11.tar.gz" - FILES "index.html" - "paper-button.html" -) - -tb_new_http_archive( - NAME paper_checkbox - URL "https://github.com/polymerelements/paper-checkbox/archive/v1.4.0.tar.gz" - FILES "index.html" - "paper-checkbox.html" -) - -tb_new_http_archive( - NAME paper_dialog - URL "https://github.com/polymerelements/paper-dialog/archive/v1.0.4.tar.gz" - FILES "index.html" - "paper-dialog.html" -) - -tb_new_http_archive( - NAME paper_dialog_behavior - URL "https://github.com/polymerelements/paper-dialog-behavior/archive/v1.2.5.tar.gz" - FILES "index.html" - "paper-dialog-behavior.html" - "paper-dialog-common.css" - "paper-dialog-shared-styles.html" -) - -tb_new_http_archive( - NAME paper_dialog_scrollable - URL "https://github.com/polymerelements/paper-dialog-scrollable/archive/1.1.5.tar.gz" - FILES "index.html" - "paper-dialog-scrollable.html" -) - -tb_new_http_archive( - NAME paper_dropdown_menu - URL "https://github.com/polymerelements/paper-dropdown-menu/archive/v1.4.0.tar.gz" - FILES "index.html" - "paper-dropdown-menu.html" - "paper-dropdown-menu-icons.html" - "paper-dropdown-menu-light.html" - "paper-dropdown-menu-shared-styles.html" -) - -tb_new_http_archive( - NAME paper_header_panel - URL "https://github.com/polymerelements/paper-header-panel/archive/v1.1.4.tar.gz" - FILES "index.html" - "paper-header-panel.html" -) - -tb_new_http_archive( - NAME paper_icon_button - URL "https://github.com/polymerelements/paper-icon-button/archive/v1.1.3.tar.gz" - FILES "index.html" - "paper-icon-button.html" - "paper-icon-button-light.html" -) - -tb_new_http_archive( - NAME paper_input - URL "https://github.com/polymerelements/paper-input/archive/v1.1.18.tar.gz" - FILES "all-imports.html" - "index.html" - "paper-input.html" - "paper-input-addon-behavior.html" - "paper-input-behavior.html" - "paper-input-char-counter.html" - "paper-input-container.html" - "paper-input-error.html" - "paper-textarea.html" -) - -tb_new_http_archive( - NAME paper_item - URL "https://github.com/polymerelements/paper-item/archive/v1.1.4.tar.gz" - FILES "all-imports.html" - "index.html" - "paper-icon-item.html" - "paper-item.html" - "paper-item-behavior.html" - "paper-item-body.html" - "paper-item-shared-styles.html" -) - -tb_new_http_archive( - NAME paper_listbox - URL "https://github.com/polymerelements/paper-listbox/archive/v1.1.2.tar.gz" - FILES "index.html" - "paper-listbox.html" -) - -tb_new_http_archive( - NAME paper_material - URL "https://github.com/polymerelements/paper-material/archive/v1.0.6.tar.gz" - FILES "index.html" - "paper-material.html" - "paper-material-shared-styles.html" -) - -tb_new_http_archive( - NAME paper_menu - URL "https://github.com/polymerelements/paper-menu/archive/v1.2.2.tar.gz" - FILES "index.html" - "paper-menu.html" - "paper-menu-shared-styles.html" - "paper-submenu.html" -) - -tb_new_http_archive( - NAME paper_menu_button - URL "https://github.com/polymerelements/paper-menu-button/archive/v1.5.1.tar.gz" - FILES "index.html" - "paper-menu-button.html" - "paper-menu-button-animations.html" -) - -tb_new_http_archive( - NAME paper_progress - URL "https://github.com/polymerelements/paper-progress/archive/v1.0.9.tar.gz" - FILES "index.html" - "paper-progress.html" -) - -tb_new_http_archive( - NAME paper_radio_button - URL "https://github.com/polymerelements/paper-radio-button/archive/v1.1.2.tar.gz" - FILES "index.html" - "paper-radio-button.html" -) - -tb_new_http_archive( - NAME paper_radio_group - URL "https://github.com/polymerelements/paper-radio-group/archive/v1.0.9.tar.gz" - FILES "index.html" - "paper-radio-group.html" -) - -tb_new_http_archive( - NAME paper_ripple - URL "https://github.com/polymerelements/paper-ripple/archive/v1.0.5.tar.gz" - FILES "index.html" - "paper-ripple.html" -) - -tb_new_http_archive( - NAME paper_slider - URL "https://github.com/polymerelements/paper-slider/archive/v1.0.10.tar.gz" - FILES "index.html" - "paper-slider.html" -) - -tb_new_http_archive( - NAME paper_spinner - URL "https://github.com/polymerelements/paper-spinner/archive/v1.1.1.tar.gz" - FILES "index.html" - "paper-spinner.html" - "paper-spinner-behavior.html" - "paper-spinner-lite.html" - "paper-spinner-styles.html" -) - -tb_new_http_archive( - NAME paper_styles - URL "https://github.com/polymerelements/paper-styles/archive/v1.1.4.tar.gz" - FILES "classes/global.html" - "classes/shadow.html" - "classes/shadow-layout.html" - "classes/typography.html" - "color.html" - "default-theme.html" - "demo.css" - "demo-pages.html" - "index.html" - "paper-styles.html" - "paper-styles-classes.html" - "shadow.html" - "typography.html" -) - -tb_new_http_archive( - NAME paper_tabs - URL "https://github.com/polymerelements/paper-tabs/archive/v1.7.0.tar.gz" - FILES "index.html" - "paper-tab.html" - "paper-tabs.html" - "paper-tabs-icons.html" -) - -tb_new_http_archive( - NAME paper_toast - URL "https://github.com/polymerelements/paper-toast/archive/v1.3.0.tar.gz" - FILES "index.html" - "paper-toast.html" -) - -tb_new_http_archive( - NAME paper_toggle_button - URL "https://github.com/polymerelements/paper-toggle-button/archive/v1.2.0.tar.gz" - FILES "index.html" - "paper-toggle-button.html" -) - -tb_new_http_archive( - NAME paper_toolbar - URL "https://github.com/polymerelements/paper-toolbar/archive/v1.1.4.tar.gz" - FILES "index.html" - "paper-toolbar.html" -) - -tb_new_http_archive( - NAME paper_tooltip - URL "https://github.com/polymerelements/paper-tooltip/archive/v1.1.2.tar.gz" - FILES "index.html" - "paper-tooltip.html" -) - -tb_new_http_archive( - NAME plottable - URL "https://github.com/palantir/plottable/archive/v1.16.1.tar.gz" - FILES "plottable.css" - "plottable.js" - "plottable.min.js" -) - -tb_new_http_archive( - NAME polymer - URL "https://github.com/polymer/polymer/archive/v1.7.0.tar.gz" - FILES "polymer.html" - "polymer-micro.html" - "polymer-mini.html" -) - -tb_new_http_archive( - NAME promise_polyfill - URL "https://github.com/polymerlabs/promise-polyfill/archive/v1.0.0.tar.gz" - FILES "Gruntfile.js" - "Promise.js" - "Promise.min.js" - "Promise-Statics.js" - "promise-polyfill.html" - "promise-polyfill-lite.html" -) - -tb_http_file( - NAME three_js_three_min_js - URL "https://raw.githubusercontent.com/mrdoob/three.js/r77/build/three.min.js" -) - -tb_http_file( - NAME three_js_orbitcontrols_js - URL "https://raw.githubusercontent.com/mrdoob/three.js/r77/examples/js/controls/OrbitControls.js" -) - -tb_new_http_archive( - NAME web_animations_js - URL "https://github.com/web-animations/web-animations-js/archive/2.2.1.tar.gz" - FILES "web-animations.html" - "web-animations.min.js" - "web-animations-next.min.js" - "web-animations-next-lite.min.js" -) - -tb_new_http_archive( - NAME webcomponentsjs - URL "https://github.com/webcomponents/webcomponentsjs/archive/v0.7.22.tar.gz" - FILES "CustomElements.js" - "CustomElements.min.js" - "HTMLImports.js" - "HTMLImports.min.js" - "MutationObserver.js" - "MutationObserver.min.js" - "ShadowDOM.js" - "ShadowDOM.min.js" - "webcomponents.js" - "webcomponents.min.js" - "webcomponents-lite.js" - "webcomponents-lite.min.js" -) - -tb_http_file( - NAME weblas_weblas_js - URL "https://raw.githubusercontent.com/waylonflinn/weblas/v0.9.0/dist/weblas.js" -) \ No newline at end of file