Browse Source

Added nuget package creation scripts and removed dependencies

master
Teknikode 3 years ago
parent
commit
d4dc45a24c

+ 54
- 0
Build-Package.cmd View File

@@ -0,0 +1,54 @@
@echo off
pushd %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION

call Build-Release.cmd

: loop thru nuspec files and build the packages
for /R %%v in (*.nuspec) do (
set file=%%~npv.csproj
CALL :mkrel file
: build each package (use relative path name)
tools\nuget pack !file! -symbols -Properties Configuration=Release || goto fail
)

REM move *.nupkg ..\repo || goto fail

goto fin

:fail
echo ERROR!
echo EXITING...

goto fin
:mkrel
:MakeRelative file base -- makes a file name relative to a base path
:: -- file [in,out] - variable with file name to be converted, or file name itself for result in stdout
:: -- base [in,opt] - base path, leave blank for current directory
:$created 20060101 :$changed 20080219 :$categories Path
:$source http://www.dostips.com
SETLOCAL ENABLEDELAYEDEXPANSION
set src=%~1
if defined %1 set src=!%~1!
set bas=%~2
if not defined bas set bas=%cd%
for /f "tokens=*" %%a in ("%src%") do set src=%%~fa
for /f "tokens=*" %%a in ("%bas%") do set bas=%%~fa
set mat=&rem variable to store matching part of the name
set upp=&rem variable to reference a parent
for /f "tokens=*" %%a in ('echo.%bas:\=^&echo.%') do (
set sub=!sub!%%a\
call set tmp=%%src:!sub!=%%
if "!tmp!" NEQ "!src!" (set mat=!sub!)ELSE (set upp=!upp!..\)
)
set src=%upp%!src:%mat%=!
( ENDLOCAL & REM RETURN VALUES
IF defined %1 (SET %~1=%src%) ELSE ECHO.%src%
)
EXIT /b


:fin
popd


+ 14
- 0
Build-Release.cmd View File

@@ -0,0 +1,14 @@
@echo off
pushd %~dp0

: Update Version.txt file
PowerShell "$versionFile = Get-Content -Path version.txt ; $version = [version]($versionFile) ; $newVersion = New-Object -TypeName System.Version -ArgumentList $version.Major, $version.Minor, $version.Build, ($version.Revision + 1) ; $newVersion | Set-Content -Path version.txt"

: Grab version from text file
set /p VERSION_ASSEMBLY=<version.txt

: Build everything, passing the version number
"C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe" /t:Rebuild /p:Configuration=Release;VersionAssembly=%VERSION_ASSEMBLY%

popd


+ 0
- 10
IRCSharp/IRCSharp.csproj View File

@@ -89,17 +89,7 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\GitVersionTask.3.6.3\build\dotnet\GitVersionTask.targets" Condition="Exists('..\packages\GitVersionTask.3.6.3\build\dotnet\GitVersionTask.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\GitVersionTask.3.6.3\build\dotnet\GitVersionTask.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GitVersionTask.3.6.3\build\dotnet\GitVersionTask.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

+ 2
- 0
IRCSharp/Properties/AssemblyInfo.cs View File

@@ -21,6 +21,8 @@ using System.Runtime.InteropServices;

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c1897794-5242-47cf-a87f-8e76e226869a")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

// Version information for an assembly consists of the following four values:
//

+ 17
- 0
IRCSharp/ircsharp.nuspec View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-16"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>IRCSharp</id>
<version>$version$</version>
<title>IRCSharp</title>
<authors>Uncled1023</authors>
<owners>Uncled1023</owners>
<licenseUrl>https://git.teknik.io/Uncled1023/IRCSharp/src/master/LICENSE</licenseUrl>
<projectUrl>https://git.teknik.io/Uncled1023/IRCSharp</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A full fledged IRC library written in C#. Allows connecting to a server and sending commands and receiving messages through a simple event driven system.</description>
<summary>A c# library for interacting with an IRC server</summary>
<language />
<releaseNotes>Removed Dependencies</releaseNotes>
</metadata>
</package>

+ 0
- 4
IRCSharp/packages.config View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GitVersionTask" version="3.6.3" targetFramework="net451" developmentDependency="true" />
</packages>

BIN
tools/nuget.exe View File


+ 1
- 0
version.txt View File

@@ -0,0 +1 @@
1.0.0.1

Loading…
Cancel
Save