Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Commit

Permalink
Add custom tool for packaging as "CLI" package types.
Browse files Browse the repository at this point in the history
Resolves #157
  • Loading branch information
Nate McMaster committed Sep 30, 2016
1 parent 61dc862 commit 3b1f650
Show file tree
Hide file tree
Showing 13 changed files with 427 additions and 67 deletions.
9 changes: 9 additions & 0 deletions DotNetTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Watcher.To
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.Caching.SqlConfig.Tools", "src\Microsoft.Extensions.Caching.SqlConfig.Tools\Microsoft.Extensions.Caching.SqlConfig.Tools.xproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{59E02BDF-98DE-4D64-B576-2D0299D5E052}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NuGetPackager", "tools\NuGetPackager\NuGetPackager.xproj", "{8B781D87-1FC3-4A34-9089-2BDF6B562B85}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -80,6 +84,10 @@ Global
{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Release|Any CPU.Build.0 = Release|Any CPU
{8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -96,5 +104,6 @@ Global
{7B331122-83B1-4F08-A119-DC846959844C} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134}
{8A2E6961-6B12-4A8E-8215-3E7301D52EAC} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134}
{53F3B53D-303A-4DAA-9C38-4F55195FA5B9} = {66517987-2A5A-4330-B130-207039378FD4}
{8B781D87-1FC3-4A34-9089-2BDF6B562B85} = {59E02BDF-98DE-4D64-B576-2D0299D5E052}
EndGlobalSection
EndGlobal
53 changes: 37 additions & 16 deletions NuGetPackageVerifier.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
{
"adx": { // Packages written by the ADX team and that ship on NuGet.org
"rules": [
"AdxVerificationCompositeRule"
],
"packages": {
"Microsoft.DotNet.Watcher.Tools": { },
"Microsoft.Extensions.Caching.SqlConfig.Tools": { },
"Microsoft.Extensions.SecretManager.Tools": { }
}
},
"Default": { // Rules to run for packages not listed in any other set.
"rules": [
"DefaultCompositeRule"
]
}
{
"adx": {
"rules": [
"AdxVerificationCompositeRule"
],
"packages": {
"Microsoft.DotNet.Watcher.Tools": {
"nowarn": {
"DOC_MISSING": {
"lib/netcoreapp1.0/dotnet-watch.dll": "xmldocs not required for DotnetCliTool packages"
}
},
"packageTypes": ["DotnetCliTool"]
},
"Microsoft.Extensions.Caching.SqlConfig.Tools": {
"nowarn": {
"DOC_MISSING": {
"lib/netcoreapp1.0/dotnet-sql-cache.dll": "xmldocs not required for DotnetCliTool packages"
}
},
"packageTypes": ["DotnetCliTool"]
},
"Microsoft.Extensions.SecretManager.Tools": {
"nowarn": {
"DOC_MISSING": {
"lib/netcoreapp1.0/dotnet-user-secrets.dll": "xmldocs not required for DotnetCliTool packages"
}
},
"packageTypes": ["DotnetCliTool"]
}
}
},
"Default": {
"rules": [
"DefaultCompositeRule"
]
}
}
20 changes: 19 additions & 1 deletion makefile.shade
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
use namespace="System.IO"

default BASE_DIR_LOCAL='${Directory.GetCurrentDirectory()}'
default BUILD_DIR_LOCAL='${Path.Combine(BASE_DIR_LOCAL, "artifacts", "build")}'

var VERSION='0.1'
var FULL_VERSION='0.1'
var AUTHORS='Microsoft Open Technologies, Inc.'
-BuildQuality = "preview3";

use-standard-lifecycle
k-standard-goals
k-standard-goals

#build-pack .build-compile target='compile'
@{
if (Directory.Exists("src") && !IsLinux)
{
Directory.CreateDirectory(BUILD_DIR_LOCAL);
Dotnet("run -p tools/NuGetPackager -- -c " + E("Configuration") +
" -o artifacts/build/ "+
"-n src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.nuspec " +
"-n src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.nuspec " +
"-n src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.nuspec ");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.DotNet.Watcher.Tools</id>
<version>$version$</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Command line tool to watch for source file changes during development and restart the dotnet command.</description>
<tags>dotnet,watch</tags>
<serviceable>true</serviceable>
<packageTypes>
<packageType name="DotnetCliTool" />
</packageTypes>
<dependencies>
<group targetFramework=".NETCoreApp1.0">
<dependency id="Microsoft.DotNet.Cli.Utils" version="$dep_1$" />
<dependency id="Microsoft.Extensions.CommandLineUtils" version="$dep_2$" />
<dependency id="Microsoft.Extensions.Logging" version="$dep_3$" />
<dependency id="Microsoft.Extensions.Logging.Console" version="$dep_4$" />
<dependency id="Microsoft.NETCore.App" version="$dep_5$" />
<dependency id="System.Runtime.InteropServices.RuntimeInformation" version="$dep_6$" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin/$configuration$/netcoreapp1.0/dotnet-watch.dll" target="lib\netcoreapp1.0\" />
<file src="bin/$configuration$/netcoreapp1.0/dotnet-watch.runtimeconfig.json" target="lib/netcoreapp1.0\" />
</files>
</package>
23 changes: 8 additions & 15 deletions src/Microsoft.DotNet.Watcher.Tools/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,24 @@
"outputName": "dotnet-watch",
"warningsAsErrors": true,
"emitEntryPoint": true,
"keyFile": "../../tools/Key.snk",
"nowarn": [
"CS1591"
],
"xmlDoc": true
"keyFile": "../../tools/Key.snk"
},
"dependencies": {
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0",
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
"Microsoft.Extensions.Logging": "1.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.1.0-*",
"Microsoft.Extensions.Process.Sources": {
"type": "build",
"version": "1.1.0-*"
}
},
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
"netcoreapp1.0": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.Extensions.Caching.SqlConfig.Tools</id>
<version>$version$</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching.</description>
<tags>cache,distributedcache,sqlserver</tags>
<serviceable>true</serviceable>
<packageTypes>
<packageType name="DotnetCliTool" />
</packageTypes>
<dependencies>
<group targetFramework=".NETCoreApp1.0">
<dependency id="Microsoft.Extensions.CommandLineUtils" version="$dep_1$" />
<dependency id="Microsoft.Extensions.Logging" version="$dep_2$" />
<dependency id="Microsoft.Extensions.Logging.Console" version="$dep_3$" />
<dependency id="Microsoft.NETCore.App" version="$dep_4$" />
<dependency id="System.Data.SqlClient" version="$dep_5$" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin/$configuration$/netcoreapp1.0/dotnet-sql-cache.dll" target="lib\netcoreapp1.0\" />
<file src="bin/$configuration$/netcoreapp1.0/dotnet-sql-cache.runtimeconfig.json" target="lib\netcoreapp1.0\" />
</files>
</package>
37 changes: 15 additions & 22 deletions src/Microsoft.Extensions.Caching.SqlConfig.Tools/project.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
"Microsoft.Extensions.Logging": "1.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.1.0-*",
"System.Data.SqlClient": "4.1.0-*"
},
"description": "Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching.",
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}
}
},
"buildOptions": {
"outputName": "dotnet-sql-cache",
"emitEntryPoint": true,
"warningsAsErrors": true,
"keyFile": "../../tools/Key.snk",
"nowarn": [
"CS1591"
],
"xmlDoc": true
"keyFile": "../../tools/Key.snk"
},
"description": "Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching.",
"packOptions": {
"repository": {
"type": "git",
Expand All @@ -37,5 +17,18 @@
"distributedcache",
"sqlserver"
]
},
"dependencies": {
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
"Microsoft.Extensions.Logging": "1.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.1.0-*",
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"System.Data.SqlClient": "4.1.0-*"
},
"frameworks": {
"netcoreapp1.0": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- TODO use first-class tooling when this becomes available -->
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.Extensions.SecretManager.Tools</id>
<version>$version$</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Command line tool to manage user secrets for Microsoft.Extensions.Configuration.</description>
<tags>configuration,secrets,usersecrets</tags>
<serviceable>true</serviceable>
<packageTypes>
<packageType name="DotnetCliTool" />
</packageTypes>
<dependencies>
<group targetFramework=".NETCoreApp1.0">
<!-- MUST BE alphabetical -->
<dependency id="Microsoft.Extensions.Configuration.UserSecrets" version="$dep_1$" />
<dependency id="Microsoft.Extensions.CommandLineUtils" version="$dep_2$" />
<dependency id="Microsoft.Extensions.Logging" version="$dep_3$" />
<dependency id="Microsoft.NETCore.App" version="$dep_4$" />
<dependency id="Newtonsoft.Json" version="$dep_5$" />
<dependency id="System.Runtime.InteropServices.RuntimeInformation" version="$dep_6$" />
<dependency id="System.Runtime.Serialization.Primitives" version="$dep_7$" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin/$configuration$/netcoreapp1.0/dotnet-user-secrets.dll" target="lib\netcoreapp1.0\" />
<file src="bin/$configuration$/netcoreapp1.0/dotnet-user-secrets.runtimeconfig.json" target="lib/netcoreapp1.0\" />
</files>
</package>
19 changes: 6 additions & 13 deletions src/Microsoft.Extensions.SecretManager.Tools/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"outputName": "dotnet-user-secrets",
"emitEntryPoint": true,
"warningsAsErrors": true,
"keyFile": "../../tools/Key.snk",
"nowarn": [
"CS1591"
],
"xmlDoc": true
"keyFile": "../../tools/Key.snk"
},
"description": "Command line tool to manage user secrets for Microsoft.Extensions.Configuration.",
"packOptions": {
Expand All @@ -26,18 +22,15 @@
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.0-*",
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
"Microsoft.Extensions.Logging": "1.1.0-*",
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Newtonsoft.Json": "9.0.1",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0",
"System.Runtime.Serialization.Primitives": "4.1.1"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
"netcoreapp1.0": {}
}
}
19 changes: 19 additions & 0 deletions tools/NuGetPackager/NuGetPackager.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>8b781d87-1fc3-4a34-9089-2bdf6b562b85</ProjectGuid>
<RootNamespace>NuGetPackager</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Loading

0 comments on commit 3b1f650

Please sign in to comment.