-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Centralize spcial Mac paths in InitializeEnviroment.sh
- Loading branch information
Showing
11 changed files
with
68 additions
and
78 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,48 @@ | ||
#!/bin/bash | ||
|
||
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh" | ||
|
||
CONFIGURATION=$1 | ||
if [ -z $CONFIGURATION ]; then | ||
CONFIGURATION=Debug | ||
fi | ||
|
||
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})" | ||
|
||
# convert to an absolute path because it is required by `dotnet publish` | ||
pushd $SCRIPTDIR | ||
SCRIPTDIR="$(pwd)" | ||
popd | ||
|
||
SRCDIR=$SCRIPTDIR/../.. | ||
ROOTDIR=$SRCDIR/.. | ||
BUILDOUTPUT=$ROOTDIR/BuildOutput | ||
PUBLISHDIR=$ROOTDIR/Publish | ||
|
||
if [ ! -d $BUILDOUTPUT ]; then | ||
mkdir $BUILDOUTPUT | ||
if [ ! -d $VFS_OUTPUTDIR ]; then | ||
mkdir $VFS_OUTPUTDIR | ||
fi | ||
|
||
PACKAGES=$ROOTDIR/packages | ||
|
||
# Build the ProjFS kext and libraries | ||
$SRCDIR/ProjFS.Mac/Scripts/Build.sh $CONFIGURATION || exit 1 | ||
echo 'Building ProjFS kext and libraries...' | ||
$VFS_SRCDIR/ProjFS.Mac/Scripts/Build.sh $CONFIGURATION || exit 1 | ||
|
||
# Create the directory where we'll do pre build tasks | ||
BUILDDIR=$BUILDOUTPUT/GVFS.Build | ||
BUILDDIR=$VFS_OUTPUTDIR/GVFS.Build | ||
if [ ! -d $BUILDDIR ]; then | ||
mkdir $BUILDDIR || exit 1 | ||
fi | ||
|
||
$SCRIPTDIR/DownloadGVFSGit.sh || exit 1 | ||
GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)" | ||
GITPATH="$(find $PACKAGES/gitformac.gvfs.installer/$GITVERSION -type f -name *.dmg)" || exit 1 | ||
echo 'Downloading a VFS-enabled version of Git...' | ||
$VFS_SCRIPTDIR/DownloadGVFSGit.sh || exit 1 | ||
GITVERSION="$($VFS_SCRIPTDIR/GetGitVersionNumber.sh)" | ||
GITPATH="$(find $VFS_PACKAGESDIR/gitformac.gvfs.installer/$GITVERSION -type f -name *.dmg)" || exit 1 | ||
echo "Downloaded Git $GITVERSION" | ||
# Now that we have a path containing the version number, generate GVFSConstants.GitVersion.cs | ||
$SCRIPTDIR/GenerateGitVersionConstants.sh "$GITPATH" $BUILDDIR || exit 1 | ||
$VFS_SCRIPTDIR/GenerateGitVersionConstants.sh "$GITPATH" $BUILDDIR || exit 1 | ||
|
||
# If we're building the Profiling(Release) configuration, remove Profiling() for building .NET code | ||
if [ "$CONFIGURATION" == "Profiling(Release)" ]; then | ||
CONFIGURATION=Release | ||
fi | ||
|
||
dotnet restore $SRCDIR/GVFS.sln /p:Configuration=$CONFIGURATION.Mac --packages $PACKAGES || exit 1 | ||
dotnet build $SRCDIR/GVFS.sln --runtime osx-x64 --framework netcoreapp2.1 --configuration $CONFIGURATION.Mac /maxcpucount:1 || exit 1 | ||
dotnet publish $SRCDIR/GVFS.sln /p:Configuration=$CONFIGURATION.Mac /p:Platform=x64 --runtime osx-x64 --framework netcoreapp2.1 --self-contained --output $PUBLISHDIR /maxcpucount:1 || exit 1 | ||
echo 'Restoring packages...' | ||
dotnet restore $VFS_SRCDIR/GVFS.sln /p:Configuration=$CONFIGURATION.Mac --packages $VFS_PACKAGESDIR || exit 1 | ||
dotnet build $VFS_SRCDIR/GVFS.sln --runtime osx-x64 --framework netcoreapp2.1 --configuration $CONFIGURATION.Mac /maxcpucount:1 || exit 1 | ||
dotnet publish $VFS_SRCDIR/GVFS.sln /p:Configuration=$CONFIGURATION.Mac /p:Platform=x64 --runtime osx-x64 --framework netcoreapp2.1 --self-contained --output $VFS_PUBLISHDIR /maxcpucount:1 || exit 1 | ||
|
||
NATIVEDIR=$SRCDIR/GVFS/GVFS.Native.Mac | ||
xcodebuild -configuration $CONFIGURATION -workspace $NATIVEDIR/GVFS.Native.Mac.xcworkspace build -scheme GVFS.Native.Mac -derivedDataPath $ROOTDIR/BuildOutput/GVFS.Native.Mac || exit 1 | ||
NATIVEDIR=$VFS_SRCDIR/GVFS/GVFS.Native.Mac | ||
xcodebuild -configuration $CONFIGURATION -workspace $NATIVEDIR/GVFS.Native.Mac.xcworkspace build -scheme GVFS.Native.Mac -derivedDataPath $VFS_OUTPUTDIR/GVFS.Native.Mac || exit 1 | ||
|
||
echo 'Copying native binaries to Publish directory' | ||
cp $BUILDOUTPUT/GVFS.Native.Mac/Build/Products/$CONFIGURATION/GVFS.ReadObjectHook $PUBLISHDIR || exit 1 | ||
cp $BUILDOUTPUT/GVFS.Native.Mac/Build/Products/$CONFIGURATION/GVFS.VirtualFileSystemHook $PUBLISHDIR || exit 1 | ||
echo 'Copying native binaries to Publish directory...' | ||
cp $VFS_OUTPUTDIR/GVFS.Native.Mac/Build/Products/$CONFIGURATION/GVFS.ReadObjectHook $VFS_PUBLISHDIR || exit 1 | ||
cp $VFS_OUTPUTDIR/GVFS.Native.Mac/Build/Products/$CONFIGURATION/GVFS.VirtualFileSystemHook $VFS_PUBLISHDIR || exit 1 | ||
|
||
$PUBLISHDIR/GVFS.UnitTests || exit 1 | ||
$VFS_PUBLISHDIR/GVFS.UnitTests || exit 1 |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})" | ||
SRCDIR=$SCRIPTDIR/../.. | ||
BUILDDIR=$SRCDIR/../BuildOutput/GVFS.Build | ||
PACKAGESDIR=$SRCDIR/../packages | ||
GITVERSION="$($SCRIPTDIR/GetGitVersionNumber.sh)" | ||
cp $SRCDIR/nuget.config $BUILDDIR | ||
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh" | ||
|
||
BUILDDIR=$VFS_OUTPUTDIR/GVFS.Build | ||
GITVERSION="$($VFS_SCRIPTDIR/GetGitVersionNumber.sh)" | ||
cp $VFS_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 | ||
dotnet add $BUILDDIR/GVFS.Restore.csproj package --package-directory $VFS_PACKAGESDIR GitForMac.GVFS.Installer --version $GITVERSION |
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#!/bin/bash | ||
|
||
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh" | ||
|
||
CONFIGURATION=$1 | ||
if [ -z $CONFIGURATION ]; then | ||
CONFIGURATION=Debug | ||
fi | ||
|
||
SCRIPTDIR=$(dirname ${BASH_SOURCE[0]}) | ||
|
||
ROOTDIR=$SCRIPTDIR/../../.. | ||
PUBLISHDIR=$ROOTDIR/Publish | ||
|
||
$PUBLISHDIR/gvfs mount ~/GVFSTest | ||
$VFS_PUBLISHDIR/gvfs mount ~/GVFSTest |
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#!/bin/bash | ||
|
||
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh" | ||
|
||
CONFIGURATION=$1 | ||
if [ -z $CONFIGURATION ]; then | ||
CONFIGURATION=Debug | ||
fi | ||
|
||
SCRIPTDIR=$(dirname ${BASH_SOURCE[0]}) | ||
|
||
ROOTDIR=$SCRIPTDIR/../../.. | ||
PUBLISHDIR=$ROOTDIR/Publish | ||
|
||
$PUBLISHDIR/gvfs unmount ~/GVFSTest | ||
$VFS_PUBLISHDIR/gvfs unmount ~/GVFSTest |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})" | ||
GVFSPROPS=$SCRIPTDIR/../../GVFS/GVFS.Build/GVFS.props | ||
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh" | ||
|
||
GVFSPROPS=$VFS_SRCDIR/GVFS/GVFS.Build/GVFS.props | ||
GITVERSION="$(cat $GVFSPROPS | grep GitPackageVersion | grep -Eo '[0-9.]+(-\w+)?')" | ||
echo $GITVERSION |
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,12 @@ | ||
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})" | ||
|
||
# convert to an absolute path because it is required by `dotnet publish` | ||
pushd $SCRIPTDIR &>/dev/null | ||
export VFS_SCRIPTDIR="$(pwd)" | ||
popd &>/dev/null | ||
|
||
export VFS_SRCDIR=$VFS_SCRIPTDIR/../.. | ||
export VFS_ENLISTMENTDIR=$VFS_SRCDIR/.. | ||
export VFS_OUTPUTDIR=$VFS_ENLISTMENTDIR/BuildOutput | ||
export VFS_PUBLISHDIR=$VFS_ENLISTMENTDIR/Publish | ||
export VFS_PACKAGESDIR=$VFS_ENLISTMENTDIR/packages |
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#!/bin/bash | ||
|
||
SCRIPTDIR=$(dirname ${BASH_SOURCE[0]}) | ||
. "$(dirname ${BASH_SOURCE[0]})/InitializeEnvironment.sh" | ||
|
||
SRCDIR=$SCRIPTDIR/../.. | ||
ROOTDIR=$SRCDIR/.. | ||
sudo rm -Rf $VFS_ENLISTMENTDIR/BuildOutput | ||
rm -Rf $VFS_ENLISTMENTDIR/packages | ||
rm -Rf $VFS_ENLISTMENTDIR/Publish | ||
|
||
sudo rm -Rf $ROOTDIR/BuildOutput | ||
rm -Rf $ROOTDIR/packages | ||
rm -Rf $ROOTDIR/Publish | ||
|
||
echo git --work-tree=$SRCDIR clean -Xdf -n | ||
git --work-tree=$SRCDIR clean -Xdf -n | ||
echo git --work-tree=$VFS_SRCDIR clean -Xdf -n | ||
git --work-tree=$VFS_SRCDIR clean -Xdf -n |
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