forked from owin/museum-piece-owin-hosting
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Sakefile.shade
66 lines (51 loc) · 2.8 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
var PROJECT='OWIN startup components'
var VERSION='0.6.4'
var FULL_VERSION='${VERSION}'
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 NUGET_DEPLOY='http://www.myget.org/F/gate/'
var BUILD_PROJECTS='${Files.Include("src/main/**/*.csproj")}'
-// 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
#release
@{
// To publish, call `build release deploy`
NUGET_DEPLOY = '';
FULL_VERSION = VERSION;
}
-// override nuget-package to pin OWIN to 1.0
#nuget-package target='package' description='Create NuGet packages'
for each='var file in Files.Include("target/build/**/*.nuspec")'
var baseName='${Path.GetFileNameWithoutExtension(file)}'
var packageVersion='${FULL_VERSION}'
set packageVersion='1.0' if='file.EndsWith("Owin.nuspec")'
nuget-pack nuspecFile='${file}' outputDir='${TARGET_DIR}' extra='-NoPackageAnalysis -Properties "id=${baseName};authors=${AUTHORS}"'
#nuget-deploy target='deploy' description='Upload NuGet packages to gallery'
var extra=''
set extra='${extra} -Source ${NUGET_DEPLOY}' if='!string.IsNullOrEmpty(NUGET_DEPLOY)'
nuget-push each='var nupkgFile in Files.Include("target/*.nupkg")'
#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}'
copy sourceDir='.' include='LICENSE.txt' outputDir='${BUILD_DIR}\${projectName}'
copy sourceDir='.' include='NOTICE.txt' outputDir='${BUILD_DIR}\${projectName}'
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 delegate", "internal delegate")
.Replace("public interface", "internal interface")
.Replace(" /// ", " // ");
}