From f25f50511e1e752eaf940a98e34b72a48e2cd4b6 Mon Sep 17 00:00:00 2001
From: murgatroid99 <mlumish@google.com>
Date: Thu, 13 Apr 2017 17:22:32 -0700
Subject: [PATCH] Build for more versions of electron, restrict when a Windows
 warning is shown

---
 binding.gyp                                       | 4 +++-
 templates/binding.gyp.template                    | 4 +++-
 tools/run_tests/artifacts/build_artifact_node.bat | 2 +-
 tools/run_tests/artifacts/build_artifact_node.sh  | 2 +-
 tools/run_tests/run_tests.py                      | 4 ++--
 tools/run_tests/run_tests_matrix.py               | 3 ++-
 6 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/binding.gyp b/binding.gyp
index b33cef5a4e..16334a22a7 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -507,7 +507,7 @@
         },
       ]
     }],
-    ['OS == "win"', {
+    ['OS == "win" and runtime!="electron"', {
       'targets': [
         {
           # IMPORTANT WINDOWS BUILD INFORMATION
@@ -518,6 +518,8 @@
           # when including the Node headers. The remedy for this is to remove
           # the OpenSSL headers, from the downloaded Node development package,
           # which is typically located in `.node-gyp` in your home directory.
+          #
+          # This is not true of Electron, which does not have OpenSSL headers.
           'target_name': 'WINDOWS_BUILD_WARNING',
           'rules': [
             {
diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template
index 55a91c5b93..a2e8c58892 100644
--- a/templates/binding.gyp.template
+++ b/templates/binding.gyp.template
@@ -205,7 +205,7 @@
           % endfor
         ]
       }],
-      ['OS == "win"', {
+      ['OS == "win" and runtime!="electron"', {
         'targets': [
           {
             # IMPORTANT WINDOWS BUILD INFORMATION
@@ -216,6 +216,8 @@
             # when including the Node headers. The remedy for this is to remove
             # the OpenSSL headers, from the downloaded Node development package,
             # which is typically located in `.node-gyp` in your home directory.
+            #
+            # This is not true of Electron, which does not have OpenSSL headers.
             'target_name': 'WINDOWS_BUILD_WARNING',
             'rules': [
               {
diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat
index 336a63b9f5..bfd4461f72 100644
--- a/tools/run_tests/artifacts/build_artifact_node.bat
+++ b/tools/run_tests/artifacts/build_artifact_node.bat
@@ -29,7 +29,7 @@
 
 set node_versions=4.0.0 5.0.0 6.0.0 7.0.0
 
-set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0
+set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0
 
 set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
 
diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh
index a33ab45ac2..2da2ac5f91 100755
--- a/tools/run_tests/artifacts/build_artifact_node.sh
+++ b/tools/run_tests/artifacts/build_artifact_node.sh
@@ -44,7 +44,7 @@ npm update
 
 node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 )
 
-electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 )
+electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 )
 
 for version in ${node_versions[@]}
 do
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index cfa7071e00..9130bc960a 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -429,7 +429,7 @@ class NodeLanguage(object):
     # we should specify in the compiler argument
     _check_compiler(self.args.compiler, ['default', 'node0.12',
                                          'node4', 'node5', 'node6',
-                                         'node7', 'electron1.3'])
+                                         'node7', 'electron1.3', 'electron1.6'])
     if args.iomgr_platform == "uv":
       self.use_uv = True
     else:
@@ -1178,7 +1178,7 @@ argp.add_argument('--compiler',
                            'vs2013', 'vs2015',
                            'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine',
                            'node0.12', 'node4', 'node5', 'node6', 'node7',
-                           'electron1.3',
+                           'electron1.3', 'electron1.6',
                            'coreclr',
                            'cmake'],
                   default='default',
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index a00d84fd9a..8bc8236b24 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -287,7 +287,8 @@ def _create_portability_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS)
                               configs=['dbg'],
                               platforms=['linux'],
                               arch='default',
-                              compiler='electron1.3',
+                              compiler='electron1.6',
+                              iomgr_platform='uv',
                               labels=['portability'],
                               extra_args=extra_args,
                               inner_jobs=inner_jobs)
-- 
GitLab