Skip to content

Commit

Permalink
Move bump to project folder
Browse files Browse the repository at this point in the history
Summary: Makes building a bit easier and I can have my own README in there.

Reviewed By: jknoxville

Differential Revision: D13784725

fbshipit-source-id: b694c1ce812d4e383ad44faeacd8e0094a96b432
  • Loading branch information
passy authored and facebook-github-bot committed Jan 24, 2019
1 parent a70f47c commit 7e911ed
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ cd "$BASEDIR" || exit
case $OSTYPE in
darwin*) ./bump.mac "$@" ;;
linux-gnu) ./bump.lnx64 "$@" ;;
*) echo "Unknown OS. Using source version via https://haskellstack.org/" && ./bump.hs "$@" ;;
*) echo "Unknown OS. Using source version via https://haskellstack.org/" && ./bump/bump.hs "$@" ;;
esac
3 changes: 3 additions & 0 deletions scripts/bump/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.stack-work
Setup.hs
*.cabal
43 changes: 43 additions & 0 deletions scripts/bump/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# bump

A small script for changing version numbers automatically.

## Usage

Requires [stack](http://haskellstack.org/) to be installed.

```
./bump.hs --help
```

Alternatively, use the pre-checked-in binaries from the superfolder
through `bump.sh`.

To bump a release version, just pass the new version number.

```
bump 1.2.3
```

To bump to a snapshot release, run with `--snapshot`:

```
bump --snapshot 1.2.4-SNAPSHOT
```

## Building

To build the native binaries, run

```
stack build
```

The binary is then placed in `.stack-work/install/x86_64-osx/**/bin/bump`.

To cross-compile for Linux (required for internal CI), run

```
stack docker pull
stack build --docker
```
2 changes: 1 addition & 1 deletion scripts/bump.hs → scripts/bump/bump.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env stack
-- stack --resolver lts-13.4 --install-ghc runghc --package turtle --package system-filepath --package pseudomacros --package foldl
-- stack --resolver lts-13.4 --install-ghc runghc --package turtle --package system-filepath --package foldl

{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE OverloadedStrings #-}
Expand Down
14 changes: 14 additions & 0 deletions scripts/bump/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: bump
version: 0.1.0.0

dependencies:
- base >= 4.7 && < 5
- turtle
- system-filepath
- foldl
- text

executables:
bump:
source-dirs: .
main: bump.hs
3 changes: 3 additions & 0 deletions scripts/bump/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages:
- .
resolver: lts-13.4

0 comments on commit 7e911ed

Please sign in to comment.