Skip to content
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

Port to Go for 1.0 Release #305

Merged
merged 50 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d771d45
Clean slate
pseudomuto May 19, 2017
99076c8
Pull glide from github
pseudomuto May 19, 2017
bff7178
Handling proto3 files
pseudomuto Jun 18, 2017
df15f6b
Handle proto2 parsing
pseudomuto Jun 23, 2017
1c08619
Add a simple benchmark test
pseudomuto Jun 23, 2017
da67564
Convert ParserResult to Template for rendering
pseudomuto Jun 23, 2017
bce8836
Add scalars to template
pseudomuto Jun 23, 2017
c95703b
Install protoc in travis
pseudomuto Jun 23, 2017
8d0d1eb
Fetch protoc for ci builds
pseudomuto Jun 25, 2017
5496f3e
Make env vars global in travis.yml
pseudomuto Jun 25, 2017
07f833e
Add /Users/pseudomuto/protoc/bin to path
pseudomuto Jun 25, 2017
6565dac
Add enum parsing for templates
pseudomuto Jul 3, 2017
b43d650
Add support for JSON rendering
pseudomuto Jun 26, 2017
45d28a7
Add docbook, html, and markdown rendering
pseudomuto Jul 4, 2017
dbd2d50
Move test/cmd to build/cmd
pseudomuto Jul 4, 2017
da88054
Add p, para, and nobr functions for templates
pseudomuto Jul 4, 2017
c35f13f
Rename generator.go -> generate.go
pseudomuto Jul 4, 2017
e936553
Enforce sort order for file enums, extensions, messages, and services
pseudomuto Jul 4, 2017
a8e7214
Removing unused dep
pseudomuto Jul 4, 2017
9680073
Create the protoc-gen-doc binary
pseudomuto Jul 21, 2017
5ce44e5
Generate examples with `make examples`
pseudomuto Jul 21, 2017
8313467
Move fixtures into ./test
pseudomuto Jul 21, 2017
9302711
mv ./templates ./resources
pseudomuto Jul 21, 2017
3b9b9e8
Update README
pseudomuto Jul 22, 2017
88a49b4
Fix headings for md output
pseudomuto Jul 22, 2017
726922d
Fix JSON template to be more idiomatic
pseudomuto Jul 22, 2017
4ffd313
Generate scalars from json resource
pseudomuto Jul 22, 2017
eda962b
First stab at top-level godoc
pseudomuto Jul 23, 2017
061a13d
Add make dist for building dists for windows, linux, and osx
pseudomuto Jul 25, 2017
c84f823
Safer handling of paths
pseudomuto Jul 26, 2017
02b964e
Make a docker image for running protoc-gen-doc
pseudomuto Jul 26, 2017
a48d0a4
Add documentation for running the container
pseudomuto Jul 26, 2017
e0e5564
Simplify Dockerfile and make task
pseudomuto Jul 26, 2017
525992c
Have travis build and push docker image for tagged releases
pseudomuto Jul 26, 2017
6d19e7d
Remove version from docker file since it's tagged already
pseudomuto Jul 26, 2017
8bd70c4
Use the right docker image name in README
pseudomuto Jul 26, 2017
0575b24
Grammar is hard sometimes
pseudomuto Jul 27, 2017
b9cc716
Add support for using @exclude to exclude comments from docs
pseudomuto Jul 27, 2017
651c50f
Document @exclude usage
pseudomuto Jul 27, 2017
30fdca6
Backfill CHANGELOG.md and add CONTRIBUTING.md
pseudomuto Jul 27, 2017
91ff11e
Adding make lint and fixing all the lint errors
pseudomuto Jul 27, 2017
a44ce5f
Bump version to 1.0.0-alpha
pseudomuto Jul 27, 2017
5b856b7
Add dependencies task for make
pseudomuto Aug 1, 2017
2f4cb21
Update docker to support single/multi file generation
pseudomuto Aug 1, 2017
288a176
Bump version to 1.0.0-beta
pseudomuto Aug 1, 2017
87afa99
edit markdown.tmpl, improved toc line-breaks
aschrijver Aug 2, 2017
3989b59
Update examples with new code
pseudomuto Aug 9, 2017
4d22a70
Bump version to 1.0.0-rc1
pseudomuto Aug 9, 2017
a309cf1
Update README with instructions for go get
pseudomuto Sep 26, 2017
23825e5
Update NoBB to include space separator
pseudomuto Sep 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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