Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,6 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

# Local msbuild copy to run on Mono
src/ExternalApis/
25 changes: 25 additions & 0 deletions init-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

SRC="src"
EXTERNAL_APIS_DIR="$SRC/ExternalApis"
#see https://github.com/mono/msbuild/blob/xplat-c9/cibuild.sh
MSBUILD_DOWNLOAD_URL="https://github.com/radical/msbuild/releases/download/v0.03/mono_msbuild_d25dd923839404bd64cc63f420e75acf96fc75c4.zip"
MSBUILD_ZIP="$EXTERNAL_APIS_DIR/msbuild.zip"
MSBUILD_EXE="$EXTERNAL_APIS_DIR/MSBuild/msbuild.exe"

downloadMSBuildForMono()
{
if [ ! -e "$MSBUILD_EXE" ]
then
mkdir -p $EXTERNAL_APIS_DIR

echo "** Downloading MSBUILD from $MSBUILD_DOWNLOAD_URL"
curl -sL -o $MSBUILD_ZIP "$MSBUILD_DOWNLOAD_URL"

unzip -q $MSBUILD_ZIP -d $EXTERNAL_APIS_DIR
find "$EXTERNAL_APIS_DIR/msbuild" -name "*.exe" -exec chmod "+x" '{}' ';'
rm $MSBUILD_ZIP
fi
}

downloadMSBuildForMono
1 change: 1 addition & 0 deletions src/CodeFormatter/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="./msbuild" />
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
Expand Down
18 changes: 18 additions & 0 deletions src/CodeFormatter/CodeFormatter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="CopyMSBuildForMono"
AfterTargets="AfterBuild"
Condition=" '$(OS)' == 'Unix' ">
<ItemGroup>
<_CopyItems Include="..\ExternalApis\msbuild\*.*" />
</ItemGroup>
<Copy
SourceFiles="@(_CopyItems)"
DestinationFolder="$(TargetDir)\msbuild"
/>
</Target>
<Target Name="AfterClean"
Condition=" '$(OS)' == 'Unix' ">
<ItemGroup>
<LocalMonoMSBuild Include="$(TargetDir)\msbuild" />
</ItemGroup>
<RemoveDir Directories="@(LocalMonoMSBuild)" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down