Update setup_windows_build_environment

This commit is contained in:
Cody Gramlich 2018-09-21 08:05:30 -06:00 committed by GitHub
parent 868e4f8771
commit d675d1fa1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,18 +1,13 @@
# How to set up the build environment for Browsh on Windows # How to set up the build environment for Browsh on Windows
This guide is for those who want to set up the build environment on Windows Command Prompt or Powershell. Since some of the shell scripts are needed to set up the environment, you can just use **Git Bash** to run these scripts.
## Installing golang ## Setting up Go, NodeJs, and GOPATH
Get the latest amd64 for Windows on the [golang download page](https://golang.org/dl/). Download and install Go at [Go download page](https://golang.org/dl/).
Run the msi file. Download and install NodeJs at [NodeJs download page](https://nodejs.org/en/download/)
## Installing nodejs/npm Using Command Prompt or Powershell:
Go to the [nodejs download page](https://nodejs.org/en/download/) and select the LTS version of Windows Installer (msi).
Run the msi file.
## Setting up GOPATH
Create a go directory: Create a go directory:
> mkdir go > mkdir go
@ -24,37 +19,60 @@ Set GOPATH to current directory.
Create subdirectories bin and src within your go directory: Create subdirectories bin and src within your go directory:
> mkdir bin > mkdir bin
> mkdir src > mkdir src
## Installing chocolatey and dep
## Installing dep Download and install Chocolatey package manager at [Chocolatey download page](https://chocolatey.org/install).
Using chocolatey package manager run: Using chocolatey package manager run:
> choco install dep > choco install dep
## Installing webpack ## Installing webpack, web-ext, and Firefox
> npm install -g --no-audit webpack > npm install -g --no-audit webpack
## Installing web-ext > npm install -g --ignore-scripts web-ext
npm install -g --ignore-scripts web-ext
## Installing firefox Download and install Firefox for Windows at [Firefox download page](https://www.mozilla.org/en-US/firefox/new/).
**Version 57 or higher is required.** Note: **Version 57 or higher is required.**
## Cloning the browsh repository ## Cloning the browsh repository
Navigate to GOPATH/src and run: Navigate to GOPATH/src and run:
git clone https://github.com/browsh-org/browsh.git git clone https://github.com/browsh-org/browsh.git
## Setting up the build environment in the cloned repository
### Setting up dependencies ## Setting up dependencies
Navigate to interfacer and run: Navigate to browsh/webext and run:
> dep ensure
Navigate to webext and run:
> npm run get-gobindata > npm run get-gobindata
> npm install
## Building Browsh
Using Git Bash, navigate to browsh/interfacer/contrib and run:
> ./build_browsh.sh
> ./xpi2bin.sh
## Running Browsh
Using Command Prompt or Powershell:
Navigate to GOPATH/browsh and run:
go run ./interfacer/src/main.go --firefox.use-existing --debug
Navigate to browsh/webext and run:
webpack --watch
Navigate to browsh/webext/dist and run:
web-ext run --verbose