Hi Johan,

Michael's build script helped me a lot. I'm on windows 10. It just runs in
powershell after installing chocolatey, (.\tools\scripts\build1.ps from the
openjdk root dir). The only environment variables I've got set are
JAVA_HOME/JDK_HOME. I did have to make some modifications however to
install the other dependencies and to handle the .dll's that weren't
packaged. Everything ran fine on my machine, but as soon as I tried using
the jars on another machine, I got linker errors. Below is the modified
version. It won't package the correct dlls if DebugNative is used though,
but as it is, it's working for me.

Dean

.\gradlew --stop
choco install ant
choco install vswhere
choco install zip
choco install visualstudio2017community
choco install visualstudio2017-workload-nativedesktop
choco install windows-sdk-7.1
choco install cygwin

$cygwinPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Cygwin\setup").rootdir
$env:Path += ";$($cygwinPath)\bin"

$env:WINSDK_DIR = (Get-ItemProperty -Path
"HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed
Roots").KitsRoot10
$env:VCINSTALLDIR = "$(vswhere -legacy -latest -property
installationPath)\VC\Auxiliary\Build"
$vcRoot = "$(vswhere -legacy -latest -property installationPath)"
$msvcToolsVer = Get-Content
"$env:VCINSTALLDIR\Microsoft.VCToolsVersion.default.txt"
$msvcRedistVer = Get-Content
"$env:VCINSTALLDIR\Microsoft.VCRedistVersion.default.txt"

if ([string]::IsNullOrWhitespace($msvcToolsVer)) {
  # The MSVC tools version file can have txt *or* props extension.
  $msvcToolsVer = Get-Content
"$env:VCINSTALLDIR\Microsoft.VCToolsVersion.default.props"
}
$env:MSVC_VER = $msvcToolsVer
$env:MSVC_REDIST_VER = $msvcRedistVer

$files = Get-ChildItem
"$($vcRoot)/VC/Redist/MSVC/$($msvcRedistVer)/x86/*.CRT/"
$crtVer = $files[0].Name.replace("Microsoft.VC","").replace(".CRT","")
$env:WINDOWS_CRT_VER = $crtVer


$env:VS150COMNTOOLS = $env:VCINSTALLDIR
$env:VSVARS32FILE = "$env:VCINSTALLDIR\vcvars32.bat"
refreshenv
if ($env:APPVEYOR -eq "true") {
  .\gradlew all test -PCOMPILE_WEBKIT=false -PCONF=Debug --stacktrace -x
:web:test --info --no-daemon
  if ($lastexitcode -ne 0) {
    exit $lastexitcode
  }
} else {
  .\gradlew all test -PCOMPILE_WEBKIT=false -PCONF=Debug --stacktrace -x
:web:test --info
}

On Fri, Nov 2, 2018 at 8:57 PM Johan Vos <johan....@gluonhq.com> wrote:

> Hi Michael,
>
> What environment do you use to run that Windows build script?
> The windows builds are the ones I still feel least comfortable about. We
> tried to automate those on AdoptOpenJDK infrastructure, but they are using
> Ansible for provisioning machines (for very good reasons), and we spent
> days trying to come up with an Ansible script that allowed to build on
> Windows, without 100% success.
> Hence, we currently create the windows build on a Windows machine with a
> fixed setup. It would be better of course to move more of the environment
> and context parameters to the build procedure itself, and your script seems
> a step in that direction. But what infrastructure do you use to run this?
>
> - Johan
>
> On Thu, Nov 1, 2018 at 11:17 PM Michael Ennen <mike.en...@gmail.com>
> wrote:
>
> > Also don't forget about the Windows build script:
> >
> >
> >
> https://github.com/javafxports/openjdk-jfx/blob/develop/tools/scripts/build.ps1
> >
> > It is what I use to automate the process of building OpenJFX on Windows
> as
> > much as
> > possible. Any improvements to the script would be appreciated.
> >
> > On Wed, Oct 31, 2018 at 7:03 AM <faste...@swingempire.de> wrote:
> >
> > > forgot the link to the instruction page, just in case there's another:
> > >
> > >
> > >
> >
> https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX#BuildingOpenJFX-EnvironmentVariables
> > >
> > > Zitat von faste...@swingempire.de:
> > >
> > > > first try, following the instructions (for win10) at:
> > > >
> > > > that is having downloaded, installed the required tools, added env
> > > > vars as desribed.
> > > >
> > > > Then in cygwin, navigate to the git working dir, typing
> > > >
> > > > gradle tasks
> > > >
> > > > fails with:
> > > >
> > > > FAILURE: Build failed with an exception.
> > > >
> > > > * Where:
> > > > Script
> > > >
> > >
> >
> 'C:\Daten\data-for-work\eclipse\gitrep-openjdk\openjdk-jfx\buildSrc\win.gradle'
> > > line:
> > > > 92
> > > >
> > > > * What went wrong:
> > > > A problem occurred evaluating script.
> > > >> FAIL: WINSDK_DIR not defined
> > > >
> > > > to me, it looks the env var WINSDK_DIR is not set - what should go in
> > > there?
> > > >
> > > > Thanks, Jeanette
> > > >
> > > > BTW: did I ever mention that I hate command line tools - and they
> > > > feel it, fighting back with all they got ;)
> > >
> > >
> > >
> > >
> >
> > --
> > Michael Ennen
> >
>

Reply via email to