[msbuild] Find gbc in a clean build

- Correctly find the just compiled gbc
- Add fail condition to appveyor CI
- Closes https://github.com/Microsoft/bond/issues/526
This commit is contained in:
Eduardo Salinas 2017-07-12 19:05:38 -07:00 коммит произвёл Christopher Warrington
Родитель 350e0d7bb0
Коммит 0310220c3f
2 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -200,6 +200,8 @@
msbuild cs\cs.sln /verbosity:minimal "/target:$($compatTests -join ';')" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if (-not $?) { throw "cs compat build failed" }
mkdir build
cd build

Просмотреть файл

@ -42,9 +42,9 @@
<!-- Attempt to find gbc in a platform-agnostic way. -->
<PropertyGroup>
<_BondExe>gbc</_BondExe>
<_BondExe Condition="Exists('$(BOND_COMPILER_PATH)\gbc.exe')">$(BOND_COMPILER_PATH)\gbc.exe</_BondExe>
<_BondExe Condition="Exists('$(BOND_COMPILER_PATH)\gbc')">$(BOND_COMPILER_PATH)\gbc</_BondExe>
<_PreExistingBondExe></_PreExistingBondExe>
<_PreExistingBondExe Condition="Exists('$(BOND_COMPILER_PATH)\gbc.exe')">$(BOND_COMPILER_PATH)\gbc.exe</_PreExistingBondExe>
<_PreExistingBondExe Condition="Exists('$(BOND_COMPILER_PATH)\gbc')">$(BOND_COMPILER_PATH)\gbc</_PreExistingBondExe>
</PropertyGroup>
<!-- Some versions of Visual Studio have an additional up-to-date check
@ -52,7 +52,7 @@
need to add gbc as an input to the Visual Studio up-to-date check as
well. -->
<ItemGroup>
<UpToDateCheckInput Include="$(_BondExe)" />
<UpToDateCheckInput Include="$(_PreExistingBondExe)" />
</ItemGroup>
<!-- BondCodegenCs - transform .bond files into .cs files
@ -71,7 +71,7 @@
NOTE: This still won't catch changes to files imported outside the
BondCodegen item. -->
<Target Name="BondCodegenCs"
Inputs="$(_BondExe);@(BondCodegen)"
Inputs="$(_PreExistingBondExe);@(BondCodegen)"
Outputs="$(BondOutputDirectory)\bondcodegen.done;@(BondCodegen -> '$(BondOutputDirectory)\%(FileName)_types.cs')"
BeforeTargets="CoreCompile"
Condition="'@(BondCodegen)' != ''">
@ -83,6 +83,9 @@
<!-- just for a simpler commandline read -->
<PropertyGroup>
<_BondExe>gbc</_BondExe>
<_BondExe Condition="Exists('$(BOND_COMPILER_PATH)\gbc.exe')">$(BOND_COMPILER_PATH)\gbc.exe</_BondExe>
<_BondExe Condition="Exists('$(BOND_COMPILER_PATH)\gbc')">$(BOND_COMPILER_PATH)\gbc</_BondExe>
<_BondImportDirs>--import-dir="$(BOND_INCLUDE_PATH)" @(BondImportDirectory -> '--import-dir=&quot;%(Identity)\.&quot;',' ')</_BondImportDirs>
<_BondCommand>&quot;$(_BondExe)&quot; $(BondCodegenMode) $(_BondImportDirs) --jobs=-2 --namespace=bond=Bond --output-dir="$(BondOutputDirectory)\."</_BondCommand>
</PropertyGroup>