github.com/jonsyu1/godel@v0.0.0-20171017211503-64567a0cf169/docs/Other-commands.md (about)

     1  Summary
     2  -------
     3  Commands such as `./godelw project-version`, `./godelw packages` and `./godelw artifacts` can be used as inputs to other
     4  commands.
     5  
     6  Tutorial start state
     7  --------------------
     8  
     9  * `$GOPATH/src/github.com/nmiyake/echgo` exists and is the working directory
    10  * Project contains `godel` and `godelw`
    11  * Project contains `main.go`
    12  * Project contains `.gitignore` that ignores IDEA files
    13  * Project contains `echo/echo.go`, `echo/echo_test.go` and `echo/echoer.go`
    14  * `godel/config/dist.yml` is configured to build `echgo`
    15  * Project is tagged as 0.0.1
    16  * `godel/config/dist.yml` is configured to create distributions for `echgo`
    17  * Project is tagged as 0.0.2
    18  * Go files have license headers
    19  * `godel/config/generate.yml` is configured to generate string function
    20  * `godel/config/exclude.yml` is configured to ignore all `.+_string.go` files
    21  * `integration_test` contains integration tests
    22  * `godel/config/test.yml` is configured to specify the "integration" tag
    23  * `docs` contains documentation
    24  * `.circleci/config.yml` exists
    25  * Project is tagged as 1.0.0
    26  * `godelw` is updated to 0.27.0
    27  
    28  ([Link](https://github.com/nmiyake/echgo/tree/3825f36b06ee50703ad10e01068ceb13e7719acd))
    29  
    30  Other commands
    31  --------------
    32  
    33  The declarative configuration provided by gödel can be used as inputs to other programs or scripts for convenience. For
    34  example, you may want to run a `go install` on all of the project packages so that the object files are available in
    35  `$GOPATH/pkg` and any `main` packages are installed. `go install ./...` will often not work on products that vendor
    36  their dependencies.
    37  
    38  The `./godelw packages` command can be used to print all of the packages in a project based on the project
    39  configuration:
    40  
    41  ```
    42  ➜ ./godelw packages
    43  ./.
    44  ./echo
    45  ./generator
    46  ./integration_test
    47  ```
    48  
    49  This command excludes any packages that would be excluded based on the `exclude` configuration. This command can be
    50  combined with `go install` (or any program that takes a list of packages as inputs):
    51  
    52  ```
    53  ➜ go install $(./godelw packages)
    54  ```
    55  
    56  `./godelw project-version` can be used to print the version of the project as determined by gödel (this is also the
    57  string used as the version for the `dist` and `publish` tasks):
    58  
    59  ```
    60  ➜ ./godelw project-version
    61  1.0.0-1-g3825f36
    62  ```
    63  
    64  `./godelw artifacts` can be invoked with `build` or `dist` (and optionally a list of products) to output the location in
    65  which the build and distribution artifacts will be generated:
    66  
    67  ```
    68  ➜ ./godelw artifacts build echgo
    69  build/1.0.0-1-g3825f36/darwin-amd64/echgo
    70  build/1.0.0-1-g3825f36/linux-amd64/echgo
    71  ➜ ./godelw artifacts dist
    72  dist/echgo-1.0.0-1-g3825f36-darwin-amd64.tgz
    73  dist/echgo-1.0.0-1-g3825f36-linux-amd64.tgz
    74  ```
    75  
    76  These commands can be useful to use as inputs to other programs or as part of scripts/CI tasks for a project.
    77  
    78  Tutorial end state
    79  ------------------
    80  
    81  * `$GOPATH/src/github.com/nmiyake/echgo` exists and is the working directory
    82  * Project contains `godel` and `godelw`
    83  * Project contains `main.go`
    84  * Project contains `.gitignore` that ignores IDEA files
    85  * Project contains `echo/echo.go`, `echo/echo_test.go` and `echo/echoer.go`
    86  * `godel/config/dist.yml` is configured to build `echgo`
    87  * Project is tagged as 0.0.1
    88  * `godel/config/dist.yml` is configured to create distributions for `echgo`
    89  * Project is tagged as 0.0.2
    90  * Go files have license headers
    91  * `godel/config/generate.yml` is configured to generate string function
    92  * `godel/config/exclude.yml` is configured to ignore all `.+_string.go` files
    93  * `integration_test` contains integration tests
    94  * `godel/config/test.yml` is configured to specify the "integration" tag
    95  * `docs` contains documentation
    96  * `.circleci/config.yml` exists
    97  * Project is tagged as 1.0.0
    98  * `godelw` is updated to 0.27.0
    99  
   100  ([Link](https://github.com/nmiyake/echgo/tree/3825f36b06ee50703ad10e01068ceb13e7719acd))
   101  
   102  Tutorial next step
   103  ------------------
   104  [Conclusion](https://github.com/palantir/godel/wiki/Tutorial-conclusion)