Skip to content

Azure DevOps Build and NuGet binary distribution of the V8 JavaScript engine

License

Notifications You must be signed in to change notification settings

BaristaLabs/Espresso-v8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Espresso-v8

This package contains scripts and configuration to perform automated multi-platform V8 Builds using Azure DevOps and publish the resulting binaries to NuGet. These pre-built V8 libraries and headers then can be used to embed the V8 JavaScript engine into multi-platform C++ projects.

Note: This repository contains dynamic and static V8 builds targeting win-VS2019, macOS, and Ubuntu using a different set of GN_Options used for BaristaLabs.Espresso. See this repository for different windows-based platform toolsets.

Build Status

Package Version
V8 Windows x86 for Visual Studio 2019 NuGet
V8 Windows x64 for Visual Studio 2019 NuGet
V8 Static Windows x64 for Visual Studio 2019 NuGet
V8 macOS x64 NuGet
V8 Ubuntu x64 NuGet

Usage

Most people who find this project want to simply embed the pre-built v8 binaries from nuget mentioned above into a C++ project.

To use V8 in a project install the package BaristaLabs.Espresso.v8.win-$Configuration.$Version from a console with nuget install command or from inside of Visual Studio (see menu option Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...) where

After successful packages installation add #include <v8.h> in a C++ project and build it. In Visual Studio 2019, all necessary files (*.lib, *.dll, *.pdb) would be referenced in the project automatically with MsBuild property sheets.

This is not currently true for macOS and Ubuntu using Visual Studio for Mac or other IDEs.

How to build and publish in Azure Devops

Simply fork this repo, reference it in Azure Devops project, create a new YAML build pipeline, select the azure-pipelines.yml file from this repo and queue a build.

The included pipeline will check for the latest version of v8 against the nuget package name and build, pack and push a new nuget package if outdated. The author of this project uses a nightly trigger to check for new, stable v8 releases and automatically publish new builds.

Consumers of this project might want to change the package name or publish to a private nuget feed, those exercises are left to the reader.

How to build and publish in a local dev environment

Ensure that build dependencies have been are installed in the approprate environments.

See the following for a reference: https://v8.dev/docs/build

Also, in windows, install the Windows 10 SDK separately from Visual Studio 2019: https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk (See Note Below))

Ensure the Debugging tools are installed as it is required.

To build V8 and make NuGet packages:

Simply run through the powershell scripts sequentially for the target environment. Use the azure-pipelines.yml as a guide for the inputs.

./scripts/checkReleaseStatus # Determine which releases need to be built.
./scripts/win-self-hosted/win-build-v8-1.ps1 # Download v8 Build Dependencies
./scripts/win/win-build-v8-2.ps1 -V8_VERSION 8.3.110.138 # Fetch a specific v8 version from source
./scripts/win/win-build-v8-3.ps1 # Build v8
./scripts/win/win-build-v8-4.ps1 # Generate nuspec and props

Once the 4 scripts have been run, package/push using NuGet.

nuget pack
nuget push *.nupkg -ApiKey <apikey> -Source https://api.nuget.org/v3/index.json

Note: Visit https://omahaproxy.appspot.com/ for a list of the V8 versions that correspond to a Chrome build.

Note: When building on Windows, installing the Windows 10 SDK as part of the Visual Studio 2019 installation is insufficient as it does not include the 'Debugging Tools for Windows' feature Ensure that is included by first removing (the latest) Windows 10 SDK using the Visual Studio 2019 installer then installing the Windows 10 SDK from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/ ensuring that 'Debugging Tools for Windows' is selected when installing.