Permalink
Browse files

Used the latest FAKE, added creation of the nuget package mechanism o…

…f FAKE
  • Loading branch information...
J. Preiss
J. Preiss committed Oct 15, 2012
1 parent 0f4971b commit 00489a702289c10a19b0146f3ccfcb0c0d5e7b83
View
@@ -7,6 +7,8 @@ open Fake
let projectName = "Lingua"
let projectSummary = "A .NET-based parser generator. It uses reflection to generate parsers and scanners using code-based scanner and grammar definitions."
let authors = ["R. Todd"; "J. Preiss"]
+let homepage = "https://github.com/Slesa/Lingua"
+let mail = "joerg.preiss@slesa.de"
let currentVersion =
if not isLocalBuild then buildVersion else
@@ -16,13 +18,18 @@ TraceEnvironmentVariables()
// Directories
+let srcDir = @".\src\"
let binDir = @".\bin\"
let buildDir = binDir @@ @"build\"
let testDir = binDir @@ @"test\"
+let nugetDir = binDir @@ @"nuget\"
let reportDir = binDir @@ @"report\"
-let deployDir = binDir @@ @"deploy\"
-let packagesDir = binDir @@ @"packages"
-let mspecDir = packagesDir @@ "MSpec"
+let packagesDir = srcDir @@ @"packages\"
+
+
+// Tools
+let MSpecVersion = GetPackageVersion packagesDir "Machine.Specifications"
+let mspecTool = sprintf @"%sMachine.Specifications.%s\tools\mspec-clr4.exe" packagesDir MSpecVersion
// Files
@@ -38,11 +45,7 @@ let testReferences =
// Targets
Target "Clean" (fun _ ->
- CleanDirs [buildDir; testDir; deployDir; reportDir; packagesDir]
-
- CreateDir mspecDir
- !! (@"src\packages\Machine.Specifications.*\**\*.*")
- |> CopyTo mspecDir
+ CleanDirs [buildDir; testDir; nugetDir; reportDir ]
)
Target "SetAssemblyInfo" (fun _ ->
@@ -58,7 +61,7 @@ Target "SetAssemblyInfo" (fun _ ->
AssemblyCopyright = "Copyright © 2010";
AssemblyTrademark = "MS Public License";
AssemblyVersion = currentVersion;
- OutputFileName = @".\src\VersionInfo.cs"})
+ OutputFileName = srcDir @@ @"\VersionInfo.cs"})
)
Target "BuildApp" (fun _ ->
@@ -68,13 +71,10 @@ Target "BuildApp" (fun _ ->
Target "BuildTest" (fun _ ->
MSBuildDebug testDir "Build" testReferences
- |> Log "TestBuildOutput: "
+ |> Log "TestBuild-Output: "
)
Target "RunTest" (fun _ ->
- let mspecTool = mspecDir @@ "mspec-clr4.exe"
- trace mspecTool
-
!! (testDir @@ "*.Specs.dll")
|> MSpec (fun p ->
{p with
@@ -84,32 +84,35 @@ Target "RunTest" (fun _ ->
Target "Deploy" (fun _ ->
- let libDir = deployDir @@ @"lib\net40"
+ let libDir = nugetDir @@ @"lib\net40"
CreateDir libDir
- let toolsDir = deployDir @@ @"tools\"
+ let toolsDir = nugetDir @@ @"tools\"
CreateDir toolsDir
- let contentDir = deployDir @@ @"content\"
+ let contentDir = nugetDir @@ @"content\"
CreateDir contentDir
let nugetExe = @"tools\NuGet\NuGet.exe"
- !! "Lingua.nuspec"
- |> CopyTo deployDir
!! (buildDir @@ "Lingua.dll")
|> CopyTo libDir
!+ (buildDir @@ "Lingua.dll")
++ (buildDir @@ "LinguaDemo.exe")
++ (buildDir @@ "LinguaDemo.exe.config")
+ |> Scan
+ |> CopyTo toolsDir
+ !+ "Copyright.txt"
+ ++ "License.txt"
+ ++ "Readme.txt"
|> Scan
- |> CopyTo toolsDir
-
- let result =
- ExecProcess (fun info ->
- info.FileName <- nugetExe
- info.Arguments <- "pack " + projectName + ".nuspec"
- info.WorkingDirectory <- deployDir
- ) (System.TimeSpan.FromMinutes 1.)
- if result <> 0 then failwith "Unable to call nuget"
-
+ |> CopyTo contentDir
+
+ NuGet (fun p ->
+ {p with
+ Authors = authors
+ Project = projectName
+ Description = projectSummary
+ OutputPath = nugetDir
+ AccessKey = getBuildParamOrDefault "nugetkey" ""
+ Publish = hasBuildParam "nugetkey" }) "Lingua.nuspec"
)
Target "Default" DoNothing
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="FAKE" version="1.64.8" />
+</packages>
@@ -31,19 +31,19 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Machine.Fakes">
+ <Reference Include="Machine.Fakes, Version=0.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Machine.Fakes.0.6\lib\net40\Machine.Fakes.dll</HintPath>
</Reference>
- <Reference Include="Machine.Fakes.Adapters.RhinoMocks">
+ <Reference Include="Machine.Fakes.Adapters.RhinoMocks, Version=0.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Machine.Fakes.RhinoMocks.0.6\lib\net40\Machine.Fakes.Adapters.RhinoMocks.dll</HintPath>
</Reference>
- <Reference Include="Machine.Specifications">
+ <Reference Include="Machine.Specifications, Version=0.5.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Machine.Specifications.0.5.9\lib\net40\Machine.Specifications.dll</HintPath>
</Reference>
- <Reference Include="Machine.Specifications.Clr4">
+ <Reference Include="Machine.Specifications.Clr4, Version=0.5.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Machine.Specifications.0.5.9\lib\net40\Machine.Specifications.Clr4.dll</HintPath>
</Reference>
- <Reference Include="Rhino.Mocks">
+ <Reference Include="Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<HintPath>..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
View
@@ -7,6 +7,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinguaDemo", "LinguaDemo\Li
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lingua.Specs", "Lingua.Specs\Lingua.Specs.csproj", "{132A431E-90E8-4E02-BAFF-02FD746C7FBA}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{08BF3B67-0BF0-4F93-9E05-321389C414BA}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\packages.config = .nuget\packages.config
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
View
@@ -17,8 +17,8 @@
[assembly: AssemblyProduct("Lingua")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("MS Public License")]
-[assembly: AssemblyVersion("0.9.9.1")]
-[assembly: AssemblyFileVersion("0.9.9.1")]
+[assembly: AssemblyVersion("1.0.0.1")]
+[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyDelaySign(false)]
View
Binary file not shown.
@@ -2,7 +2,7 @@
<configuration>
<appSettings>
<add key="MSBuildPath" value="c:\Windows\Microsoft.NET\Framework\v4.0.30319\;c:\Windows\Microsoft.NET\Framework\v4.0.30128\;c:\Windows\Microsoft.NET\Framework\v3.5\" />
- <add key="FSIPath" value=".\Tools\FSharp\;.\lib\FSharp\;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\" />
+ <add key="FSIPath" value=".\tools\FSharp\;.\lib\FSharp\;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\" />
<add key="GitPath" value="[ProgramFilesX86]\Git\bin\;[ProgramFiles]\Git\bin\" />
</appSettings>
-</configuration>
+</configuration>
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.

0 comments on commit 00489a7

Please sign in to comment.