-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from conube/fluent-mapping
Fluent mapping and scripts to build & publish to nuget
- Loading branch information
Showing
24 changed files
with
2,431 additions
and
773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
powershell -NoProfile -Command "& {Import-Module BitsTransfer; Import-Module .\libs\psake.psm1; Invoke-psake .\build.ps1 -framework 4.0x64}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
properties { | ||
|
||
# NuGet Publish | ||
$nuget_publish = $false | ||
|
||
## NuGet API Key | ||
$nuget_apiKey = "00000000-0000-0000-0000-000000000000" | ||
|
||
## NuGet Source URL | ||
$nuget_source = "https://www.nuget.org/api/v2/" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
include libs\psake_ext.ps1 | ||
|
||
properties { | ||
## NuGet ID for the package | ||
$nuget_id = "WindowsAzure.StorageExtensions" | ||
|
||
## NuGet Source URL | ||
$nuget_source = "https://www.nuget.org/api/v2/" | ||
|
||
## Version info | ||
$majorVersion = 0 | ||
$minorVersion = 8 | ||
|
||
## Path location for the project file. | ||
$projectPath = "WindowsAzure\WindowsAzure.csproj" | ||
|
||
## Path location for the VersionAssemblyInfo.cs file. | ||
$versionAssemblyPath = "WindowsAzure\Properties\VersionAssemblyInfo.cs" | ||
|
||
## Select with Version Control System the build should use. | ||
## Use: 'git' or 'hg' for mercurial. | ||
$versionControlSystem = "git" | ||
|
||
## Sources directory will be the 'src' folder | ||
## on the same level of the 'build' folder. | ||
## Changing this to a wrong folder can brick the build script. | ||
$base_directory = resolve-path "..\." | ||
$source_directory = "$base_directory\src" | ||
$nuget_directory = "$base_directory\builds" | ||
} | ||
|
||
include libs\core_build.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
formatTaskName "-------------------------------- {0} --------------------------------" | ||
|
||
# includes the NuGet API Key file. | ||
include build.properties.ps1 | ||
|
||
properties { | ||
## After compiling and publishing the package | ||
## the build script commits and tags it using the $logTitle variable. | ||
## Example of commit message "BUILD: New version of $logTitle" | ||
## Example of tag "$logTitle-v$commitVersion" | ||
$logTitle = $nuget_id | ||
|
||
$nuget_symbolsPack = $true | ||
|
||
# git version | ||
if ($versionControlSystem -eq "git") { | ||
$revisionNumber = exec { git rev-list --count HEAD } | ||
} | ||
# mercurial version | ||
if ($versionControlSystem -eq "hg") { | ||
$revisionNumber = exec { hg identify -n } | ||
} | ||
|
||
## Do Not Change | ||
$buildVersion = $revisionNumber.Replace("+", "") | ||
$version = "$majorVersion.$minorVersion.$buildVersion" | ||
$fileVersion = $version | ||
$commitVersion = "$majorVersion.$minorVersion.$buildVersion" | ||
$nuget_packPath = "$nuget_directory\$nuget_id.$version.nupkg" | ||
$nuget_packSymbolsPath = "$nuget_directory\$nuget_id.$version.symbols.nupkg" | ||
$build_directory = "$nuget_directory\$version" | ||
$build_assemblyPath = "$source_directory\$versionAssemblyPath" | ||
$build_appPath = "$source_directory\$projectPath" | ||
} | ||
|
||
# | ||
# default task, this task starts the build | ||
# | ||
task default -depends NuGet_Publish, CommitAndTag | ||
|
||
task Clean { | ||
Remove-Item $build_directory -Force -Recurse -ErrorAction SilentlyContinue | ||
} | ||
|
||
task Compile -depends Clean { | ||
|
||
## Create Version Assembly Info | ||
Generate-Version-Assembly-Info ` | ||
-file $build_assemblyPath ` | ||
-version $version ` | ||
-fileVersion $fileVersion | ||
|
||
if ((Test-Path $build_directory) -eq $false) { | ||
New-Item $build_directory -ItemType Directory | Out-Null | ||
} | ||
} | ||
|
||
task NuGet_Pack -depends Compile { | ||
|
||
# if we want to pack the symbols too. | ||
if ($nuget_symbolsPack) { | ||
exec { nuget pack $build_appPath -Symbols -Build -Properties "Configuration=Release;Platform=AnyCPU" -Version $version -OutputDirectory $nuget_directory } | ||
} | ||
else { | ||
exec { nuget pack $build_appPath -Build -Properties "Configuration=Release;Platform=AnyCPU" -Version $version -OutputDirectory $nuget_directory } | ||
} | ||
|
||
} | ||
|
||
task NuGet_Publish -depends NuGet_Pack { | ||
|
||
if ($nuget_publish) { | ||
Remove-Item $build_directory -Force -Recurse -ErrorAction SilentlyContinue | ||
|
||
# push the package with assmblies. | ||
exec { nuget push $nuget_packPath -ApiKey $nuget_apiKey -Source $nuget_source } | ||
|
||
# if there are symbols push them too. | ||
if ($nuget_symbolsPack) { | ||
Write-Host "Push Symbols" | ||
exec { nuget push $nuget_packSymbolsPath -ApiKey $nuget_apiKey -Source $nuget_source } | ||
} | ||
} | ||
|
||
} | ||
|
||
task CommitAndTag { | ||
|
||
if ($nuget_publish) { | ||
if ($versionControlSystem -eq "git") { | ||
exec { git commit -a -m "BUILD: New version of $logTitle" } | ||
exec { git tag "$logTitle-v$commitVersion" } | ||
} | ||
if ($versionControlSystem -eq "hg") { | ||
exec { hg commit -m "BUILD: New version of $logTitle" } | ||
exec { hg tag "$logTitle-v$commitVersion" } | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.