forked from microsoft/GraphEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·44 lines (37 loc) · 1.2 KB
/
build.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
if [ "$REPO_ROOT" == "" ] ; then REPO_ROOT="$(readlink -f $(dirname $(readlink -f $0))/../)" ; fi
# check for build environment, tools and libraries
if [ "$(command -v cmake)" == "" ] ;
then
echo "error: cmake not found." 1>&2
exit -1
fi
if [ "$(command -v dotnet)" == "" ] ;
then
echo "error: dotnet not found." 1>&2
echo "see: https://www.microsoft.com/net/download/linux"
exit -1
fi
# build
build_repo()
{
mkdir -p "$REPO_ROOT/build" && pushd "$_" || exit -1
cmake "$REPO_ROOT" -DCMAKE_BUILD_TYPE=Release || exit -1
make -j || exit -1
popd
}
# register local nuget repo, remove GraphEngine.Core packages in the cache.
setup_nuget_repo()
{
nuget_repo_name="Graph Engine OSS Local"
nuget_repo_location=$(printf "%q" "$REPO_ROOT/bin")
echo "registering NuGet local repository '$nuget_repo_name'."
if [ "$(grep "$nuget_repo_name" ~/.nuget/NuGet/NuGet.Config)" != "" ];
then
sed -i "/$nuget_repo_name/d" ~/.nuget/NuGet/NuGet.Config
fi
sed -i "s#</packageSources># <add key=\"$nuget_repo_name\" value=\"$nuget_repo_location\" \/>\n <\/packageSources>#g" ~/.nuget/NuGet/NuGet.Config
echo "remove local package cache."
rm -rf ~/.nuget/packages/graphengine.*
}
build_repo