forked from bclnet/ExcelTrans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
115 lines (102 loc) · 2.52 KB
/
premake5.lua
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
if os.ishost "windows" then
-- Windows
newaction
{
trigger = "solution",
description = "Open the ExcelTrans solution",
execute = function ()
os.execute "start ExcelTrans.sln"
end
}
else
-- MacOSX and Linux.
newaction
{
trigger = "solution",
description = "Open the ExcelTrans solution",
execute = function ()
end
}
newaction
{
trigger = "loc",
description = "Count lines of code",
execute = function ()
os.execute "wc -l *.cs"
end
}
end
newaction
{
trigger = "build",
description = "Build ExcelTrans",
execute = function ()
os.execute "dotnet build ExcelTrans/ExcelTrans.csproj --output ../bin"
end
}
newaction
{
trigger = "test",
description = "Build and run all unit tests",
execute = function ()
os.execute "dotnet test ExcelTrans.Tests/ExcelTrans.Tests.csproj"
end
}
newaction
{
trigger = "pack",
description = "Package and run all unit tests",
execute = function ()
os.execute "dotnet pack ExcelTrans/ExcelTrans.csproj --output ../nupkgs --include-source"
end
}
newaction
{
trigger = "publish",
description = "Package and publish nuget package",
execute = function ()
apikey = os.getenv('NUGET_APIKEY_BCLNET')
os.execute "premake5 pack"
os.execute( "dotnet nuget push nupkgs/**/ExcelTrans.*.nupkg --api-key " .. apikey .. " --source https://api.nuget.org/v3/index.json" )
end
}
newaction
{
trigger = "clean",
description = "Clean all build files and output",
execute = function ()
files_to_delete =
{
"*.make",
"*.txt",
"*.zip",
"*.tar.gz",
"*.db",
"*.opendb"
}
directories_to_delete =
{
"obj",
"ipch",
"bin",
"nupkgs",
".vs",
"Debug",
"Release",
"release"
}
for i,v in ipairs( directories_to_delete ) do
os.rmdir( v )
end
if not os.ishost "windows" then
os.execute "find . -name .DS_Store -delete"
for i,v in ipairs( files_to_delete ) do
os.execute( "rm -f " .. v )
end
else
for i,v in ipairs( files_to_delete ) do
os.execute( "del /F /Q " .. v )
end
end
end
}