Browse Source

Add common project, make nuget

Dalibor Votruba 6 years ago
parent
commit
d88594ecf0

+ 52 - 0
Common/Common.csproj

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{6D9348FB-8C3D-4DFD-949B-414FC6BF2A22}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Quadarax.Foundation.Common</RootNamespace>
+    <AssemblyName>QDR.FND.Common</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Extensions\XmlReaderExt.cs" />
+    <Compile Include="Extensions\XPathNavigatorExt.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Helpers\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 25 - 0
Common/Common.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.902
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common.csproj", "{6D9348FB-8C3D-4DFD-949B-414FC6BF2A22}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{6D9348FB-8C3D-4DFD-949B-414FC6BF2A22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6D9348FB-8C3D-4DFD-949B-414FC6BF2A22}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6D9348FB-8C3D-4DFD-949B-414FC6BF2A22}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6D9348FB-8C3D-4DFD-949B-414FC6BF2A22}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {DE6B56BB-FC58-49A1-A966-6F737C3411E7}
+	EndGlobalSection
+EndGlobal

+ 22 - 0
Common/Extensions/XPathNavigatorExt.cs

@@ -0,0 +1,22 @@
+using System;
+using System.ComponentModel;
+using System.Xml.XPath;
+
+namespace Common.Extensions
+{
+    public static class XPathNavigatorExt
+    {
+        public static T GetAttribute<T>(this XPathNavigator oNavigator, string sAttributeName, bool bMandatory, T oDefaultValue)
+        {
+            if (string.IsNullOrEmpty(oNavigator.GetAttribute(sAttributeName, "")))
+            {
+                if (bMandatory)
+                    throw new Exception(
+                        $"Missing mandatory attribute '{sAttributeName}' in element '{oNavigator.Name}'");
+                return oDefaultValue;
+            }
+            return (T) TypeDescriptor.GetConverter(typeof(T)).ConvertFromString(oNavigator.GetAttribute(sAttributeName, ""));
+        }
+       
+    }
+}

+ 25 - 0
Common/Extensions/XmlReaderExt.cs

@@ -0,0 +1,25 @@
+using System;
+using System.ComponentModel;
+using System.Xml;
+
+namespace Common.Extensions
+{
+    public static class XmlReaderExt
+    {
+        public static T GetAttribute<T>(this XmlReader oNavigator, string sAttributeName, bool bMandatory, T oDefaultValue)
+        {
+            return (T) GetAttribute(oNavigator, typeof(T),sAttributeName,bMandatory,oDefaultValue);
+        }
+        public static object GetAttribute(this XmlReader oNavigator, Type oType, string sAttributeName, bool bMandatory, object oDefaultValue)
+        {
+            if (string.IsNullOrEmpty(oNavigator.GetAttribute(sAttributeName, "")))
+            {
+                if (bMandatory)
+                    throw new Exception(
+                        $"Missing mandatory attribute '{sAttributeName}' in element '{oNavigator.Name}'");
+                return oDefaultValue;
+            }
+            return TypeDescriptor.GetConverter(oType).ConvertFromString(oNavigator.GetAttribute(sAttributeName, ""));
+        }
+    }
+}

+ 36 - 0
Common/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("QDR.FND.Common")]
+[assembly: AssemblyDescription("Common - simple patterns and extensions (part of Quadarax.Foundation)")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Quadarax")]
+[assembly: AssemblyProduct("Quadarax.Foundation")]
+[assembly: AssemblyCopyright("Copyright © Quadarax 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6d9348fb-8c3d-4dfd-949b-414fc6bf2a22")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 25 - 0
Common/QDR.FND.Common.nuspec

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<package>
+  <metadata>
+    <id>Quadarax.Foundation.Common</id>
+    <version>1.0.0.0</version>
+    <title>Quadarax.Foundation.Common</title>
+    <authors>Dalibor Votruba, Quadarax</authors>
+    <owners>Dalibor Votruba</owners>
+    <projectUrl>https://project.quadarax.com/</projectUrl>
+    <iconUrl>http://project.quadarax.com/favicon.ico</iconUrl>
+    <requireLicenseAcceptance>false</requireLicenseAcceptance>
+    <description>Implementations of simple patterns and misc. extensions.</description>
+    <releaseNotes>Initial 1.0.0.0 release</releaseNotes>
+    <copyright>Copyright (c) 2019 Quadarax</copyright>
+    <tags>quadarax, foundarion, common, qdr, fnd, library, extensions</tags>
+    <dependencies>
+         </dependencies>
+    <summary>Libraries</summary>
+  </metadata>
+  <files>
+    <file src="ReleaseNote.txt" />
+    <file src="bin\Release\QDR.FND.Common.dll" target="lib\net472\QDR.FND.Common.dll" />
+	<file src="bin\Release\QDR.FND.Common.pdb" target="lib\net472\QDR.FND.Common.pdb" />
+  </files>
+</package>

BIN
Common/Quadarax.Foundation.Common.1.0.0.nupkg


+ 3 - 0
Common/ReleaseNote.txt

@@ -0,0 +1,3 @@
+12.1.2019 v.1.0.0.0
+New
+ - Add XpathNavigator, XmlReader extensions

+ 17 - 0
Common/create_package.ps1

@@ -0,0 +1,17 @@
+# Generate Nuget package from this folder (find *.nuspec files at this level)
+
+
+# Set up initial variables, paths, constants
+Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
+Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
+$nuget = "$env:LOCALAPPDATA\Nuget\Nuget.exe"
+$current = (Get-Location).Path
+Set-Alias nuget $nuget
+
+$nuspecFiles = Get-ChildItem -Path $current | Where-Object {
+    $_.FullName -like "*.nuspec"} | Select-Object
+	
+foreach($file in $nuspecFiles){
+    nuget pack $file.FullName
+	Write-Host ("Generated nuget package from {0}" -f $file.FullName) -ForegroundColor White
+}	

+ 2 - 2
QConsole/QConsole/Properties/AssemblyInfo.cs

@@ -5,10 +5,10 @@ using System.Runtime.InteropServices;
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("QDR.FND.QConsole")]
-[assembly: AssemblyDescription("QConsole - simple console framework")]
+[assembly: AssemblyDescription("QConsole - simple console framework (part of Quadarax.Foundation)")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Quadarax")]
-[assembly: AssemblyProduct("QConsole")]
+[assembly: AssemblyProduct("Quadarax.Foundation")]
 [assembly: AssemblyCopyright("Copyright © Quadarax 2019")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

+ 1 - 1
QConsole/QConsole/QDR.FND.QConsole.nuspec

@@ -7,7 +7,7 @@
     <authors>Dalibor Votruba, Quadarax</authors>
     <owners>Dalibor Votruba</owners>
     <projectUrl>https://project.quadarax.com/</projectUrl>
-    <iconUrl>https://project.quadarax.com/logo.png</iconUrl>
+    <iconUrl>http://project.quadarax.com/favicon.ico</iconUrl>
     <requireLicenseAcceptance>false</requireLicenseAcceptance>
     <description>Implementation base for console applications with commands, lists, selections and easy command handlings.</description>
     <releaseNotes>Initial 1.0.0.0 release</releaseNotes>

+ 3 - 1
QConsole/QConsole/ReleaseNote.txt

@@ -1 +1,3 @@
-
+12.1.2019 v.1.0.0.1
+New
+ - Inline command support for noninteractive usage

+ 2 - 1
readme.txt

@@ -1,8 +1,9 @@
 Contains all sources for Quadarax.Foundation (QDR.FND).
 -------------------------------------------------------
-Last Update: 11.7.2019
+Last Update: 1.12.2019
 
 Folder List:
 Assets							QDR.FND.Assets							* Contains QDR graphics, icons, bitmaps, logos, certs
 QConsole						QDR.FND.QConsole						* Simple console framework for custom console application
+Common							QDR.FND.Common							* Simple common patterns and extensions