Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Build nupkg with NuProj
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Oct 8, 2016
1 parent 2f59f6f commit 9e59344
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 187 deletions.
27 changes: 0 additions & 27 deletions deployment/Chocolatey/template/GitHubLink/GitHubLink.nuspec

This file was deleted.

21 changes: 0 additions & 21 deletions deployment/Chocolatey/template/GitHubLink/tools/LICENSE.txt

This file was deleted.

24 changes: 0 additions & 24 deletions deployment/Chocolatey/template/GitLink/GitLink.nuspec

This file was deleted.

21 changes: 0 additions & 21 deletions deployment/Chocolatey/template/GitLink/tools/LICENSE.txt

This file was deleted.

Binary file removed deployment/FinalBuilder/GitLink.CreatePackages.fbp7
Binary file not shown.
28 changes: 0 additions & 28 deletions deployment/NuGet/template/GitHubLink/GitHubLink.nuspec

This file was deleted.

25 changes: 0 additions & 25 deletions deployment/NuGet/template/GitLink/GitLink.nuspec

This file was deleted.

11 changes: 0 additions & 11 deletions deployment/NuGet/template/GitLinkTask/Build/dotnet/GitLink.targets

This file was deleted.

25 changes: 0 additions & 25 deletions deployment/NuGet/template/GitLinkTask/GitLinkTask.nuspec

This file was deleted.

1 change: 1 addition & 0 deletions init.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell.exe -ExecutionPolicy bypass -Command "& '%~dpn0.ps1'" %*
33 changes: 33 additions & 0 deletions init.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<#
.SYNOPSIS
Restores NuGet packages.
#>
Param(
)

Push-Location $PSScriptRoot
try {
$HeaderColor = 'Green'
$toolsPath = "$PSScriptRoot\tools"
$nugetVerbosity = 'quiet'
if ($Verbose) { $nugetVerbosity = 'normal' }

# First restore NuProj packages since the solution restore depends on NuProj evaluation succeeding.
gci "$PSScriptRoot\src\project.json" -rec |? { $_.FullName -imatch 'nuget' } |% {
& "$toolsPath\Restore-NuGetPackages.ps1" -Path $_ -Verbosity $nugetVerbosity
}

# Restore VS solution dependencies
gci "$PSScriptRoot\src" -rec |? { $_.FullName.EndsWith('.sln') } |% {
& "$toolsPath\Restore-NuGetPackages.ps1" -Path $_.FullName -Verbosity $nugetVerbosity
}

Write-Host "Successfully restored all dependencies" -ForegroundColor Yellow
}
catch {
Write-Error "Aborting script due to error"
exit $lastexitcode
}
finally {
Pop-Location
}
5 changes: 0 additions & 5 deletions lib/repositories.config

This file was deleted.

44 changes: 44 additions & 0 deletions src/GitLink.NuGet/GitLink.NuGet.nuproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>29e78909-b7fb-472c-a9a0-1749a8be9a9a</ProjectGuid>
</PropertyGroup>
<PropertyGroup>
<NuProjPath>$(UserProfile)\.nuget\packages\NuProj\0.11.14-beta\tools</NuProjPath>
</PropertyGroup>
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
<PropertyGroup Label="Configuration">
<Id>GitLink</Id>
<Title>GitLink</Title>
<Authors>GeertvanHorrik</Authors>
<Owners>GeertvanHorrik</Owners>
<Summary>GitLink.NuGet</Summary>
<Description> GitLink let's users step through your code hosted on any Git hosting service! This makes symbol servers obsolete which saves you both time </Description>
<ReleaseNotes>
</ReleaseNotes>
<ProjectUrl>https://github.com/GitTools/GitLink</ProjectUrl>
<LicenseUrl>https://github.com/GitTools/GitLink/blob/develop/LICENSE</LicenseUrl>
<Tags>GitLink.NuGet</Tags>
<DevelopmentDependency>true</DevelopmentDependency>
<IconUrl>https://raw.githubusercontent.com/GitTools/GitLink/develop/design/logo/logo_64.png</IconUrl>
</PropertyGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitLink\GitLink.csproj">
<PackageDirectory>Tools</PackageDirectory>
</ProjectReference>
</ItemGroup>
<Import Project="$(NuProjPath)\NuProj.targets" />
</Project>
19 changes: 19 additions & 0 deletions src/GitLink.NuGet/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"dependencies": {
"ReadOnlySourceTree": {
"version": "0.1.37-beta",
"suppressParent": "none"
},
"Nerdbank.GitVersioning": {
"version": "1.5.46",
"suppressParent": "none"
},
"NuProj": "0.11.14-beta"
},
"frameworks": {
"net451": {}
},
"runtimes": {
"win": {}
}
}
6 changes: 6 additions & 0 deletions src/GitLink.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
version.json = version.json
EndProjectSection
EndProject
Project("{FF286327-C783-4F7A-AB73-9BCBAD0D4460}") = "GitLink.NuGet", "GitLink.NuGet\GitLink.NuGet.nuproj", "{29E78909-B7FB-472C-A9A0-1749A8BE9A9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -34,6 +36,10 @@ Global
{38BFDD5A-8CC2-43B8-96CE-BC572E3DFEF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38BFDD5A-8CC2-43B8-96CE-BC572E3DFEF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38BFDD5A-8CC2-43B8-96CE-BC572E3DFEF5}.Release|Any CPU.Build.0 = Release|Any CPU
{29E78909-B7FB-472C-A9A0-1749A8BE9A9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29E78909-B7FB-472C-A9A0-1749A8BE9A9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29E78909-B7FB-472C-A9A0-1749A8BE9A9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29E78909-B7FB-472C-A9A0-1749A8BE9A9A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
15 changes: 15 additions & 0 deletions tools/Get-NuGetTool.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<#
.SYNOPSIS
Downloads the NuGet.exe tool and returns the path to it.
#>

$binaryToolsPath = "$PSScriptRoot\..\obj\tools"
if (!(Test-Path $binaryToolsPath)) { $null = mkdir $binaryToolsPath }
$nugetPath = "$binaryToolsPath\nuget.exe"
if (!(Test-Path $nugetPath)) {
$NuGetVersion = "3.4.4"
Write-Host "Downloading nuget.exe $NuGetVersion..." -ForegroundColor Yellow
Invoke-WebRequest -Uri "https://dist.nuget.org/win-x86-commandline/v$NuGetVersion/NuGet.exe" -OutFile $nugetPath
}

$nugetPath
41 changes: 41 additions & 0 deletions tools/Install-NuGetPackage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<#
.SYNOPSIS
Installs a NuGet package.
.PARAMETER PackageID
The Package ID to install.
.PARAMETER Version
The version of the package to install. If unspecified, the latest stable release is installed.
.PARAMETER Source
The package source feed to find the package to install from.
.PARAMETER PackagesDir
The directory to install the package to. By default, it uses the Packages folder at the root of the repo.
#>
Param(
[Parameter(Position=1,Mandatory=$true)]
[string]$PackageId,
[Parameter()]
[string]$Version,
[Parameter()]
[string]$Source,
[Parameter()]
[switch]$Prerelease,
[Parameter()]
[ValidateSet('Quiet','Normal','Detailed')]
[string]$Verbosity='normal'
)

$nugetPath = & "$PSScriptRoot\Get-NuGetTool.ps1"

try {
Write-Verbose "Installing $PackageId..."
$args = "Install",$PackageId
if ($Version) { $args += "-Version",$Version }
if ($Source) { $args += "-Source",$Source }
if ($Prerelease) { $args += "-Prerelease" }
$args += '-Verbosity',$Verbosity

$p = Start-Process $nugetPath $args -NoNewWindow -Wait -PassThru
if ($p.ExitCode -ne 0) { throw }
} finally {
Pop-Location
}
Loading

0 comments on commit 9e59344

Please sign in to comment.