Skip to content

Commit

Permalink
Include MSBuildTask in bootstrap build.
Browse files Browse the repository at this point in the history
Also restructure Makefile to only be invoked once when
bootstrapping/building/testing.
  • Loading branch information
khyperia committed Jul 25, 2017
1 parent 898462a commit 649d4e3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
41 changes: 28 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,46 @@ endif
MSBUILD_ARGS := /nologo '/consoleloggerparameters:Verbosity=minimal;summary' /p:Configuration=$(BUILD_CONFIGURATION)

ifneq ($(BUILD_LOG_PATH),)
MSBUILD_ARGS += /filelogger '/fileloggerparameters:Verbosity=normal;logFile=$(BUILD_LOG_PATH)'
MSBUILD_ARGS += /filelogger '/fileloggerparameters:Verbosity=normal;logFile=$(BUILD_LOG_PATH)'
endif

MSBUILD_MAIN_ARGS := $(MSBUILD_ARGS)
MSBUILD_BOOTSTRAP_ARGS := $(MSBUILD_ARGS)

# arguments to dotnet build go in front, msbuild in back
MSBUILD_BOOTSTRAP_ARGS := -r $(RUNTIME_ID) $(MSBUILD_BOOTSTRAP_ARGS)

# This gets a bit complex. There are two cases here:
# BOOTSTRAP=false:
# Things proceed simply. The "all" target does not depend on the bootstrap
# target, so bootstrap is never built, and BootstrapBuildPath is unspecified.
# BOOTSTRAP=true:
# BOOTSTRAP_DEPENDENCY is set to "bootstrap", making the "all" target depend
# on it, and so the bootstrap compiler gets built. Additionally,
# BootstrapBuildPath is specified, but *only* for the main build, *not* the
# bootstrap build.
ifeq ($(BOOTSTRAP),true)
MSBUILD_ARGS += /p:BootstrapBuildPath=$(BOOTSTRAP_PATH)
MSBUILD_MAIN_ARGS += /p:BootstrapBuildPath=$(BOOTSTRAP_PATH)
BOOTSTRAP_DEPENDENCY := bootstrap
else
BOOTSTRAP_DEPENDENCY :=
endif

BUILD_CMD := dotnet build $(MSBUILD_ARGS)

.PHONY: all bootstrap test restore

all: restore
$(BUILD_CMD) $(THIS_MAKEFILE_PATH)CrossPlatform.sln
all: restore $(BOOTSTRAP_DEPENDENCY)
@echo Building CrossPlatform.sln
dotnet build $(THIS_MAKEFILE_PATH)CrossPlatform.sln $(MSBUILD_MAIN_ARGS)

bootstrap: restore
$(BUILD_CMD) $(SRC_PATH)/Compilers/CSharp/CscCore
$(BUILD_CMD) $(SRC_PATH)/Compilers/VisualBasic/VbcCore
mkdir -p $(BOOTSTRAP_PATH)/csc
mkdir -p $(BOOTSTRAP_PATH)/vbc
dotnet publish -c $(BUILD_CONFIGURATION) -r $(RUNTIME_ID) $(SRC_PATH)/Compilers/CSharp/CscCore -o $(BOOTSTRAP_PATH)/csc
dotnet publish -c $(BUILD_CONFIGURATION) -r $(RUNTIME_ID) $(SRC_PATH)/Compilers/VisualBasic/VbcCore -o $(BOOTSTRAP_PATH)/vbc
@echo Building Bootstrap
dotnet publish $(SRC_PATH)/Compilers/CSharp/CscCore -o $(BOOTSTRAP_PATH)/csc $(MSBUILD_BOOTSTRAP_ARGS)
dotnet publish $(SRC_PATH)/Compilers/VisualBasic/VbcCore -o $(BOOTSTRAP_PATH)/vbc $(MSBUILD_BOOTSTRAP_ARGS)
dotnet publish $(SRC_PATH)/Compilers/Core/MSBuildTask -o $(BOOTSTRAP_PATH) $(MSBUILD_BOOTSTRAP_ARGS)
rm -rf $(BINARIES_PATH)/$(BUILD_CONFIGURATION)

test:
dotnet publish -r $(RUNTIME_ID) $(SRC_PATH)/Test/DeployCoreClrTestRuntime -o $(BINARIES_PATH)/$(BUILD_CONFIGURATION)/CoreClrTest -p:RoslynRuntimeIdentifier=$(RUNTIME_ID)
dotnet publish $(SRC_PATH)/Test/DeployCoreClrTestRuntime -o $(BINARIES_PATH)/$(BUILD_CONFIGURATION)/CoreClrTest -r $(RUNTIME_ID) -p:RoslynRuntimeIdentifier=$(RUNTIME_ID) $(MSBUILD_MAIN_ARGS)
$(THIS_MAKEFILE_PATH)build/scripts/tests.sh $(BUILD_CONFIGURATION)

restore: $(DOTNET)
Expand Down
17 changes: 3 additions & 14 deletions cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ usage()
echo " --debug Build Debug (default)"
echo " --release Build Release"
echo " --skiptest Do not run tests"
echo " --skipcrossgen Do not crossgen the bootstrapped compiler"
echo " --skipcommitprinting Do not print commit information"
echo " --nocache Force download of toolsets"
}

BUILD_CONFIGURATION=Debug
USE_CACHE=true
SKIP_TESTS=false
SKIP_CROSSGEN=false
SKIP_COMMIT_PRINTING=false

MAKE="make"
Expand Down Expand Up @@ -59,10 +57,6 @@ do
SKIP_TESTS=true
shift 1
;;
--skipcrossgen)
SKIP_CROSSGEN=true
shift 1
;;
--skipcommitprinting)
SKIP_COMMIT_PRINTING=true
shift 1
Expand All @@ -74,8 +68,6 @@ do
esac
done

MAKE_ARGS="BUILD_CONFIGURATION=$BUILD_CONFIGURATION SKIP_CROSSGEN=$SKIP_CROSSGEN"

if [ "$CLEAN_RUN" == "true" ]; then
echo Clean out the enlistment
git clean -dxf .
Expand All @@ -86,13 +78,10 @@ if [ "$SKIP_COMMIT_PRINTING" == "false" ]; then
git show --no-patch --pretty=raw HEAD
fi

echo Building Bootstrap
$MAKE bootstrap $MAKE_ARGS

echo Building CrossPlatform.sln
$MAKE all $MAKE_ARGS BOOTSTRAP=true BUILD_LOG_PATH=Binaries/Build.log
MAKE_TARGET="all"

if [ "$SKIP_TESTS" == "false" ]; then
$MAKE test $MAKE_ARGS
MAKE_TARGET="$MAKE_TARGET test"
fi

$MAKE $MAKE_TARGET BUILD_CONFIGURATION=$BUILD_CONFIGURATION BOOTSTRAP=true BUILD_LOG_PATH=Binaries/Build.log

0 comments on commit 649d4e3

Please sign in to comment.