Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Fix the legacy-lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate McMaster committed Feb 6, 2017
1 parent dffd2a3 commit af694f7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 176 deletions.
13 changes: 3 additions & 10 deletions build/KoreBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if (!(Test-Path "$koreBuildFolder\Sake"))
$toolsProject = "$koreBuildFolder\tools.proj"
&dotnet restore "$toolsProject" --packages "$PSScriptRoot" -v Minimal
# We still nuget because dotnet doesn't have support for pushing packages
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v3.5.0-beta2/NuGet.exe" -OutFile "$koreBuildFolder/nuget.exe"
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v4.0.0-rc3/NuGet.exe" -OutFile "$koreBuildFolder/nuget.exe"
}

$env:KOREBUILD_FOLDER=$koreBuildFolder
Expand All @@ -100,21 +100,14 @@ $msbuildArtifactsDir = "$repoFolder/artifacts/msbuild"
$msbuildLogFilePath = "$msbuildArtifactsDir/msbuild.log"
$msBuildResponseFile = "$msbuildArtifactsDir/msbuild.rsp"

if ($allparams)
{
$targets += "/t:$($allparams.Replace(' ', ';'))"
}

$msBuildArguments = @"
/nologo
/m
/detailedsummary
"$makeFileProj"
/p:KoreBuildDirectory="$koreBuildFolder/"
/p:RepositoryRoot="$repoFolder/"
/fl
/flp:LogFile="$msbuildLogFilePath";Verbosity=diagnostic;Encoding=UTF-8
$targets
/p:SakeTargets=$($allparams -replace ' ',':')
"@

if (!(Test-Path $msbuildArtifactsDir))
Expand All @@ -123,4 +116,4 @@ if (!(Test-Path $msbuildArtifactsDir))
}
$msBuildArguments | Out-File -Encoding ASCII -FilePath $msBuildResponseFile

dotnet msbuild `@"$msBuildResponseFile"
dotnet build `@"$msBuildResponseFile"
12 changes: 5 additions & 7 deletions build/KoreBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ while [[ $# > 0 ]]; do
;;
*)
if [ -z "$targets" ]; then
targets="/t:$1"
targets="$1"
else
targets+=";$1"
targets+=":$1"
fi
;;
esac
Expand Down Expand Up @@ -110,7 +110,7 @@ export ReferenceAssemblyRoot=$netFrameworkContentDir

nugetPath="$koreBuildFolder/nuget.exe"
if [ ! -f $nugetPath ]; then
nugetUrl="https://dist.nuget.org/win-x86-commandline/v3.5.0-beta2/NuGet.exe"
nugetUrl="https://dist.nuget.org/win-x86-commandline/v4.0.0-rc3/NuGet.exe"
wget -O $nugetPath $nugetUrl 2>/dev/null || curl -o $nugetPath --location $nugetUrl 2>/dev/null
fi

Expand All @@ -129,13 +129,11 @@ fi
cat > $msbuildResponseFile <<ENDMSBUILDARGS
/nologo
/m
/detailedsummary
"$makeFileProj"
/p:KoreBuildDirectory="$koreBuildFolder/"
/p:RepositoryRoot="$repoFolder/"
/fl
-flp:LogFile="$msbuildLogFile";Verbosity=diagnostic;Encoding=UTF-8
$targets
/flp:LogFile="$msbuildLogFile";Verbosity=diagnostic;Encoding=UTF-8
/p:SakeTargets=$targets
ENDMSBUILDARGS

dotnet msbuild @"$msbuildResponseFile"
155 changes: 8 additions & 147 deletions build/targets/legacy-lifecycle.targets
Original file line number Diff line number Diff line change
@@ -1,162 +1,23 @@
<Project>
<Target Name="default">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=" />
</Target>

<Target Name="pre-clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=pre-clean" />
</Target>

<Target Name="clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=clean" />
</Target>

<Target Name="post-clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=post-clean" />
</Target>

<Target Name="validate">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=validate" />
</Target>

<Target Name="initialize">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=initialize" />
</Target>

<Target Name="compile">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=compile" />
</Target>

<Target Name="test-compile">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=test-compile" />
</Target>

<Target Name="test">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=test" />
</Target>

<Target Name="package-prepare">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=package-prepare" />
</Target>

<Target Name="package">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=package" />
</Target>

<Target Name="pre-integration-test">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=pre-integration-test" />
</Target>

<Target Name="integration-test">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=integration-test" />
</Target>

<Target Name="post-integration-test">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=post-integration-test" />
</Target>

<Target Name="verify">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=verify" />
</Target>

<Target Name="install">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=install" />
</Target>

<Target Name="deploy">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=deploy" />
</Target>

<Target Name="--for-ci">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=--for-ci" />
</Target>
<Target Name="restore-npm-modules">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=restore-npm-modules" />
</Target>
<Target Name="restore-bower-components">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=restore-bower-components" />
</Target>
<Target Name="run-grunt">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=run-grunt" />
</Target>
<Target Name="clean-bin-folder">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=clean-bin-folder" />
</Target>
<Target Name="clean-npm-modules">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=clean-npm-modules" />
</Target>
<Target Name="deep-clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=deep-clean" />
</Target>
<Target Name="repo-initialize">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=repo-initialize" />
</Target>
<Target Name="target-dir-clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=target-dir-clean" />
</Target>
<Target Name="build-clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=build-clean" />
</Target>
<Target Name="ci-deep-clean">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=ci-deep-clean" />
</Target>
<Target Name="build-compile">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=build-compile" />
</Target>
<Target Name="run-api-check">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=run-api-check" />
</Target>
<Target Name="build-pack">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=build-pack" />
</Target>
<Target Name="native-compile">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=native-compile" />
</Target>
<Target Name="nuget-verify">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=nuget-verify" />
</Target>
<Target Name="nuget-install">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=nuget-install" />
</Target>
<Target Name="xunit-test">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=xunit-test" />
</Target>
<Target Name="make-roslyn-fast">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=make-roslyn-fast" />
</Target>
<Target Name="resx">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ExecShade" Properties="ShadeTarget=resx" />
</Target>
<Target Name="--no-restore">
<PropertyGroup>
<NoRestore>true</NoRestore>
</PropertyGroup>
</Target>
<Target Name="--quiet">
<PropertyGroup>
<MakeQuiet>true</MakeQuiet>
</PropertyGroup>
</Target>
<Target Name="--parallel" />

<Target Name="ExecShade">
<Target Name="Build">
<PropertyGroup>
<ShadeDirectory>$(KoreBuildDirectory)shade/</ShadeDirectory>
<SakeExecutable>$(RepositoryRoot)$(KoreBuildDirectory)sake/0.2.2/tools/Sake.exe</SakeExecutable>
<ShadeDirectory>$(MSBuildThisFileDirectory)../shade/</ShadeDirectory>
<SakeExecutable>$(MSBuildThisFileDirectory)../sake/0.2.2/tools/Sake.exe</SakeExecutable>
<SakeExecutable Condition="'$(OS)'!='Windows_NT'">mono $(SakeExecutable)</SakeExecutable>
<MakeFilePath>$(ShadeDirectory)makefile.shade</MakeFilePath>
<MakeFilePath Condition="!Exists('$(RepositoryRoot)makefile.shade')">$(RepositoryRoot)makefile.shade</MakeFilePath>
<MakeFilePath Condition="Exists('$(RepositoryRoot)makefile.shade')">$(RepositoryRoot)makefile.shade</MakeFilePath>

<!-- TODO test if 'file://' works on Windows -->
<MakeFilePath Condition="'$(OS)'=='Windows_NT'">$([MSBuild]::MakeRelative('$(RepositoryRoot)', '$(MakeFilePath)'))</MakeFilePath>
<MakeFilePath Condition="'$(OS)'!='Windows_NT'">$([MSBuild]::MakeRelative('file://$(RepositoryRoot)', 'file://$(MakeFilePath)'))</MakeFilePath>

<ShadeTarget Condition="'$(NoRestore)'=='true'">--no-restore $(ShadeTarget)</ShadeTarget>
<ShadeTarget Condition="'$(MakeQuiet)'=='true'">--quiet $(ShadeTarget)</ShadeTarget>
<SakeTargets Condition="'$(SakeTargets)' != '' ">$(SakeTargets.Replace(':', ' '))</SakeTargets>
<SakeTargets Condition="'$(NoRestore)'=='true'">--no-restore $(SakeTargets)</SakeTargets>
<SakeTargets Condition="'$(MakeQuiet)'=='true'">--quiet $(SakeTargets)</SakeTargets>
</PropertyGroup>

<Exec
Command="$(SakeExecutable) -I $(KoreBuildDirectory)shade -f $(MakeFilePath) $(ShadeTarget)"
Command="$(SakeExecutable) -I &quot;$(MSBuildThisFileDirectory)../shade&quot; -f $(MakeFilePath) $(SakeTargets)"
WorkingDirectory="$(RepositoryRoot)" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions build/targets/makefile.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project DefaultTarget="Default">
<Project>
<PropertyGroup>
<LifecycleType Condition="'$(LifecycleType)'==''">Legacy</LifecycleType>
<LifecycleType>Legacy</LifecycleType>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\common.props" />
Expand Down
11 changes: 1 addition & 10 deletions build/targets/standard-lifecycle.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<!-- default targets -->

<Target Name="Default" DependsOnTargets="Clean;Restore;Rebuild;Pack;Test;Verify;Publish" />
<Target Name="Build" DependsOnTargets="Clean;Restore;Rebuild;Pack;Test;Verify;Publish" />

<Target Name="Clean">
<RemoveDir Directories="$(ArtifactsDir)" />
Expand Down Expand Up @@ -41,13 +41,4 @@

<Target Name="Publish" />

<!-- convenience targets -->

<!-- build without cleaning -->
<Target Name="Build">
<MSBuild Targets="Build"
Projects="@(SolutionsToBuild)"
Properties="Configuration=$(Configuration)" />
</Target>

</Project>

0 comments on commit af694f7

Please sign in to comment.