Skip to content

Commit bd12b1d

Browse files
committed
implemented build process
1 parent 2ad1624 commit bd12b1d

File tree

11 files changed

+145
-0
lines changed

11 files changed

+145
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,4 @@ paket-files/
250250
# JetBrains Rider
251251
.idea/
252252
*.sln.iml
253+
build/

.paket/Paket.Restore.targets

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<!-- Mark that this target file has been loaded. -->
4+
<IsPaketRestoreTargetsFileLoaded>true</IsPaketRestoreTargetsFileLoaded>
5+
</PropertyGroup>
6+
7+
<UsingTask TaskName="Paket.Build.Tasks.PaketRestoreTask" AssemblyFile="PaketRestoreTask.dll" />
8+
9+
<Target Name="PaketRestore" BeforeTargets="_GenerateRestoreGraphWalkPerFramework" >
10+
<Exec Command="$(MSBuildThisFileDirectory)\paket.exe restore --project $(MSBuildProjectFullPath)" />
11+
12+
<!-- Write out package references for NETCore -->
13+
<PaketRestoreTask
14+
ProjectUniqueName="$(MSBuildProjectFullPath)"
15+
PackageReferences="@(PackageReference)"
16+
TargetFrameworks="$(TargetFramework)">
17+
<Output
18+
TaskParameter="NewPackageReferences"
19+
ItemName="PackageReference" />
20+
</PaketRestoreTask>
21+
</Target>
22+
</Project>

.paket/paket.exe.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<appSettings>
4+
<add key="Prerelease" value="True"/>
5+
</appSettings>
6+
</configuration>

.paket/paket.targets

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Enable the restore command to run before builds -->
5+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
6+
<!-- Download Paket.exe if it does not already exist -->
7+
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
8+
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
9+
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
10+
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
11+
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
12+
</PropertyGroup>
13+
<PropertyGroup>
14+
<!-- Paket command -->
15+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
16+
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
17+
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
18+
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
19+
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
20+
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT' AND Exists('$(PaketBootStrapperExePath)')">"$(PaketBootStrapperExePath)" $(PaketBootStrapperCommandArgs)</PaketBootStrapperCommand>
21+
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' AND Exists('$(PaketBootStrapperExePath)')">$(MonoPath) --runtime=v4.0.30319 $(PaketBootStrapperExePath) $(PaketBootStrapperCommandArgs)</PaketBootStrapperCommand>
22+
<!-- Commands -->
23+
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
24+
<PaketReferences Condition="!Exists('$(PaketReferences)')">$(MSBuildStartupDirectory)\paket.references</PaketReferences>
25+
<PaketReferences Condition="Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectFullPath).paket.references</PaketReferences>
26+
<RestoreCommand>$(PaketCommand) restore --references-files "$(PaketReferences)"</RestoreCommand>
27+
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
28+
<!-- We need to ensure packages are restored prior to assembly resolve -->
29+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
30+
</PropertyGroup>
31+
<Target Name="CheckPrerequisites">
32+
<!-- Raise an error if we're unable to locate paket.exe -->
33+
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
34+
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
35+
</Target>
36+
<Target Name="DownloadPaket">
37+
<Exec Command="$(DownloadPaketCommand)" IgnoreStandardErrorWarningFormat="true"
38+
Condition=" '$(DownloadPaket)' == 'true' AND '$(DownloadPaketCommand)' != '' AND !Exists('$(PaketExePath)')" />
39+
</Target>
40+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
41+
<Exec Command="$(RestoreCommand)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(PaketRootPath)" Condition="Exists('$(PaketReferences)')" ContinueOnError="true" />
42+
</Target>
43+
</Project>

build.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
cls
3+
4+
5+
.paket\paket.exe restore
6+
if errorlevel 1 (
7+
exit /b %errorlevel%
8+
)
9+
10+
"packages\FAKE\tools\Fake.exe" build.fsx
11+
pause

build.fsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// include Fake lib
2+
#r @"packages\FAKE\tools\FakeLib.dll"
3+
open Fake
4+
open Fake.MSTest
5+
open System
6+
7+
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
8+
Fake.MSBuildHelper.MSBuildLoggers <- []
9+
10+
let dir = "./build/"
11+
let nugetDir = "./NuGet/"
12+
13+
Target "Clean" (fun _ ->
14+
trace "Clean directory."
15+
CleanDir dir
16+
)
17+
18+
Target "BuildApp" (fun _ ->
19+
trace "Build app"
20+
RestorePackages()
21+
!! "src/**/*.csproj"
22+
|> MSBuildRelease dir "Build"
23+
|> Log "AppBuild-Output: "
24+
)
25+
26+
Target "Tests" (fun _ ->
27+
trace "Run tests"
28+
!! (dir+"*.Tests.dll")
29+
|> MSTest (fun p -> p)
30+
)
31+
32+
Target "CreatePackage" (fun _ ->
33+
trace "Create Nuget package"
34+
35+
CreateDir nugetDir
36+
CleanDir nugetDir
37+
38+
NuGetPack (fun p -> {p with Version = "1.0.5"}) "src/Dijkstra.NET/Dijkstra.NET/Dijkstra.NET.csproj"
39+
)
40+
41+
"Clean"
42+
==>
43+
"BuildApp"
44+
==>
45+
"Tests"
46+
==>
47+
"CreatePackage"
48+
49+
// start build
50+
RunTargetOrDefault "CreatePackage"

paket.dependencies

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source http://nuget.org/api/v2
2+
3+
nuget FAKE

paket.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NUGET
2+
remote: http://www.nuget.org/api/v2
3+
FAKE (4.44.2)

src/Dijkstra.NET/Dijkstra.NET.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dijkstra.NET.Tests", "Dijks
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dijkstra.NET.Benchmark", "Dijkstra.NET.Benchmark\Dijkstra.NET.Benchmark.csproj", "{2BBC072D-75B7-43A3-BECB-BEF9562EE377}"
1111
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{413C264A-5973-40A6-9126-39766EBA18F6}"
13+
ProjectSection(SolutionItems) = preProject
14+
..\..\build.fsx = ..\..\build.fsx
15+
EndProjectSection
16+
EndProject
1217
Global
1318
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1419
Debug|Any CPU = Debug|Any CPU

src/Dijkstra.NET/Dijkstra.NET/Dijkstra.NET.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<language>en-US</language>
1010
<projectUrl>https://github.com/matiii/Dijkstra.NET</projectUrl>
1111
<licenseUrl>https://github.com/matiii/Dijkstra.NET/blob/master/LICENSE</licenseUrl>
12+
<tags>graphs dijkstra bfs</tags>
1213
</metadata>
1314
</package>

0 commit comments

Comments
 (0)