Skip to content

Commit

Permalink
Merge pull request #2 from AndriySvyryd/NetCoreBuild
Browse files Browse the repository at this point in the history
Configure the .xproj build NuGet package with both net45 and netstandard1.3 versions
  • Loading branch information
nickhodge authored Aug 1, 2016
2 parents 3d81ccf + 9783580 commit ecd5e5d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3,739 deletions.
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

0 comments on commit ecd5e5d

Please sign in to comment.