Skip to content

Commit

Permalink
Merge pull request #305 from pseudomuto/go_port
Browse files Browse the repository at this point in the history
Port to Go for 1.0 Release
  • Loading branch information
pseudomuto authored Sep 26, 2017
2 parents ebda2ab + 23825e5 commit c44297c
Show file tree
Hide file tree
Showing 83 changed files with 6,094 additions and 4,545 deletions.
59 changes: 0 additions & 59 deletions .appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/
!/script
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
protoc-gen-doc
/Makefile
*.o
*.pro.user*
qrc_*
.qmake.stash
/dist
/gen_fixtures
/protoc-gen-doc
/test/*.dat
/vendor
/tmp/
87 changes: 37 additions & 50 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,41 @@
language: cpp

addons:
apt:
packages:
- libqt5core5a
- qt5-qmake
- qt5-default
- libprotobuf-dev
- libprotoc-dev
- protobuf-compiler
- docbook-xsl
- fop
- libservlet2.4-java

matrix:
include:
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QMAKESPEC=linux-g++
- DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl
- os: linux
dist: trusty
sudo: required
compiler: clang
env:
- QMAKESPEC=linux-clang
- DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl
- os: osx
compiler: clang
env: DOCBOOK_XSL=/usr/local/opt/docbook-xsl/docbook-xsl/fo/docbook.xsl

before_install:
- '[[ "$TRAVIS_OS_NAME" != "osx" ]] || brew update'
language: go
sudo: required

services:
- docker

env:
global:
- PROTOC_RELEASE="https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip"
- PROTOC_TARGET="${HOME}/protoc"
- PATH="${PROTOC_TARGET}/bin:${PATH}"
- secure: Tbet2rxD8QgjthAo+bxt41qbF2wUPTx0difGK5p4yQISK/njTuT5cqcxnOa4GIbyKtNtx0EgGnyVcQJiQkmZiF6Sabf0mtqU/CQ4PmVV76e9bHwA/CrTtudibMn16ozxuuxvhNxFOMQEhwcQOkW93M/Q9FZUEw9/CGpRGFfSzuA=

cache:
- "${HOME}/protoc"
- "${HOME}/gopath/src/github.com/pseudomuto/protoc-gen-doc/vendor"

go:
- 1.8.x

install:
- '[[ "$TRAVIS_OS_NAME" != "osx" ]] || brew install qt5 protobuf fop docbook-xsl'
- '[[ "$TRAVIS_OS_NAME" != "osx" ]] || brew link --force qt5'
- '[[ "$TRAVIS_OS_NAME" != "osx" ]] || export PROTOBUF_PREFIX=$(brew --prefix protobuf)'
- if [ ! -d "${PROTOC_TARGET}" ]; then curl -fsSL "$PROTOC_RELEASE" > "${PROTOC_TARGET}.zip"; fi
- if [ -f "${PROTOC_TARGET}.zip" ]; then unzip "${PROTOC_TARGET}.zip" -d "${PROTOC_TARGET}"; fi
- go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
- go get -u github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout tags/v0.12.3 && go install && cd -
- glide install

script:
- qmake
- make
- cd examples
- make clean
- make
- test -s doc/example.html
- test -s doc/example.md
- test -s doc/example.docbook
- test -s doc/example.pdf
- test -s doc/example.json
- make test
- make bench

deploy:
provider: script
script: script/push_to_docker.sh
on:
tags: true
all_branches: true

notifications:
email: false
65 changes: 0 additions & 65 deletions BUILDING.md

This file was deleted.

76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# v0.9 - February 26, 2017

This is the ninth official release.

**changes**

* Improve installation instructions for macOS (thanks @guozheng)
* Improve installation instructions for Debian/Ubuntu (thanks @mhaberler)
* Add asciidoc.mustache example template (thanks @ArcEye)
* Don't do HTML escaping in Markdown template (thanks @sunfmin)
* Add support for JSON output

# v0.8 - February 26, 2016

This is the eight official release.

**changes**

* Add support for documenting files (#9)
* Add support for default values (#11)
* Add no-exclude flag to ignore @exclude directives (#13)
* Add support for RPC services (#14) (thanks to @murph0 !)

# v0.7 - January 7, 2016

This is the seventh official release.

**changes**

* Added support for extensions (thanks @masterzen !)
* Added Custom Templates wiki page
* Added additional distro packages for Debian 8, Ubuntu 15.04 + 15.10 and Fedora 22 + 23

# v0.6 - April 8, 2015

This is the sixth official release.

No functional changes were made, but Linux distribution package repositories are now provided for Ubuntu, Arch, Fedora
and openSUSE through the Open Build Service, and an RPM for CentOS 7 here below.

# v0.5 - December 19, 2014

This is the fifth official release.

**changes**

* Support exclusion also of enum values (accidental omission in 0.4).

# v0.4 - December 19, 2014

This is the fourth official release.

**changes**

* Updated to a newer version of qt-mustache.
* Updated Windows zip to libprotobuf/libprotoc 2.6.1.
* Added support for excluding messages/enums/fields.

# v0.3 - August 19, 2014

This is the third official release.

**changes**

* Updated to a newer version of qt-mustache which is more spec compliant.
* Added missing documentation for enums to Markdown output.

# v0.2 - August 14, 2014

This is the second official release.

* No functional changes were made, but the build system was improved.

# v0.1 - August 6, 2014

* Initial release
80 changes: 80 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Contributing

First off, glad you're here and want to contribute! :heart:

## Getting Started

In order to work on this project, you'll need to install a few things:

1. A recent version of [Go](https://golang.org/doc/install)
1. [Glide](https://github.com/Masterminds/glide#install) - go package manager
1. [protoc](https://github.com/google/protobuf#protocol-compiler-installation) - The protobuf compiler
1. [Docker](https://www.docker.com/) (only required to if you need/want to build the docker container via `make docker`)

When writing tests, be sure that the package in the test file is suffixed with `_test`. Eg. `protoc_gen_doc_test`. This
ensures that you'll only be testing the public interface.

## Submitting a PR

Here are some general guidelines for making PRs for this repo.

1. [Fork this repo](https://github.com/pseudomuto/protoc-gen-doc/fork)
1. Make a branch off of master (`git checkout -b <your_branch_name>`)
1. Make focused commits with descriptive messages
1. Add tests that fail without your code, and pass with it
1. GoFmt your code! (see <https://blog.golang.org/go-fmt-your-code> to setup your editor to do this for you)
1. Be sure to run `make examples` so your changes are reflected in the example docs
1. **Ping someone on the PR** (Lots of people, including myself, won't get a notification unless pinged directly)

Every PR should have a well detailed summary of the changes being made and the reasoning behind them. Make sure to add
at least three sections.

### What is Changing?

Make sure you spell out in as much detail as necessary what will happen to which systems when your PR is merged,
what are the expected changes.

### How is it Changing?

Include any relevant implementation details, mimize surprises for the reviewers in this section, if you had to take some
unorthodox approaches (read hacks), explain why here.

### What Could Go Wrong?

How has this change been tested? In your opinion what is the risk, if any, of merging these changes.

#### Reviewers should:

1. Identify anything that the PR author may have missed from above.
2. Test the PR through whatever means necessary, including manually, to verify it is safe to be deployed.
3. Question everything. Never assume that something was tested or fully understood, always question and ask if there is
any uncertainty.
4. Before merging the PR make sure it has _**one**_ of the `Major release`, `Minor release`, or `Patch release` labels
applied to it (useful for the changelog and determining the version for the next release).

## Release Process

We follow [Semantic Versioning 2.0.0](http://semver.org/#semantic-versioning-200), and the fact that PRs are tagged with
the type of release makes determining the next version super simple.

Look through the new (since the last release) PRs that are included in this release to determine the new version.

* If COUNT(labelled `Major release`) > 0, then it's a MAJOR version bump.
* If COUNT(labelled `Minor release`) > 0, then it's a MINOR version bump.
* PATCH version bump

### Now that we've got the version:

* Run `make docker_test` to build the image and generate the examples. There should be no diff after this.
* Update the version in `version.go`
* Update CHANGELOG.md. Be sure to include links to PRs and highlight new features, bug fixes, and any breaking changes.
* Make the commit `git add CHANGELOG.md version.go && git commit -am "Bump version to <NEW_VERSION>"`
* Tag this SHA `git tag -a v<NEW_VERSION> -m "Version <NEW_VERSION>"`
* Finally, push to GitHub `git push && git push --tags`

Now that the tag is on GitHub, we have a couple more things to do:

* Create a release based on the tag and copy the entry in CHANGELOG.md into the notes.
* Run `make dist` and add the tar files (in `./dist`) to the release.

Once CI has run for the tag, Travis will push the image to DockerHub.
Loading

0 comments on commit c44297c

Please sign in to comment.