1. IntelliFactory
  2. WebSharper

Commits

Anton Tayanovskyy  committed 0970e7d Merge

Merged.

  • Participants
  • Parent commits 2db5634, deadb1f
  • Branches default

Comments (0)

Files changed (8)

File IntelliFactory.WebSharper.Compiler/IntelliFactory.WebSharper.Compiler.fsproj

View file
  • Ignore whitespace
       <Private>True</Private>
     </ProjectReference>
   </ItemGroup>
-  <Target Name="BeforeBuild" DependsOnTargets="DownloadDependencies" />
-</Project>
+</Project>

File IntelliFactory.WebSharper.JQuery/IntelliFactory.WebSharper.JQuery.fsproj

View file
  • Ignore whitespace
       <Private>True</Private>
     </ProjectReference>
   </ItemGroup>
-  <Target Name="BeforeBuild" Condition="!Exists('jquery-$(JQueryVersion).js')">
-    <MSBuild.ExtensionPack.Web.WebClient
-      TaskAction="DownloadFile"
-      Url="http://code.jquery.com/jquery-$(JQueryVersion).js"
-      FileName="jquery-$(JQueryVersion).js" />
+  <Target Name="BeforeBuild" Condition="!Exists('jquery-$(JQueryVersion).min.js')">
     <AjaxMin JsSourceFiles="jquery-$(JQueryVersion).js"
       JsSourceExtensionPattern="\.js$"
       JsTargetExtension=".min.js" />

File README.markdown

View file
  • Ignore whitespace
 
 Build requirements:
 
+* Microsoft .NET Framework 4.0
+
 * F#
 
-* MSBuild
-
-* [MSBuild Extension Pack](http://msbuildextensionpack.codeplex.com/)
-
-* [Microsoft Ajax Minifier](http://ajaxmin.codeplex.com)
-
-To compile, install the above requirements and run `MSBuild.exe` in
-the root directory of the checkout.  This will download and reference
-required Mono.Cecil libraries automatically.
+To compile, run `MSBuild.exe` in the root directory of the checkout.
+This will download and reference required Mono.Cecil libraries and
+Microsoft Ajax Minifier tasks automatically.
 
 For example, using PowerShell:
 

File WebSharper.proj

View file
  • Ignore whitespace
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <FSharpHome1>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0</FSharpHome1>
+    <FSharpHome2>$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\</FSharpHome2>
+    <FSharpHome3>$(MSBuildExtensionsPath32)\FSharp\1.0</FSharpHome3>
+    <FSharpHome Condition="Exists('$(FSharpHome1)') AND '$(FSharpHome)' == ''">$(FSharpHome1)</FSharpHome>
+    <FSharpHome Condition="Exists('$(FSharpHome2)') AND '$(FSharpHome)' == ''">$(FSharpHome2)</FSharpHome>
+    <FSharpHome Condition="Exists('$(FSharpHome3)') AND '$(FSharpHome)' == ''">$(FSharpHome3)</FSharpHome>
+  </PropertyGroup>
   <ItemGroup>
     <Projects Include="*/*.fsproj" />
     <Projects Include="*/*.csproj" />
   </ItemGroup>
   <Target Name="Build">
+    <Exec Command='"$(FSharpHome)\Fsi.exe" --exec .\Build\Build.fsx'
+          WorkingDirectory="$(MSBuildThisFileDirectory)" />
     <MSBuild Projects="@(Projects)" />
   </Target>
   <Target Name="Clean">

File WebSharper/WebSharper.fsproj

View file
  • Ignore whitespace
       <Private>True</Private>
     </ProjectReference>
   </ItemGroup>
-  <Target Name="BeforeBuild" DependsOnTargets="DownloadDependencies" />
-</Project>
+</Project>

File build/Build.fsx

View file
  • Ignore whitespace
+open System.IO
+open System.Net
+
+let baseDir =
+    Path.GetDirectoryName(__SOURCE_DIRECTORY__)
+
+let ( ++ ) a b =
+    Path.Combine(a, b)
+
+let libDir =
+    baseDir ++ "Lib"
+
+let makeDir path =
+    if not (Directory.Exists(path)) then
+        Directory.CreateDirectory(path)
+        |> ignore
+
+let baseUrl =
+    "http://bitbucket.org/IntelliFactory/websharper/downloads/"
+
+let download url path =
+    if not (File.Exists(path)) then
+        printfn "Downloading: %s" url
+        use client = new WebClient()
+        client.DownloadFile(url, path)
+        |> ignore
+
+let downloadFile (filename: string) =
+    let url = baseUrl + filename
+    let path = baseDir ++ "Lib" ++ filename
+    download url path
+
+makeDir libDir
+downloadFile "AjaxMin.dll"
+downloadFile "AjaxMin.tasks"
+downloadFile "AjaxMinTask.dll"
+downloadFile "Mono.Cecil.dll"
+downloadFile "Mono.Cecil.Mdb.dll"
+downloadFile "Mono.Cecil.Pdb.dll"
+
+baseDir ++ "IntelliFactory.WebSharper.JQuery" ++ "jquery-1.7.1.js"
+|> download "http://code.jquery.com/jquery-1.7.1.js"

File build/IntelliFactory.FSharp.targets

View file
  • Ignore whitespace
 -->
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <FSharpTargets1>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargets1>
-    <FSharpTargets2>$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets</FSharpTargets2>
-    <FSharpTargets3>$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets</FSharpTargets3>
-    <AjaxMinTargets1>..\.build\lib\AjaxMin.tasks</AjaxMinTargets1>
-    <AjaxMinTargets2>$(MSBuildExtensionsPath32)\Microsoft\MicrosoftAjax\AjaxMin.tasks</AjaxMinTargets2>
-    <ExtPackTargets>$(MSBuildExtensionsPath32)\ExtensionPack\4.0\MSBuild.ExtensionPack.tasks</ExtPackTargets>
+    <FSharpHome1>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0</FSharpHome1>
+    <FSharpHome2>$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\</FSharpHome2>
+    <FSharpHome3>$(MSBuildExtensionsPath32)\FSharp\1.0</FSharpHome3>
+    <FSharpHome Condition="Exists('$(FSharpHome1)') AND '$(FSharpHome)' == ''">$(FSharpHome1)</FSharpHome>
+    <FSharpHome Condition="Exists('$(FSharpHome2)') AND '$(FSharpHome)' == ''">$(FSharpHome2)</FSharpHome>
+    <FSharpHome Condition="Exists('$(FSharpHome3)') AND '$(FSharpHome)' == ''">$(FSharpHome3)</FSharpHome>
+    <FSharpTargets>$(FSharpHome)\Microsoft.FSharp.targets</FSharpTargets>
+    <AjaxMinTargets>$(MSBuildThisFileDirectory)\..\Lib\AjaxMin.tasks</AjaxMinTargets>
   </PropertyGroup>
-  <Import Project="$(FSharpTargets1)" Condition="Exists('$(FSharpTargets1)')" />
-  <Import Project="$(FSharpTargets2)" Condition="Exists('$(FSharpTargets2)') AND !Exists('$(FSharpTargets1)')" />
-  <Import Project="$(FSharpTargets3)" Condition="Exists('$(FSharpTargets3)') AND !Exists('$(FSharpTargets1)') AND !Exists('$(FSharpTargets2)')" />
-  <Import Project="$(AjaxMinTargets1)" Condition="Exists('$(AjaxMinTargets1)')" />
-  <Import Project="$(AjaxMinTargets2)" Condition="Exists('$(AjaxMinTargets2)') AND !Exists('$(AjaxMinTargets1)')" />
-  <Import Project="$(ExtPackTargets)" Condition="Exists('$(ExtPackTargets)')" />
+  <Import Project="$(FSharpTargets)" />
+  <Import Project="$(AjaxMinTargets)" Condition="Exists('$(AjaxMinTargets)')" />
   <PropertyGroup>
     <WebSharperKeyFile>$(MSBuildThisFileDirectory)\WebSharper.snk</WebSharperKeyFile>
     <KeyOriginatorFile Condition="Exists('$(WebSharperKeyFile)')">$(WebSharperKeyFile)</KeyOriginatorFile>
   </ItemGroup>
   <PropertyGroup>
     <LibDir>$(MSBuildThisFileDirectory)\..\Lib</LibDir>
-    <LibUrl>http://bitbucket.org/IntelliFactory/websharper/downloads</LibUrl>
   </PropertyGroup>
-  <Target Name="DownloadDependencies" Condition="!Exists('$(LibDir)\build.tmp')">
-    <MakeDir Directories="$(LibDir)" />
-    <Touch AlwaysCreate="true" Files="$(LibDir)\build.tmp" />
-    <MSBuild.ExtensionPack.Web.WebClient
-	TaskAction="DownloadFile"
-	Url="$(LibUrl)/Mono.Cecil.dll"
-	FileName="$(LibDir)\Mono.Cecil.dll" />
-    <MSBuild.ExtensionPack.Web.WebClient
-	TaskAction="DownloadFile"
-	Url="$(LibUrl)/Mono.Cecil.Pdb.dll"
-	FileName="$(LibDir)\Mono.Cecil.Pdb.dll" />
-    <MSBuild.ExtensionPack.Web.WebClient
-	TaskAction="DownloadFile"
-	Url="$(LibUrl)/Mono.Cecil.Mdb.dll"
-	FileName="$(LibDir)\Mono.Cecil.Mdb.dll" />
-  </Target>
 </Project>

File build/vs11/WebSharper.sln

View file
  • Ignore whitespace
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{BC76F2F0-F39D-425C-98E3-47636AAD023B}"
 	ProjectSection(SolutionItems) = preProject
+		..\..\WebSharper.proj = ..\..\WebSharper.proj
 		..\AssemblyInfo.fs = ..\AssemblyInfo.fs
+		..\Build.fsx = ..\Build.fsx
 		..\IntelliFactory.FSharp.targets = ..\IntelliFactory.FSharp.targets
 		..\IntelliFactory.WebSharper.InterfaceGenerator.targets = ..\IntelliFactory.WebSharper.InterfaceGenerator.targets
 		..\IntelliFactory.WebSharper.Sitelets.targets = ..\IntelliFactory.WebSharper.Sitelets.targets