Skip to content

Commit

Permalink
Merge pull request #167 from nickgra/gitprbuild
Browse files Browse the repository at this point in the history
Fix parsing of GVFS-aware Git version numbers that contain - (for PR validation builds)

Correct regex used to match GVFS-aware Git package to actually match the NuGet spec for what defines a package. See https://docs.microsoft.com/en-us/nuget/reference/package-versioning
  • Loading branch information
nickgra authored Aug 16, 2018
2 parents c838635 + fff61e5 commit ecab6ac
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Scripts/Mac/BuildGVFSForMac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ if [ ! -d $BUILDDIR ]; then
fi

$SCRIPTDIR/DownloadGVFSGit.sh || exit 1
GVFSPROPS=$SRCDIR/GVFS/GVFS.Build/GVFS.props
GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]{1,}')"
GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)"
GITPATH="$(find $PACKAGES/gitformac.gvfs.installer/$GITVERSION -type f -name *.dmg)" || exit 1
# Now that we have a path containing the version number, generate GVFSConstants.GitVersion.cs
$SCRIPTDIR/GenerateGitVersionConstants.sh "$GITPATH" $BUILDDIR || exit 1
Expand Down
3 changes: 1 addition & 2 deletions Scripts/Mac/DownloadGVFSGit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})"
SRCDIR=$SCRIPTDIR/../..
BUILDDIR=$SRCDIR/../BuildOutput/GVFS.Build
PACKAGESDIR=$SRCDIR/../packages
GVFSPROPS=$SRCDIR/GVFS/GVFS.Build/GVFS.props
GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]{1,}')"
GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)"
cp $SRCDIR/nuget.config $BUILDDIR
dotnet new classlib -n GVFS.Restore -o $BUILDDIR --force
dotnet add $BUILDDIR/GVFS.Restore.csproj package --package-directory $PACKAGESDIR GitForMac.GVFS.Installer --version $GITVERSION
4 changes: 4 additions & 0 deletions Scripts/Mac/GetGitVersionNumber.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})"
GVFSPROPS=$SCRIPTDIR/../../GVFS/GVFS.Build/GVFS.props
GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')"
echo $GITVERSION
3 changes: 1 addition & 2 deletions Scripts/Mac/PrepFunctionalTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})

# Install GVFS-aware Git (that was downloaded by the build script)
GVFSPROPS=$SCRIPTDIR/../../GVFS/GVFS.Build/GVFS.props
GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]{1,}')"
GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)"
ROOTDIR=$SCRIPTDIR/../../..
GITDIR=$ROOTDIR/packages/gitformac.gvfs.installer/$GITVERSION/tools
if [[ ! -d $GITDIR ]]; then
Expand Down

0 comments on commit ecab6ac

Please sign in to comment.