Skip to content

Commit

Permalink
add workaround for incompatible targets (and update targets file)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed Nov 11, 2018
1 parent 86c2ff1 commit 2ffa4b7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 26 deletions.
33 changes: 22 additions & 11 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
<PaketBootstrapperStyle>classic</PaketBootstrapperStyle>
<PaketBootstrapperStyle Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">proj</PaketBootstrapperStyle>
<PaketExeImage>assembly</PaketExeImage>
<PaketExeImage Condition=" '$(PaketBootstrapperStyle)' == 'proj' ">native</PaketExeImage>
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketToolsPath)paket')">$(PaketToolsPath)paket</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>

<!-- .net core fdd -->
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'assembly' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'native' ">$(PaketToolsPath)paket</PaketExePath>

<!-- no extension is a shell script -->
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
<!-- Paket command -->
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT'">"$(PaketExePath)"</PaketCommand>

<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
Expand All @@ -38,7 +44,11 @@
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
</PropertyGroup>

<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
<MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" />
</Target>

<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping">

<!-- Step 1 Check if lockfile is properly restored -->
<PropertyGroup>
Expand Down Expand Up @@ -77,7 +87,7 @@
</PropertyGroup>

<!-- Do a global restore if required -->
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />

<!-- Step 2 Detect project specific changes -->
Expand Down Expand Up @@ -144,11 +154,12 @@
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
<CopyLocal>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
</PackageReference>
</ItemGroup>
Expand Down
16 changes: 14 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Release Notes

## 5.10.1-alpha - tbd
## 5.10.1 - 2018-11-11

* tbd
* DOCUMENTATION: New homepage design for fake.build, huge thanks to @FlorianBaderDE (with help from @JarnoNijboer) - https://github.com/fsharp/FAKE/pull/2164 https://github.com/fsharp/FAKE/pull/2175 https://github.com/fsharp/FAKE/pull/2178 https://github.com/fsharp/FAKE/pull/2179
* ICON: Fake has a new icon (again huge thanks to @FlorianBaderDE)
* NEW: Add tab-completion for powershell and bash - https://github.com/fsharp/FAKE/pull/2157
* NEW: module `Fake.DotNet.FxCop` - https://github.com/fsharp/FAKE/pull/2174
* ENHANCEMENT: add new ReportType "Cobertura" to `Fake.Testing.ReportGenerator` - https://github.com/fsharp/FAKE/pull/2163
* ENHANCEMENT: the fake template now supports the buildtask-dsl - https://github.com/fsharp/FAKE/pull/2177
* ENHANCEMENT: add new fake hints for https://github.com/fsharp/FAKE/issues/2097, https://github.com/fsharp/FAKE/issues/2099 and https://github.com/fsharp/FAKE/issues/2181
* BUGFIX: Dispose streams created by File.create - https://github.com/fsharp/FAKE/pull/2184/files
* BUGFIX: NuGet.Version.getLastNuGetVersion failed for some servers - https://github.com/fsharp/FAKE/pull/2170
* BUGFIX: Fake.DotNet.Tesing.NUnit failed to work when temporary-directory contains spaces (for example if windows username contains spaces) - https://github.com/fsharp/FAKE/pull/2180
* BUGFIX: `--silent` now disables fake hints as well
* (Minor) BREAKING: Refactor & cleanup `Fake.Runtime` internals - make sure to open an issue if you are hit by this.
* OTHER: Internal code cleanup - https://github.com/fsharp/FAKE/pull/2162

## 5.10.0 - 2018-11-11

Expand Down
35 changes: 22 additions & 13 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,32 @@ Target.create "WorkaroundPaketNuspecBug" (fun _ ->
|> File.deleteAll
)

let callpaket wd args =
if 0 <> Process.execSimple (fun info ->
{ info with
FileName = wd </> ".paket/paket.exe"
WorkingDirectory = wd
Arguments = args }
|> Process.withFramework
) (System.TimeSpan.FromMinutes 5.0) then
failwith "paket failed to start"

// Targets
Target.create "Clean" (fun _ ->
!! "src/*/*/bin"
//++ "src/*/*/obj"
|> Shell.cleanDirs

let fakeRuntimeVersion = typeof<Fake.Core.Context.FakeExecutionContext>.Assembly.GetName().Version
printfn "fake runtime %O" fakeRuntimeVersion
if fakeRuntimeVersion < new System.Version(5, 10, 0) then
printfn "deleting obj directories because of https://github.com/fsprojects/Paket/issues/3404"
!! "src/*/*/obj"
|> Shell.cleanDirs
// Allow paket to do a full-restore (to improve performance)
Shell.rm ("paket-files" </> "paket.restore.cached")
callpaket "." "restore"

Shell.cleanDirs [buildDir; testDir; docsDir; apidocsDir; nugetDncDir; nugetLegacyDir; reportDir]

// Clean Data for tests
Expand Down Expand Up @@ -301,16 +321,6 @@ Target.create "SetAssemblyInfo" (fun _ ->
()
)

let callpaket wd args =
if 0 <> Process.execSimple (fun info ->
{ info with
FileName = wd </> ".paket/paket.exe"
WorkingDirectory = wd
Arguments = args }
|> Process.withFramework
) (System.TimeSpan.FromMinutes 5.0) then
failwith "paket failed to start"

Target.create "StartBootstrapBuild" (fun _ ->
// Prepare stuff
let token = githubtoken.Value
Expand Down Expand Up @@ -352,12 +362,11 @@ Target.create "StartBootstrapBuild" (fun _ ->
let startTime = System.Diagnostics.Stopwatch.StartNew()
let maxTime = System.TimeSpan.FromMinutes 60.0
let formatState (state:Octokit.CommitStatus) =
sprintf "{ State: %O, TargetUrl: %O, Description: %O, Context: %O, Url: %O }"
state.State state.TargetUrl state.Description state.Context state.Url
sprintf "{ State: %O, Description: %O, TargetUrl: %O }"
state.State state.Description state.TargetUrl
let result =
async {
let! client = GitHub.createClientWithToken token
//let obsClient = ObservableRepositoriesClient(client)
let mutable whileResult = None
while startTime.Elapsed < maxTime && whileResult.IsNone do
let! combStatus = client.Repository.Status.GetCombined(github_release_user, gitName, sha) |> Async.AwaitTask
Expand Down

0 comments on commit 2ffa4b7

Please sign in to comment.