From 7e911ed5e8da09956cc5fb64bb9f3592c8a41a33 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 24 Jan 2019 03:38:01 -0800 Subject: [PATCH] Move bump to project folder 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 --- scripts/bump.sh | 2 +- scripts/bump/.gitignore | 3 +++ scripts/bump/README.md | 43 ++++++++++++++++++++++++++++++++++++++ scripts/{ => bump}/bump.hs | 2 +- scripts/bump/package.yaml | 14 +++++++++++++ scripts/bump/stack.yaml | 3 +++ 6 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 scripts/bump/.gitignore create mode 100644 scripts/bump/README.md rename scripts/{ => bump}/bump.hs (98%) create mode 100644 scripts/bump/package.yaml create mode 100644 scripts/bump/stack.yaml diff --git a/scripts/bump.sh b/scripts/bump.sh index ef059ecca..1c4ecdc31 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -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 diff --git a/scripts/bump/.gitignore b/scripts/bump/.gitignore new file mode 100644 index 000000000..01bafa9a7 --- /dev/null +++ b/scripts/bump/.gitignore @@ -0,0 +1,3 @@ +.stack-work +Setup.hs +*.cabal diff --git a/scripts/bump/README.md b/scripts/bump/README.md new file mode 100644 index 000000000..ea5abf0d8 --- /dev/null +++ b/scripts/bump/README.md @@ -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 +``` diff --git a/scripts/bump.hs b/scripts/bump/bump.hs similarity index 98% rename from scripts/bump.hs rename to scripts/bump/bump.hs index 2829d317a..60c4f3f80 100755 --- a/scripts/bump.hs +++ b/scripts/bump/bump.hs @@ -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 #-} diff --git a/scripts/bump/package.yaml b/scripts/bump/package.yaml new file mode 100644 index 000000000..2090e05f8 --- /dev/null +++ b/scripts/bump/package.yaml @@ -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 diff --git a/scripts/bump/stack.yaml b/scripts/bump/stack.yaml new file mode 100644 index 000000000..30d862497 --- /dev/null +++ b/scripts/bump/stack.yaml @@ -0,0 +1,3 @@ +packages: +- . +resolver: lts-13.4