Permalink
Browse files

Updated build.proj and Clojure.Compile.csproj to support Mono

1. Updated build.proj script to build CLojureCLR with Mono (XBuild)
2. Updated Clojure.Compile.csproj to support building ClojureCLR with
Mono
(XBuild) and Windows (MSBuild)
  • Loading branch information...
1 parent aad9d91 commit d1020cd8a626234a368eee8b7abe957a79e1fc92 @robertlj robertlj committed Sep 11, 2012
Showing with 40 additions and 16 deletions.
  1. +5 −1 Clojure/Clojure.Compile/Clojure.Compile.csproj
  2. +35 −15 Clojure/build.proj
@@ -131,6 +131,10 @@
</Target>
-->
<PropertyGroup>
- <PostBuildEvent>"$(TargetPath)" clojure.core clojure.core.protocols clojure.core.reducers clojure.main clojure.set clojure.zip clojure.walk clojure.stacktrace clojure.template clojure.test clojure.test.tap clojure.test.junit clojure.pprint clojure.clr.io clojure.repl clojure.clr.shell clojure.string clojure.data clojure.reflect</PostBuildEvent>
+ <Runtime>.Net</Runtime>
+ </PropertyGroup>
+ <PropertyGroup>
+ <PostBuildEvent Condition=" '$(Runtime)' == 'Mono' ">mono "$(TargetPath)" clojure.core clojure.core.protocols clojure.main clojure.set clojure.zip clojure.walk clojure.stacktrace clojure.template clojure.test clojure.test.tap clojure.test.junit clojure.pprint clojure.clr.io clojure.repl clojure.clr.shell clojure.string clojure.data clojure.reflect</PostBuildEvent>
+ <PostBuildEvent Condition=" '$(Runtime)' == '.Net' ">"$(TargetPath)" clojure.core clojure.core.protocols clojure.main clojure.set clojure.zip clojure.walk clojure.stacktrace clojure.template clojure.test clojure.test.tap clojure.test.junit clojure.pprint clojure.clr.io clojure.repl clojure.clr.shell clojure.string clojure.data clojure.reflect</PostBuildEvent>
</PropertyGroup>
</Project>
View
@@ -5,6 +5,7 @@
<!--<Platform Condition=" '$(Platform)' == '' ">Any CPU</Platform>-->
<cljc>Clojure.Compile.exe</cljc>
<clji>Clojure.Main.exe</clji>
+ <Runtime>.Net</Runtime>
</PropertyGroup>
<!--Is there a way to avoid this duplication? This is also encoded in the project files, although relative to a different path -->
@@ -22,34 +23,53 @@
</PropertyGroup>
<Target Name="Build">
- <MSBuild Projects="ClojureCLR.sln"/>
+ <MSBuild Projects="ClojureCLR.sln"
+ Properties="Runtime=$(Runtime)"/>
</Target>
<Target Name="CompileTest" DependsOnTargets="Build">
- <Exec Command="$(cljc) clojure.test-clojure.genclass.examples clojure.test-clojure.protocols.examples clojure.test-clojure.protocols.more-examples clojure.test-clojure.repl.example"
- WorkingDirectory="$(OutputPath)"/>
+ <Exec Command="$(cljc) clojure.test-clojure.genclass.examples clojure.test-clojure.protocols.examples clojure.test-clojure.protocols.more-examples clojure.test-clojure.repl.example"
+ WorkingDirectory="$(OutputPath)"
+ Condition=" '$(Runtime)' == '.Net' "/>
+ <Exec Command="mono $(cljc) clojure.test-clojure.genclass.examples clojure.test-clojure.protocols.examples clojure.test-clojure.protocols.more-examples clojure.test-clojure.repl.example"
+ WorkingDirectory="$(OutputPath)"
+ Condition=" '$(Runtime)' == 'Mono' "/>
</Target>
<Target Name="Test" DependsOnTargets="Build;CompileTest">
<Copy SkipUnchangedFiles="true" SourceFiles="Clojure.Tests\clojure\run_tests.clj" DestinationFolder="$(OutputPath)" />
- <Exec Command="$(clji) clojure\run_tests.clj"
- WorkingDirectory="$(OutputPath)"/>
+ <Exec Command="$(clji) clojure\run_tests.clj"
+ WorkingDirectory="$(OutputPath)"
+ Condition=" '$(Runtime)' == '.Net' "/>
+ <Exec Command="mono $(clji) clojure\run_tests.clj"
+ WorkingDirectory="$(OutputPath)"
+ Condition=" '$(Runtime)' == 'Mono' "/>
</Target>
+ <!-- RJ: Reworked Dist target to work around Mono bug related to embeding ItemGroup inside a Target tag -->
<Target Name="Dist" DependsOnTargets="Build">
- <ItemGroup>
- <!--DLR-->
+ <!--DLR-->
<Dlls Include="$(OutputPath)\Microsoft.*" />
<!--Clojure dlls and exes-->
- <Dlls Include="$(OutputPath)\Clojure.*"
- Exclude="$(OutputPath)\Clojure.Tests.dll;$(OutputPath)\Clojure.Tests.pdb;
- $(OutputPath)\Clojure.Source.dll;$(OutputPath)\Clojure.Source.pdb;
- $(OutputPath)\clojure.test-clojure.genclass.examples.ExampleClass.dll;
- $(OutputPath)\clojure.test-clojure.genclass.examples.ExampleClass.pdb;
- $(OutputPath)\Clojure.Main.vshost.exe;$(OutputPath)\Clojure.Main.vshost.exe.manifest" />
+ <CreateItem
+ Include="$(OutputPath)\Clojure.*;$(OutputPath)\Microsoft.*"
+ Exclude="$(OutputPath)\Clojure.Tests.dll;$(OutputPath)\Clojure.Tests.pdb;
+ $(OutputPath)\Clojure.Source.dll;$(OutputPath)\Clojure.Source.pdb;
+ $(OutputPath)\clojure.test-clojure.genclass.examples.ExampleClass.dll;
+ $(OutputPath)\clojure.test-clojure.genclass.examples.ExampleClass.pdb;
+ $(OutputPath)\Clojure.Main.vshost.exe;$(OutputPath)\Clojure.Main.vshost.exe.manifest">
+ <Output
+ TaskParameter="Include"
+ ItemName="Dlls"/>
+ </CreateItem>
<!--clj and AOT clj files-->
- <CljFiles Include="$(OutputPath)\clojure\**\*" Exclude="$(OutputPath)\clojure\test_clojure\**\*" />
- </ItemGroup>
+ <CreateItem
+ Include="$(OutputPath)\clojure\**\*"
+ Exclude="$(OutputPath)\clojure\test_clojure\**\*">
+ <Output
+ TaskParameter="Include"
+ ItemName="CljFiles"/>
+ </CreateItem>
<Copy SourceFiles="@(Dlls)" DestinationFolder="..\dist\$(Configuration)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CljFiles)" DestinationFolder="..\dist\$(Configuration)\clojure\%(RecursiveDir)" SkipUnchangedFiles="true" />
</Target>

0 comments on commit d1020cd

Please sign in to comment.