Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
3f58c3d3
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3f58c3d3
编写于
11月 15, 2017
作者:
K
khyperia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create build.sh
上级
67f2e66a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
131 addition
and
81 deletion
+131
-81
build.sh
build.sh
+121
-0
build/scripts/restore.sh
build/scripts/restore.sh
+3
-13
cibuild.sh
cibuild.sh
+7
-68
未找到文件。
build.sh
0 → 100755
浏览文件 @
3f58c3d3
#!/usr/bin/env bash
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
set
-e
set
-u
usage
()
{
echo
"Main interface to running builds on Mac/Linux"
echo
"Usage: build.sh [options]"
echo
""
echo
"Options"
echo
" --debug Build Debug (default)"
echo
" --release Build Release"
echo
" --restore Restore projects required to build"
echo
" --build Build all projects"
echo
" --test Run unit tests"
echo
" --build-bootstrap Build the bootstrap compilers"
echo
" --use-bootstrap Use the built bootstrap compilers when running main build"
echo
" --bootstrap Implies --build-bootstrap and --use-bootstrap"
}
this_dir
=
"
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
source
"
${
this_dir
}
"
/build/scripts/build-utils.sh
root_path
=
"
$(
get_repo_dir
)
"
binaries_path
=
"
${
root_path
}
"
/Binaries
bootstrap_path
=
"
${
binaries_path
}
"
/Bootstrap
bootstrap_framework
=
netcoreapp2.0
build_configuration
=
Debug
restore
=
false
build
=
false
test_
=
false
build_bootstrap
=
false
use_bootstrap
=
false
# LTTNG is the logging infrastructure used by coreclr. Need this variable set
# so it doesn't output warnings to the console.
export
LTTNG_HOME
=
"
$HOME
"
while
[[
$#
>
0
]]
do
opt
=
"
$(
echo
"
$1
"
|
awk
'{print tolower($0)}'
)
"
case
"
$opt
"
in
-h
|
--help
)
usage
exit
1
;;
--debug
)
build_configuration
=
Debug
shift
1
;;
--release
)
build_configuration
=
Release
shift
1
;;
--restore
)
restore
=
true
shift
1
;;
--build
)
build
=
true
shift
1
;;
--test
)
test_
=
true
shift
1
;;
--build-bootstrap
)
build_bootstrap
=
true
shift
1
;;
--use-bootstrap
)
use_bootstrap
=
true
shift
1
;;
--bootstrap
)
build_bootstrap
=
true
use_bootstrap
=
true
shift
1
;;
*
)
usage
exit
1
;;
esac
done
if
[[
"
$restore
"
==
true
]]
then
"
${
root_path
}
"
/build/scripts/restore.sh
fi
build_args
=
"--no-restore -c
${
build_configuration
}
/nologo /maxcpucount:1"
if
[[
"
$build_bootstrap
"
==
true
]]
then
echo
"Building bootstrap toolset"
bootstrap_build_args
=
"
${
build_args
}
/p:UseShippingAssemblyVersion=true /p:InitialDefineConstants=BOOTSTRAP"
dotnet publish
"
${
root_path
}
"
/src/Compilers/CSharp/csc
-o
"
${
bootstrap_path
}
/bincore"
--framework
${
bootstrap_framework
}
${
bootstrap_build_args
}
"/bl:
${
binaries_path
}
/BootstrapCsc.binlog"
dotnet publish
"
${
root_path
}
"
/src/Compilers/VisualBasic/vbc
-o
"
${
bootstrap_path
}
/bincore"
--framework
${
bootstrap_framework
}
${
bootstrap_build_args
}
"/bl:
${
binaries_path
}
/BootstrapVbc.binlog"
dotnet publish
"
${
root_path
}
"
/src/Compilers/Server/VBCSCompiler
-o
"
${
bootstrap_path
}
/bincore"
--framework
${
bootstrap_framework
}
${
bootstrap_build_args
}
"/bl:
${
binaries_path
}
/BootstrapVBCSCompiler.binlog"
dotnet publish
"
${
root_path
}
"
/src/Compilers/Core/MSBuildTask
-o
"
${
bootstrap_path
}
"
${
bootstrap_build_args
}
"/bl:
${
binaries_path
}
/BoostrapMSBuildTask.binlog"
fi
if
[[
"
${
use_bootstrap
}
"
==
true
]]
then
build_args+
=
" /p:BootstrapBuildPath=
${
bootstrap_path
}
"
fi
if
[[
"
${
build
}
"
==
true
]]
then
echo
"Building Compilers.sln"
dotnet build
"
${
root_path
}
"
/Compilers.sln
${
build_args
}
"/bl:
${
binaries_path
}
/Build.binlog"
fi
if
[[
"
${
test_
}
"
==
true
]]
then
"
${
root_path
}
"
/build/scripts/tests.sh
fi
build/scripts/restore.sh
浏览文件 @
3f58c3d3
...
...
@@ -2,22 +2,12 @@
THIS_DIR
=
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
# Workaround, see https://github.com/dotnet/roslyn/issues/10210
# $HOME is unset when running the mac unit tests.
if
[[
-z
${
HOME
+x
}
]]
then
# Note that while ~ usually refers to $HOME, in the case where $HOME is unset,
# it looks up the current user's home dir, which is what we want.
# https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html
export
HOME
=
$(
cd
~
&&
pwd
)
fi
echo
"Restoring toolset packages"
RESTORE_ARGS
=
"-v Minimal --disable-parallel"
echo
"Restoring BaseToolset.csproj"
dotnet restore
${
RESTORE_ARGS
}
${
THIS_DIR
}
/../ToolsetPackages/BaseToolset.csproj
dotnet restore
${
RESTORE_ARGS
}
"
${
THIS_DIR
}
/../ToolsetPackages/BaseToolset.csproj"
echo
"Restoring CoreToolset.csproj"
dotnet restore
${
RESTORE_ARGS
}
${
THIS_DIR
}
/../ToolsetPackages/CoreToolset.csproj
dotnet restore
${
RESTORE_ARGS
}
"
${
THIS_DIR
}
/../ToolsetPackages/CoreToolset.csproj"
echo
"Restoring Compilers.sln"
dotnet restore
${
RESTORE_ARGS
}
${
THIS_DIR
}
/../../Compilers.sln
dotnet restore
${
RESTORE_ARGS
}
"
${
THIS_DIR
}
/../../Compilers.sln"
cibuild.sh
浏览文件 @
3f58c3d3
...
...
@@ -13,24 +13,13 @@ usage()
echo
"Options"
echo
" --debug Build Debug (default)"
echo
" --release Build Release"
echo
" --cleanrun Clean the project before building"
echo
" --skiptest Do not run tests"
echo
" --skipcommitprinting Do not print commit information"
}
THIS_DIR
=
"
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
source
"
${
THIS_DIR
}
"
/build/scripts/build-utils.sh
ROOT_PATH
=
"
$(
get_repo_dir
)
"
BINARIES_PATH
=
"
${
ROOT_PATH
}
"
/Binaries
BOOTSTRAP_PATH
=
"
${
BINARIES_PATH
}
"
/Bootstrap
SRC_PATH
=
"
${
ROOT_PATH
}
"
/src
TARGET_FRAMEWORK
=
netcoreapp2.0
BUILD_CONFIGURATION
=
Debug
CLEAN_RUN
=
false
SKIP_RESTORE
=
false
SKIP_TESTS
=
false
SKIP_COMMIT_PRINTING
=
false
BUILD_CONFIGURATION
=
--debug
# $HOME is unset when running the mac unit tests.
if
[[
-z
"
${
HOME
+x
}
"
]]
...
...
@@ -41,10 +30,6 @@ then
export
HOME
=
"
$(
cd
~
&&
pwd
)
"
fi
# LTTNG is the logging infrastructure used by coreclr. Need this variable set
# so it doesn't output warnings to the console.
export
LTTNG_HOME
=
"
$HOME
"
# There's no reason to send telemetry or prime a local package cach when building
# in CI.
export
DOTNET_CLI_TELEMETRY_OPTOUT
=
1
...
...
@@ -59,27 +44,11 @@ do
exit
1
;;
--debug
)
BUILD_CONFIGURATION
=
D
ebug
BUILD_CONFIGURATION
=
--d
ebug
shift
1
;;
--release
)
BUILD_CONFIGURATION
=
Release
shift
1
;;
--cleanrun
)
CLEAN_RUN
=
true
shift
1
;;
--skiprestore
)
SKIP_RESTORE
=
true
shift
1
;;
--skiptests
)
SKIP_TESTS
=
true
shift
1
;;
--skipcommitprinting
)
SKIP_COMMIT_PRINTING
=
true
BUILD_CONFIGURATION
=
--release
shift
1
;;
*
)
...
...
@@ -89,44 +58,14 @@ do
esac
done
if
[
"
$CLEAN_RUN
"
==
"true"
]
;
then
echo
Clean out the enlistment
git clean
-dxf
.
fi
if
[
"
$SKIP_COMMIT_PRINTING
"
==
"false"
]
;
then
echo
Building this commit:
git show
--no-patch
--pretty
=
raw HEAD
fi
echo
Building this commit:
git show
--no-patch
--pretty
=
raw HEAD
# obtain_dotnet.sh puts the right dotnet on the PATH
FORCE_DOWNLOAD
=
true
source
"
${
ROOT_PATH
}
"
/build/scripts/obtain_dotnet.sh
if
[[
"
${
SKIP_RESTORE
}
"
==
false
]]
then
"
${
ROOT_PATH
}
"
/build/scripts/restore.sh
fi
BUILD_ARGS
=
"--no-restore -c
${
BUILD_CONFIGURATION
}
/nologo /maxcpucount:1"
BOOTSTRAP_BUILD_ARGS
=
"
${
BUILD_ARGS
}
/p:UseShippingAssemblyVersion=true /p:InitialDefineConstants=BOOTSTRAP"
echo
"Building bootstrap toolset"
dotnet publish
"
${
ROOT_PATH
}
"
/src/Compilers/CSharp/csc
-o
"
${
BOOTSTRAP_PATH
}
/bincore"
--framework
${
TARGET_FRAMEWORK
}
${
BOOTSTRAP_BUILD_ARGS
}
"/bl:
${
BINARIES_PATH
}
/BootstrapCsc.binlog"
dotnet publish
"
${
ROOT_PATH
}
"
/src/Compilers/VisualBasic/vbc
-o
"
${
BOOTSTRAP_PATH
}
/bincore"
--framework
${
TARGET_FRAMEWORK
}
${
BOOTSTRAP_BUILD_ARGS
}
"/bl:
${
BINARIES_PATH
}
/BootstrapVbc.binlog"
dotnet publish
"
${
ROOT_PATH
}
"
/src/Compilers/Server/VBCSCompiler
-o
"
${
BOOTSTRAP_PATH
}
/bincore"
--framework
${
TARGET_FRAMEWORK
}
${
BOOTSTRAP_BUILD_ARGS
}
"/bl:
${
BINARIES_PATH
}
/BootstrapVBCSCompiler.binlog"
dotnet publish
"
${
ROOT_PATH
}
"
/src/Compilers/Core/MSBuildTask
-o
"
${
BOOTSTRAP_PATH
}
"
${
BOOTSTRAP_BUILD_ARGS
}
"/bl:
${
BINARIES_PATH
}
/BoostrapMSBuildTask.binlog"
BUILD_ARGS+
=
" /bl:
${
BINARIES_PATH
}
/Build.binlog /p:BootstrapBuildPath=
${
BOOTSTRAP_PATH
}
"
echo
"Building Compilers.sln"
dotnet build
"
${
ROOT_PATH
}
"
/Compilers.sln
${
BUILD_ARGS
}
if
[[
"
${
SKIP_TESTS
}
"
==
false
]]
then
echo
"Running tests"
"
${
ROOT_PATH
}
"
/build/scripts/tests.sh
"
${
BUILD_CONFIGURATION
}
"
fi
"
${
ROOT_PATH
}
"
/build.sh
--restore
--bootstrap
--build
--test
"
${
BUILD_CONFIGURATION
}
"
echo
"Killing VBCSCompiler"
dotnet
"
${
BOOTSTRAP_PATH
}
"
/bincore/VBCSCompiler.dll
-shutdown
dotnet
"
${
ROOT_PATH
}
"
/Binaries/Bootstrap
/bincore/VBCSCompiler.dll
-shutdown
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录