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
}
Post by Johan VosHi 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
https://github.com/javafxports/openjdk-jfx/blob/develop/tools/scripts/build.ps1
Post by Michael EnnenIt is what I use to automate the process of building OpenJFX on Windows
as
Post by Michael Ennenmuch as
possible. Any improvements to the script would be appreciated.
https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX#BuildingOpenJFX-EnvironmentVariables
Post by Michael EnnenPost by f***@swingempire.dePost by f***@swingempire.dethat is having downloaded, installed the required tools, added env
vars as desribed.
Then in cygwin, navigate to the git working dir, typing
gradle tasks
FAILURE: Build failed with an exception.
Script
'C:\Daten\data-for-work\eclipse\gitrep-openjdk\openjdk-jfx\buildSrc\win.gradle'
Post by Michael EnnenPost by f***@swingempire.dePost by f***@swingempire.de92
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?
Post by f***@swingempire.deThanks, Jeanette
BTW: did I ever mention that I hate command line tools - and they
feel it, fighting back with all they got ;)
--
Michael Ennen