changeset 11137:e6bc74c5a1fa

8215629: Add "-nocygwin" and "USE_CYGWIN" properties to build.ps1 and build.gradle Reviewed-by: kcr
author mennen
date Thu, 20 Dec 2018 17:40:02 -0800
parents 94f51e852ad6
children 4b5124cce8cf
files build.gradle tools/scripts/build.ps1
diffstat 2 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Thu Dec 20 18:42:00 2018 +0530
+++ b/build.gradle	Thu Dec 20 17:40:02 2018 -0800
@@ -475,6 +475,11 @@
 defineProperty("JCOV", "false")
 ext.DO_JCOV = Boolean.parseBoolean(JCOV)
 
+// Specifies whether to use Cygwin when building OpenJFX. This should only ever
+// be set to false for development builds (that skip building media and webkit).
+defineProperty("USE_CYGWIN", "true")
+ext.IS_USE_CYGWIN = Boolean.parseBoolean(USE_CYGWIN)
+
 // Define the number of threads to use when compiling (specifically for native compilation)
 // On Mac we limit it to 1 by default due to problems running gcc in parallel
 if (IS_MAC) {
@@ -4007,7 +4012,7 @@
         // Need to modify file permissions Windows to make sure that the
         // execute bit is set, and that the files are world readable
         def chmodArtifactsSdkTask = task("chmodArtifactsSdk$t.capital", dependsOn: copyArtifactsSdkTask) {
-            if (IS_WINDOWS) {
+            if (IS_WINDOWS && IS_USE_CYGWIN) {
                 doLast {
                     exec {
                         workingDir(sdkArtifactsDir)
--- a/tools/scripts/build.ps1	Thu Dec 20 18:42:00 2018 +0530
+++ b/tools/scripts/build.ps1	Thu Dec 20 17:40:02 2018 -0800
@@ -1,3 +1,5 @@
+param ([switch]$nocygwin = $false)
+
 choco install ant
 choco install vswhere
 choco install zip
@@ -22,10 +24,14 @@
 }
 
 # Cygwin required for chmod
-$cygwinPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Cygwin\setup").rootdir 2>$null
-if ([string]::IsNullOrWhitespace($cygwinPath)) {
-  choco install cygwin
-  $cygwinPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Cygwin\setup"  -ErrorAction Stop).rootdir
+if ($nocygwin -eq $false) {
+  $cygwinPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Cygwin\setup").rootdir 2>$null
+  if ([string]::IsNullOrWhitespace($cygwinPath)) {
+    choco install cygwin
+    $cygwinPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Cygwin\setup"  -ErrorAction Stop).rootdir
+  }
+} else {
+  Write-Output "Skipping cygwin install!"
 }
 
 if ($env:Path -NotLike "*$($cygwinPath)*") {
@@ -55,5 +61,9 @@
     exit $lastexitcode
   }
 } else {
-  .\gradlew all test -PCOMPILE_WEBKIT=false -PCONF=Debug --stacktrace -x :web:test --info --no-daemon
+  if ($noCygwin) {
+    .\gradlew all test -PCOMPILE_WEBKIT=false -PCONF=Debug -PUSE_CYGWIN=false --stacktrace -x :web:test --info --no-daemon
+  } else {
+    .\gradlew all test -PCOMPILE_WEBKIT=false -PCONF=Debug --stacktrace -x :web:test --info --no-daemon
+  }
 }