Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure the .xproj build NuGet package with both net45 and netstandard1.3 versions #2

Merged
merged 1 commit into from
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ publish
# Publish Web Output
*.Publish.xml

# NuGet Packages Directory
# NuGet
packages
*.nuget.props
*.nuget.targets
project.lock.json

# Windows Azure Build Output
csx
Expand Down
2 changes: 0 additions & 2 deletions SharpSimpleNLGDotNetCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@
// 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("16f344a8-b688-4d95-8da6-2e207d47aecb")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
30 changes: 23 additions & 7 deletions SharpSimpleNLGDotNetCore/lexicon/XMLLexicon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Xml;
using SimpleNLG.Extensions;

Expand Down Expand Up @@ -56,14 +57,14 @@ public class XMLLexicon : Lexicon

public XMLLexicon(string path = null)
{
// if (path == null) // try the embedded resource first
// {
// createLexiconFromEmbeddedResource(@"SharpSimpleNLG.lexicon.default-lexicon.xml");
// }
// else
// {
if (path == null) // try the embedded resource first
{
createLexiconFromEmbeddedResource(@"SharpSimpleNLGDotNetCore.lexicon.default-lexicon.xml");
}
else
{
createLexiconFromPath(path);
// }
}
}

public void createLexiconFromPath(string path)
Expand All @@ -78,6 +79,21 @@ public void createLexiconFromPath(string path)
Debug.WriteLine(ex.ToString());
}
}
public void createLexiconFromEmbeddedResource(string path)
{
var assembly = typeof(XMLLexicon).GetTypeInfo().Assembly;
try
{
using (var sr = new StreamReader(assembly.GetManifestResourceStream(path)))
{
createLexicon(sr.ReadToEnd());
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}

public void createLexicon(string rawlexicontext)
{
Expand Down
37 changes: 26 additions & 11 deletions SharpSimpleNLGDotNetCore/project.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
"System.Xml.XmlDocument": "4.0.1-rc2-24027"
"version": "1.0.2-*",
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": {
"type": "build"
},
"System.Xml": ""
}
},
"frameworks": {
"netstandard1.5": {
"imports": "dnxcore50"
}
},
"buildOptions": {
"defines": [ "DOTNETCORE" ]
"netstandard1.3": {
"dependencies": {
"System.Collections": "4.0.11-*",
"System.Console": "4.0.0-*",
"System.Diagnostics.Debug": "4.0.11-*",
"System.IO.FileSystem": "4.0.1-*",
"System.Linq": "4.1.0-*",
"System.Reflection.Extensions": "4.0.1-*",
"System.Text.RegularExpressions": "4.1.0-*",
"System.Xml.XmlDocument": "4.0.1-*"
}
}
},
"buildOptions": {
"embed": {
"includeFiles": "lexicon/default-lexicon.xml"
}
}
}
Loading