Skip to content

Commit 7491b7e

Browse files
committed
Preparing intermediate release for using in build
1 parent fa03fcc commit 7491b7e

File tree

3 files changed

+18
-88
lines changed

3 files changed

+18
-88
lines changed

build.fsx

Lines changed: 3 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if not (System.IO.File.Exists file) then
1010
printfn ""
1111

1212
// xake build file body
13-
//#r @"packages/Xake.Core.dll"
14-
#r @"bin/Debug/Xake.Core.dll"
13+
#r @"packages/Xake.Core.dll"
14+
//#r @"bin/Debug/Xake.Core.dll"
1515

1616
open Xake
1717

@@ -24,7 +24,7 @@ let systemClr cmd args =
2424
let cmd',args' = if Xake.Env.isUnix then "mono", cmd::args else cmd,args
2525
in system cmd' args'
2626

27-
do xake {ExecOptions.Default with FileLog = "build.log"; ConLogLevel = Verbosity.Chatty } {
27+
do xake {XakeOptions with FileLog = "build.log"; ConLogLevel = Verbosity.Chatty } {
2828

2929
rules [
3030
"all" => action {
@@ -34,7 +34,6 @@ do xake {ExecOptions.Default with FileLog = "build.log"; ConLogLevel = Verbosity
3434
}
3535

3636
"build" => (build "Build")
37-
"bin" <== ["bin/XakeLibTests.dll"; "bin/FSharp.Core.dll"]
3837
"clean" => (build "Clean")
3938

4039
"get-deps" => action {
@@ -51,88 +50,6 @@ do xake {ExecOptions.Default with FileLog = "build.log"; ConLogLevel = Verbosity
5150
if exit_code <> 0 then
5251
failwith "Failed to test"
5352
}
54-
55-
("bin/FSharp.Core.dll") *> fun outfile -> action {
56-
do! copyFile @"packages\FSharp.Core\lib\net40\FSharp.Core.dll" outfile.FullName
57-
58-
let targetPath = "bin"
59-
do! copyFiles [@"packages\FSharp.Core\lib\net40\FSharp.Core.*data"] targetPath
60-
}
61-
62-
("bin/nunit.framework.dll") *> fun outfile -> action {
63-
do! copyFile @"packages\NUnit\lib\nunit.framework.dll" outfile.FullName
64-
}
65-
66-
"bin/Xake.Core.dll" *> fun file -> action {
67-
68-
// TODO --doc:..\bin\Xake.Core.XML --- multitarget rule!
69-
70-
let sources = fileset {
71-
basedir "core"
72-
includes "Logging.fs"
73-
includes "Pickler.fs"
74-
includes "Fileset.fs"
75-
includes "Types.fs"
76-
includes "ArtifactUtil.fs"
77-
includes "CommonLib.fs"
78-
includes "Database.fs"
79-
includes "Action.fs"
80-
includes "WorkerPool.fs"
81-
includes "Progress.fs"
82-
includes "XakeScript.fs"
83-
includes "Env.fs"
84-
includes "CommonTasks.fs"
85-
includes "FileTasks.fs"
86-
includes "ResourceFileset.fs"
87-
includes "DotNetFwk.fs"
88-
includes "DotnetTasks.fs"
89-
includes "VersionInfo.fs"
90-
includes "AssemblyInfo.fs"
91-
includes "Program.fs"
92-
}
93-
94-
do! Fsc {
95-
FscSettings with
96-
Out = file
97-
Src = sources
98-
Ref = !! "bin/FSharp.Core.dll"
99-
TargetFramework = "4.0"
100-
RefGlobal = ["System.dll"; "System.Core.dll"; "System.Windows.Forms.dll"]
101-
Define = ["TRACE"]
102-
CommandArgs = ["--optimize+"; "--warn:3"; "--warnaserror:76"; "--utf8output"]
103-
}
104-
105-
}
106-
107-
"bin/XakeLibTests.dll" *> fun file -> action {
108-
109-
// TODO --doc:..\bin\Xake.Core.XML --- multitarget rule!
110-
111-
let sources = fileset {
112-
basedir "XakeLibTests"
113-
includes "ActionTests.fs"
114-
includes "FilesetTests.fs"
115-
includes "ScriptErrorTests.fs"
116-
includes "XakeScriptTests.fs"
117-
includes "MiscTests.fs"
118-
includes "StorageTests.fs"
119-
includes "FileTasksTests.fs"
120-
includes "ProgressTests.fs"
121-
includes "CommandLineTests.fs"
122-
}
123-
124-
do! Fsc {
125-
FscSettings with
126-
Out = file
127-
Src = sources
128-
Ref = !! "bin/FSharp.Core.dll" + "bin/nunit.framework.dll" + "bin/Xake.Core.dll"
129-
TargetFramework = "4.0"
130-
RefGlobal = ["System.dll"; "System.Core.dll"]
131-
Define = ["TRACE"]
132-
CommandArgs = ["--optimize+"; "--warn:3"; "--warnaserror:76"; "--utf8output"]
133-
}
134-
135-
}
13653
]
13754

13855
}

core/FileTasks.fs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@ let rm (names : string list) =
2929
/// <param name="tgt">Target file location and name.</param>
3030
let copyFile (src: string) tgt =
3131
action {
32-
// TODO fail on error, normalize names, accept array/mask
32+
// TODO fail on error, normalize names
3333
do! need [src]
3434
do! trace Level.Info "[copyFile] '%A' -> '%s'" src tgt
3535

3636
File.Copy(src, tgt, true)
37-
}
37+
}
38+
39+
/// <summary>
40+
/// Copies single file.
41+
/// </summary>
42+
[<System.Obsolete("Use copyFile instead. `cp` is reserved for future flexible and powerful solution.")>]
43+
let cp = copyFile
3844

3945
/// <summary>
4046
/// Copies multiple files specified by a mask to another location.
4147
/// </summary>
48+
[<System.Obsolete("Use with caution, the implementation is incomplete")>]
4249
let copyFiles (src: string list) tgt_folder =
4350

4451
// TODO check how should it process dependencies

docs/todo.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
* detect changes in build script (internal changes), e.g. new target added that was not in .xake database
77
* dependencies tracking mode: automatically rebuild when dependency is changed, execute triggers allowing to start/stop the processes which lock/hold artifacts
88

9+
### Tasks
10+
11+
* complete new build script
12+
* gracefully switch to new version (push new code but old build script, provide cp fallback)
13+
* complete copyFiles method
14+
915
### Refactorings
1016
* Artifact -> FileName of string, relative path
1117

0 commit comments

Comments
 (0)