From 32ba5ae647e85e3a8ad39793df02585024ff4db3 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 17 Nov 2016 04:46:31 -0800 Subject: [PATCH] Make gtest a submodule in open source Summary: Remove infra for dynamically downloading gtest as this fails like 50% of the time on travis. I'll manually push gtest as a submodule instead. Reviewed By: gkassabli Differential Revision: D4183033 fbshipit-source-id: 09a121b8ede7a5974a29b6692edc63bff79aece7 --- .gitignore | 1 - .hgignore | 3 +-- CSSLAYOUT_DEFS | 2 -- lib/gtest/BUCK | 24 ++++-------------------- 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 2a22d83c..5b346768 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ /buck-out/ /.buckconfig.local /.buckd -/lib/gtest/googletest-*/ /gentest/test.html # Visual studio code diff --git a/.hgignore b/.hgignore index 875f1d7d..5b346768 100644 --- a/.hgignore +++ b/.hgignore @@ -4,8 +4,7 @@ /buck-out/ /.buckconfig.local /.buckd -/lib/gtest/googletest-*/ /gentest/test.html # Visual studio code -.vscode \ No newline at end of file +.vscode diff --git a/CSSLAYOUT_DEFS b/CSSLAYOUT_DEFS index 5937d48a..91d372ab 100644 --- a/CSSLAYOUT_DEFS +++ b/CSSLAYOUT_DEFS @@ -6,8 +6,6 @@ JUNIT_TARGET = '//lib/junit:junit' PROGRUARD_ANNOTATIONS_TARGET = '//java/com/facebook/proguard/annotations:annotations' SOLOADER_TARGET = '//lib/soloader:soloader' GTEST_TARGET = '//lib/gtest:gtest' -GTEST_DL_URL = 'https://github.com/google/googletest/archive/release-1.7.0.zip' - JNI_TARGET = '//lib/jni:jni' FBJNI_TARGET = '//lib/fb:fbjni' diff --git a/lib/gtest/BUCK b/lib/gtest/BUCK index d1a01d56..d2e136b9 100644 --- a/lib/gtest/BUCK +++ b/lib/gtest/BUCK @@ -7,22 +7,6 @@ include_defs('//CSSLAYOUT_DEFS') -with allow_unsafe_import(): - import os - import urllib2 - import zipfile - -# Download gtest dep if it does not exists in path -current_dir = os.path.dirname(os.path.realpath(__file__)) -gtest_folder = 'googletest-release-1.7.0' -if GTEST_DL_URL != None and not os.path.isdir(current_dir + gtest_folder): - gtest = urllib2.urlopen('https://github.com/google/googletest/archive/release-1.7.0.zip').read() - with open("gtest.zip", 'w') as f: - f.write(gtest) - with zipfile.ZipFile('gtest.zip',"r") as zip: - zip.extractall(os.path.dirname(os.path.realpath(__file__))) - os.remove('gtest.zip') - COMPILER_FLAGS = [ '-std=c++11', '-Wno-missing-prototypes', @@ -30,11 +14,11 @@ COMPILER_FLAGS = [ cxx_library( name = 'gtest', - srcs = glob([gtest_folder + '/src/*.cc']), + srcs = glob(['googletest/googletest/src/*.cc']), exported_headers = subdir_glob([ - (gtest_folder + '/include', '**/*.h'), - (gtest_folder, 'src/*.h'), - (gtest_folder, 'src/*.cc'), + ('googletest/googletest/include', '**/*.h'), + ('googletest/googletest', 'src/*.h'), + ('googletest/googletest', 'src/*.cc'), ]), header_namespace = '', compiler_flags = COMPILER_FLAGS,