New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command-line tool "librepcb-cli" #299

Merged
merged 4 commits into from Aug 11, 2018

Conversation

Projects
None yet
2 participants
@ubruhin
Member

ubruhin commented Aug 4, 2018

This adds a first version of a librepcb-cli application which is intended to automate some frequently used tasks. It's especially useful for Continuous Integration of LibrePCB projects (e.g. with Travis-CI).

Currently it supports to load a project and...

  • Report ERC messages (report failure if there are non-approved messages)
  • Export schematics as PDF
  • Export boards as Gerber/Excellon

For usage instructions see documentation here: https://docs.librepcb.org/_branches/add-cli/#cli

ubruhin added some commits Aug 3, 2018

Project: Improve usage in non-interactive mode
- Make sure no message boxes are shown when opening projects from CLI.
- Don't open PDF viewer after exporting schematics as PDF.
- Automatically create parent directories when exporting to PDF.
- Use QString for searching boards/schematics by name.

@ubruhin ubruhin added the enhancement label Aug 4, 2018

@ubruhin ubruhin self-assigned this Aug 4, 2018

@ubruhin ubruhin referenced this pull request Aug 4, 2018

Merged

Add CLI documentation #19

Show outdated Hide outdated apps/librepcb-cli/commandlineinterface.cpp Outdated
Show outdated Hide outdated apps/librepcb-cli/commandlineinterface.cpp Outdated
Show outdated Hide outdated apps/librepcb-cli/commandlineinterface.h Outdated
@dbrgn

This comment has been minimized.

Show comment
Hide comment
@dbrgn

dbrgn Aug 5, 2018

Contributor

In theory the "create project" dialog could ask to generate CI config files for Travis/CircleCI/Gitlab CI 🙂 However, that would require some kind of opt-in (since you don't want to pollute projects). Same thing would apply to the .gitignore file, which some people might not want. What do you think?

Contributor

dbrgn commented Aug 5, 2018

In theory the "create project" dialog could ask to generate CI config files for Travis/CircleCI/Gitlab CI 🙂 However, that would require some kind of opt-in (since you don't want to pollute projects). Same thing would apply to the .gitignore file, which some people might not want. What do you think?

@ubruhin

This comment has been minimized.

Show comment
Hide comment
@ubruhin

ubruhin Aug 5, 2018

Member

In theory the "create project" dialog could ask to generate CI config files for Travis/CircleCI/Gitlab CI slightly_smiling_face However, that would require some kind of opt-in (since you don't want to pollute projects).

Yes maybe a dropdown to choose the used CI service would be nice. But I would just wait a bit with implementing this until the CLI is more mature...

In addition to changing the exit code, I think I'll also change these two things:

  • Rename --export-schematics-pdf=<file> to --export-schematics=<file>. The file type is then automatically determined by the file ending. This allows to support many different formats (PDF, PNG, SVG, ...) with a single command line option (which can be given multiple times). Maybe it would some time make sense to add (optional) parameters for the export, for example something like --export-schematics="schematics_{{PAGE}}.png,resolution=300dpi,background=transparent".
  • Rename --check-erc to --erc (the "c" in "erc" stands for "check" anyway).
Member

ubruhin commented Aug 5, 2018

In theory the "create project" dialog could ask to generate CI config files for Travis/CircleCI/Gitlab CI slightly_smiling_face However, that would require some kind of opt-in (since you don't want to pollute projects).

Yes maybe a dropdown to choose the used CI service would be nice. But I would just wait a bit with implementing this until the CLI is more mature...

In addition to changing the exit code, I think I'll also change these two things:

  • Rename --export-schematics-pdf=<file> to --export-schematics=<file>. The file type is then automatically determined by the file ending. This allows to support many different formats (PDF, PNG, SVG, ...) with a single command line option (which can be given multiple times). Maybe it would some time make sense to add (optional) parameters for the export, for example something like --export-schematics="schematics_{{PAGE}}.png,resolution=300dpi,background=transparent".
  • Rename --check-erc to --erc (the "c" in "erc" stands for "check" anyway).
@ubruhin

This comment has been minimized.

Show comment
Hide comment
@ubruhin

ubruhin Aug 5, 2018

Member

Updated the branch as described above. In addition, I renamed --export-gerber to --export-pcb-fabrication-data (Gerber was not completely correct, it also generates Excellon files).

Also updated the documentation accordingly: https://docs.librepcb.org/_branches/add-cli/#cli

Member

ubruhin commented Aug 5, 2018

Updated the branch as described above. In addition, I renamed --export-gerber to --export-pcb-fabrication-data (Gerber was not completely correct, it also generates Excellon files).

Also updated the documentation accordingly: https://docs.librepcb.org/_branches/add-cli/#cli

@ubruhin ubruhin merged commit 100bda4 into master Aug 11, 2018

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ubruhin ubruhin deleted the add-cli branch Aug 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment