This repository has been archived by the owner on Oct 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.cake
executable file
·118 lines (93 loc) · 4.89 KB
/
build.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* Creating root source code distribution folder, that
* will later be zipped, after copying of all files is done.
*/
CreateDirectory("./phosphorusfive-8-1");
CreateDirectory("./phosphorusfive-8-1/core");
CreateDirectory("./phosphorusfive-8-1/packages");
CreateDirectory("./phosphorusfive-8-1/plugins");
CreateDirectory("./phosphorusfive-8-1/resources");
CreateDirectory("./phosphorusfive-8-1/samples");
/*
* Copying all source code file.
*
* We copy Hyperlambda files, C# files, and all (relevant) ASP.NET files.
*/
var files = GetFiles ("./*.cake$|*.md$|install.sh$|LICENSE$|*.sln$|README.md$");
CopyFiles (files, "./phosphorusfive-8-1/", true);
files = GetFiles ("./core/**/*.cs$|*.hl$|*.md$|*.aspx$|*.sh$|*.sln$|*.csproj$|*.asax$|*.ico$|*.css$|*.js$|*.html$|*.htm$|*.png$|*.jpg$|*.jpeg$|*.gif$|*.svg$|*.config$|*.webmanifest$|*.xml$|*.ttf$|*.woff$|*.eot$");
CopyFiles (files, "./phosphorusfive-8-1/core/", true);
files = GetFiles ("./packages/**/*.nupkg$|/*.dll$|/*.config$");
CopyFiles (files, "./phosphorusfive-8-1/packages/", true);
files = GetFiles ("./plugins/**/*.cs$|*.md$|*.csproj$|*.config$|*.xml$");
CopyFiles (files, "./phosphorusfive-8-1/plugins/", true);
files = GetFiles ("./resources/**/*.svg$|*.png$|*.xsd$");
CopyFiles (files, "./phosphorusfive-8-1/resources/", true);
files = GetFiles ("samples/**/*.cs$|*.aspx$|*.sln$|*.csproj$|*.asax$|*.css$|*.js$|*.png$|*.jpg$|*.jpeg$|*.gif$|*.svg$|*.master$|*.config$|*.md$");
CopyFiles (files, "phosphorusfive-8-1/samples/", true);
/*
* Deleting "auth.hl" file.
*/
DeleteFile ("./phosphorusfive-8-1/core/p5.webapp/auth.hl");
/*
* Deleting "/db/" folder.
*/
var directoriesToDelete = new DirectoryPath [] { Directory("./phosphorusfive-8-1/core/p5.webapp/db/")};
if (DirectoryExists (directoriesToDelete [0])) {
DeleteDirectories (directoriesToDelete, new DeleteDirectorySettings {Recursive = true, Force = true});
}
/*
* Deleting "common" folder.
*/
directoriesToDelete = new DirectoryPath [] { Directory("./phosphorusfive-8-1/core/p5.webapp/common/")};
DeleteDirectories (directoriesToDelete, new DeleteDirectorySettings {Recursive = true, Force = true});
/*
* Deleting "users" folders.
*/
directoriesToDelete = new DirectoryPath [] { Directory("./phosphorusfive-8-1/core/p5.webapp/users/")};
DeleteDirectories (directoriesToDelete, new DeleteDirectorySettings {Recursive = true, Force = true});
/*
* Then re-creating the "/common/" folder that were removed above.
*
* This is done to avoid copying temporary files, created during usage of system.
*/
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/common/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/common/documents/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/common/documents/private/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/common/documents/public/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/common/temp/");
files = GetFiles ("./core/p5.webapp/common/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/common/");
files = GetFiles ("./core/p5.webapp/common/documents/private/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/common/documents/private/");
files = GetFiles ("./core/p5.webapp/common/documents/public/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/common/documents/public/");
files = GetFiles ("./core/p5.webapp/common/temp/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/common/temp/");
/*
* Then re-creating the "/users/root/" folder that were removed above.
*
* This is done to avoid copying temporary files, created during usage of system.
*/
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/users/root/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/users/root/documents/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/users/root/documents/private/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/users/root/documents/public/");
CreateDirectory ("./phosphorusfive-8-1/core/p5.webapp/users/root/temp/");
files = GetFiles ("./core/p5.webapp/users/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/users/");
files = GetFiles ("./core/p5.webapp/users/root/documents/private/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/users/root/documents/private/");
files = GetFiles ("./core/p5.webapp/users/root/documents/public/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/users/root/documents/public/");
files = GetFiles ("./core/p5.webapp/users/root/temp/README.md");
CopyFiles (files, "./phosphorusfive-8-1/core/p5.webapp/users/root/temp/");
/*
* Zipping folder, to create our actual distribution.
*/
Zip ("./phosphorusfive-8-1", "./Source-Complete-With-Submodules.zip");
/*
* Deleting temporary folder.
*/
directoriesToDelete = new DirectoryPath [] { Directory("./phosphorusfive-8-1/")};
DeleteDirectories (directoriesToDelete, new DeleteDirectorySettings {Recursive = true, Force = true});