Coder Social home page Coder Social logo

go-astilectron-bundler's Introduction

This package provides a way to bundle an astilectron app using the bootstrap.

Check out the demo to see a working example.

Installation

Run the following command:

$ go get -u github.com/asticode/go-astilectron-bundler/...

Configuration

astilectron-bundler uses a configuration file to know what it's supposed to do. Here's an example:

{
  "app_name": "Test",
  "environments": [
    {"arch": "amd64", "os": "darwin"},
    {"arch": "amd64", "os": "linux"},
    {"arch": "amd64", "os": "windows"}
  ],
  "icon_path_darwin": "path/to/icon.icns",
  "icon_path_linux": "path/to/icon.png",
  "icon_path_windows": "path/to/icon.ico",
  "input_path": "path/to/src/github.com/username/project",
  "output_path": "path/to/output/directory"
}

Paths can be either relative or absolute but we strongly encourage to use relative paths.

If no input path is specified, the working directory path is used.

We strongly encourage to leave the input path option empty and execute the bundler while in the directory of the project you're bundling.

Usage

If astilectron-bundler has been installed properly (and the $GOPATH is in your $PATH), run the following command:

$ astilectron-bundler -v -c <path to your configuration file>

or if your working directory is your project directory and your bundler configuration has the proper name (bundler.json)

$ astilectron-bundler -v

Output

For each environment you specify in your configuration file, astilectron-bundler will create a folder <output path you specified in the configuration file>/<os>-<arch> that will contain the proper files.

Ldflags

astilectron-bundler uses ldflags when building the project. It means if you add one of the following variables as global exported variables in your project, they will have the following value:

  • AppName: filled with the configuration app name
  • BuiltAt: filled with the date the build has been done at

Subcommands

Only bind data: bd

Use this subcommand if you want to skip most of the bundling process and only bind data/generate the bind.go file (useful when you want to test your app running go run *.go):

$ astilectron-bundler bd -v -c <path to your configuration file>

Clear the cache: cc

The bundler stores downloaded files in a cache to avoid downloading them over and over again. That cache may be corrupted. In that case, use this subcommand to clear the cache:

$ astilectron-bundler cc -v

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.