Permalink
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (58 sloc) 3 KB
var PROJECT='Gate'
var VERSION='0.18'
var FULL_VERSION='${VERSION}-ctp5'
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.csproj",
SRC + "/**/Gate.Middleware.csproj",
SRC + "/**/Gate.Hosts.Kayak.csproj",
SRC + "/**/Gate.Hosts.Firefly.csproj",
SRC + "/**/Gate.Adapters.Nancy.csproj")}'
var TEST_PROJECTS='${Files.Include(
SRC + "/**/Gate.Tests.csproj",
SRC + "/**/Gate.Middleware.Tests.csproj",
SRC + "/**/Gate.Hosts.Kayak.Tests.csproj")}'
var TEST_ASSEMBLIES='${Files.Include("target/test/**/*.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_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,nunit'
-// 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'
var extra=''
set extra='${extra} -Source ${NUGET_DEPLOY}' if='!string.IsNullOrEmpty(NUGET_DEPLOY)'
nuget-push each='var nupkgFile in Files.Include("target/*.nupkg")'
#release
@{
// To publish, call `build release deploy`
NUGET_DEPLOY = '';
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");
}