forked from loudej/gate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSakefile.shade
70 lines (51 loc) · 2.83 KB
/
Sakefile.shade
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
var PROJECT='Gate'
var VERSION='0.9'
var FULL_VERSION='${VERSION}-ctp3'
var AUTHORS='${PROJECT} contributors'
var BASE_DIR='${Directory.GetCurrentDirectory()}'
var TARGET_DIR='${Path.Combine(BASE_DIR, "target")}'
var BUILD_DIR='${Path.Combine(TARGET_DIR, "build")}'
var TEST_DIR='${Path.Combine(TARGET_DIR, "test")}'
var SRC='src'
var BUILD_PROJECTS='${Files.Include(
SRC + "/**/Gate.Builder.csproj",
SRC + "/**/Gate.csproj",
SRC + "/**/Gate.Adapters.Nancy.csproj")}'
var TEST_PROJECTS='${Files.Include(SRC + "/**/Gate.Builder.Tests.csproj")}'
var TEST_ASSEMBLIES='${Files.Include("target/test/**/*.Tests.dll").Exclude("target/test/**/HttpListener.Tests.dll")}'
var NUGET_GALLERY_SOURCE='https://nuget.org/api/v2/'
var NUGET_ASPNET_SOURCE='http://www.myget.org/F/aspnetwebstacknightly/'
var NUGET_OWIN_SOURCE='http://www.myget.org/F/gate/'
var NUGET_GATE_DEPLOY='http://www.myget.org/F/gate/'
var BUILD_NUMBER='${Environment.GetEnvironmentVariable("BUILD_NUMBER")}'
set FULL_VERSION='${FULL_VERSION}-build${BUILD_NUMBER.PadLeft(4, (char)'0')}' if='!string.IsNullOrEmpty(BUILD_NUMBER)'
-// include range of standard general targets. run "sake targets" to display
use-standard-lifecycle
-// include sets of standard work targets. features include 'nuget,xunit,nunit'
use-standard-goals features='nuget,xunit'
-// additional work targets are defined below
#nuget-initialize target='initialize'
nuget-install each='var package in Files.Include("src/**/packages.config")' outputDir='packages' extra='-Source ${NUGET_GALLERY_SOURCE};${NUGET_ASPNET_SOURCE};${NUGET_OWIN_SOURCE}'
#nuget-deploy target='deploy' description='Upload NuGet packages to gallery'
nuget-push each='var nupkgFile in Files.Include("target/*.nupkg")' extra='-Source ${NUGET_GATE_DEPLOY}'
#release
@{
// To publish, call `build release deploy`
NUGET_GATE_DEPLOY = 'https://nuget.org/api/v2/';
FULL_VERSION = VERSION;
}
#sources-package-prepare target='package-prepare'
for each='var file in Files.Include("src/**/*.Sources.nuspec")'
var projectDir='${Path.GetDirectoryName(file)}'
var projectName='${Path.GetFileName(projectDir)}'
copy sourceDir='${projectDir}' include='**/*.cs' exclude='**/App_Packages/**/*' outputDir='${BUILD_DIR}\${projectName}' overwrite='${true}'
for each='var deleteFile in Files.Include(BUILD_DIR + "/" + projectName + "/**/AssemblyInfo.cs")' -File.Delete(deleteFile);
update-file each='var updateFile in Files.Include(BUILD_DIR + "/" + projectName + "/**/*.cs")'
@{
updateText = updateText
.Replace("public static partial class", "internal static partial class")
.Replace("public static class", "internal static class")
.Replace("public class", "internal class")
.Replace("public enum", "internal enum")
.Replace("public interface", "internal interface");
}