2016-05-13 13 views
1

Ich versuche, FAKE in einem unserer älteren Projekte zu übernehmen, die TFS2013 als Quellcodeverwaltung und exklusiven Check-out als Check-out-Richtlinie verwendet. Ich habe Ziele für Clean, Build und RunTests definiert, aber ich bleibe bei AssemblyInfo-Target stecken. Ich erhalte die folgende Fehlermeldung (Teile der Fehlermeldung in Deutsch, weil ich über eine Deutsch-Maschine entwickle):Wie verwende ich F # -Make (FAKE), um AssemblyInfo.vb zu überschreiben, wenn TFS mit aktiviertem exklusiven Check-Out verwendet wird?

Running build failed. 
Error: 
System.UnauthorizedAccessException: Der Zugriff auf den Pfad "D:\SourcecodeTFS2013\AD ERP\AD ERP\ERP.PDFUTILITIES\My Project\AssemblyInfo.vb" wurde verweigert. 
    bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
    bei System.IO.FileInfo.Delete() 
    bei Fake.AssemblyInfoFile.writeToFile(String outputFileName, IEnumerable`1 lines) in C:\code\fake\src\app\FakeLib\AssemblyInfoFile.fs:Zeile 134. 
    bei Fake.AssemblyInfoFile.CreateVisualBasicAssemblyInfoWithConfig(String outputFileName, IEnumerable`1 attributes, AssemblyInfoFileConfig config) in C:\code\fake\src\app\FakeLib\AssemblyInfoFile.fs:Zeile 233. 
    bei [email protected](Tuple`4 tupledArg) in D:\SourcecodeTFS2013\AD ERP\AD ERP\build.fsx:Zeile 48. 
    bei Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source) 
    bei [email protected](Unit _arg2) in D:\SourcecodeTFS2013\AD ERP\AD ERP\build.fsx:Zeile 47. 
    bei Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:Zeile 492 

Es scheint, dass dieser Fehler hat mit der exklusiven Check-out-Politik für diese verwendet zu tun Projekt. Aus diesem Grund befindet sich die AssemblyInfo.vb-Datei im schreibgeschützten Modus. Gibt es eine Möglichkeit in FAKE, die AssemblyInfo.vb auszuchecken, bevor die neue erstellt wird?

Hier ist meine "Assembly" -Ziel (aus dem build.fsx Skript des Projekts Forge inspiriert: https://github.com/fsprojects/Forge):

Target "AssemblyInfo" (fun _ -> 
     let getAssemblyInfoAttributes projectName = 
      [ Attribute.Title (projectName) 
      Attribute.Product project 
      Attribute.Description summary 
      Attribute.Company company 
      Attribute.CLSCompliant clsCompliant 
      Attribute.Version release.AssemblyVersion 
      Attribute.FileVersion release.AssemblyVersion ] 

     let getProjectDetails projectPath = 
      let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) 
      (projectPath, 
      projectName, 
      System.IO.Path.GetDirectoryName(projectPath), 
      (getAssemblyInfoAttributes projectName) 
     ) 

     !! "../**/*.vbproj" 
     |> Seq.map getProjectDetails 
     |> Seq.iter (fun (projFileName, projectName, folderName, attributes) -> 
         CreateVisualBasicAssemblyInfo ((folderName @@ "My Project") @@ "AssemblyInfo.vb") attributes 
        ) 
) 

Antwort