asticode / go-astilectron-bundler

Bundle your Astilectron app with ease
MIT License
127 stars 67 forks source link

Add the possibility to specify the vendor directory in the configuration file. #10

Closed mathieupost closed 6 years ago

mathieupost commented 6 years ago

At the moment I can't use the vendor directory feature of Go, because bundler also uses the vendor directory and removes the whole directory before building my application.

It would be nice to be able to specify the location of the vendor directory that astilectron uses, so that we can still use dependency management tools like dep.

Like this:

{
  "app_name": "Test",
  "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",
  "vendor_path": "path/to/vendor/directory"
}
asticode commented 6 years ago

@mathieupost I've pushed the following changes:

You'll have to go get then make the bundler to get the changes.

Does that fix your issue?

raydac commented 6 years ago

all input paths and output paths should be customizable else it is impossible to use the builder in autobuild tools :(

asticode commented 6 years ago

@raydac almost all paths were already customizable through the configuration except the resources path so I've added it.

@mathieupost I've updated the vendor_path configuration attribute to a vendor_dir_path configuration attribute that represents the directory that will contain the vendor directory. Indeed the name of the vendor directory can't be customized.

Does that fix your issue?

raydac commented 6 years ago

now it creates the vendor_dir_path just in my source folder and I would like to move it into some temp folder

asticode commented 6 years ago

@raydac it's the default behavior indeed. You can use the vendor_dir_path configuration attribute to create it elsewhere:

{
  "app_name": "Test",
  "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",
  "vendor_dir_path": "path/to/vendor/directory"
}

This should create a path/to/vendor/directory/vendor_astilectron_bundler folder and use it to store vendor files.

Let me know if that doesn't do what's expected.

raydac commented 6 years ago

cool! thanks! I also would recommend you to provide way to define paths through command line because in case of autotools it is much better way for automation and providing dynamic paths than filtering resource files to replace parameters

mathieupost commented 6 years ago

@asticode perfect! I'll try it out somewhere today or tomorrow :+1:

asticode commented 6 years ago

@mathieupost perfect, feel free to reopen the issue if something doesn't work as expected