-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rake set-version-to-timestamp task
This ensures the generated gem has a unique version number, so define `RE2::VERSION` in a separate file to make this possible.
- Loading branch information
Showing
6 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
end | ||
|
||
require "re2/scanner" | ||
require "re2/version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module RE2 | ||
VERSION = "1.7.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#! /usr/bin/env bash | ||
# | ||
# run as part of CI | ||
# | ||
if [[ $# -lt 2 ]] ; then | ||
echo "usage: $(basename $0) <output_dir> <platform>" | ||
exit 1 | ||
fi | ||
|
||
set -e -u | ||
|
||
OUTPUT_DIR=$1 | ||
BUILD_NATIVE_GEM=$2 | ||
|
||
test -e /etc/os-release && cat /etc/os-release | ||
|
||
set -x | ||
|
||
bundle install --local || bundle install | ||
bundle exec rake set-version-to-timestamp | ||
|
||
if [[ "${BUILD_NATIVE_GEM}" == "ruby" ]] ; then | ||
# TODO we're only compiling so that we retrieve tarballs, we can do better. | ||
bundle exec rake clean compile | ||
bundle exec rake gem | ||
else | ||
bundle exec rake gem:${BUILD_NATIVE_GEM}:builder | ||
fi | ||
|
||
mkdir -p ${OUTPUT_DIR} | ||
cp -v pkg/*.gem ${OUTPUT_DIR} | ||
ls -l ${OUTPUT_DIR}/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /usr/bin/env bash | ||
# | ||
# run as part of CI | ||
# | ||
if [[ $# -lt 1 ]] ; then | ||
echo "usage: $(basename $0) <gems_dir> [install_flags]" | ||
exit 1 | ||
fi | ||
|
||
GEMS_DIR=$1 | ||
shift | ||
INSTALL_FLAGS=$* | ||
|
||
test -e /etc/os-release && cat /etc/os-release | ||
|
||
set -e -x -u | ||
|
||
pushd $GEMS_DIR | ||
|
||
gemfile=$(ls *.gem | head -n1) | ||
ls -l ${gemfile} | ||
gem install --no-document ${gemfile} -- ${INSTALL_FLAGS} | ||
gem list -d re2 | ||
popd | ||
|
||
if [ -n "${BUNDLE_APP_CONFIG:-}" ] ; then | ||
export BUNDLE_CACHE_PATH="${BUNDLE_APP_CONFIG}/cache" | ||
fi | ||
|
||
bundle install --local || bundle install | ||
|
||
rm -rf lib ext # ensure we don't use the local files | ||
rake spec |