Skip to content

Commit

Permalink
Merge PR #348
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdurow committed Dec 12, 2019
2 parents 243b84e + ce528b6 commit 9da12da
Show file tree
Hide file tree
Showing 33 changed files with 652 additions and 560 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ UpgradeLog*.XML
/SparkleXrmSource
/spkl/diff script schema.txt
/spkl/XmlDiffLib
/spkl.fakes/.vs/spkl.fakes/v15/sqlite3
/.vs
*.lock
*.ide
*.ide-shm
*.ide-wal
/.vs
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ License: [MIT](http://www.opensource.org/licenses/mit-license.php)

SparkleXrm is currently in a Preview alpha release.

If you are interested in getting a feel for this project, you can install the [SparkleXrm_0_1_0_managed.zip](https://github.com/scottdurow/SparkleXrm/raw/master/SparkleXrmSamples/SparkleXrm/SparkleXrm_0_1_0_managed.zip) and [QuoteLineEditor_0_1_0_managed.zip](https://github.com/scottdurow/SparkleXrm/raw/master/SparkleXrmSamples/QuoteLineEditor_0_1_0_managed.zip) managed solution and check it out. Open a quote, and use the 'Quote Products' tab on the form to add/edit/remove quote products. Once you've finished, deleting the solutions afterwards will remove all trace!
If you are interested in getting a feel for this project, you can install the [SparkleXrm_0_1_0_managed.zip](https://github.com/scottdurow/SparkleXrm/raw/master/SparkleXrmSamples/SparkleXrm/SparkleXrm_0_1_0_managed.zip) and [QuoteLineEditor_0_1_0_managed.zip](https://github.com/scottdurow/SparkleXrm/raw/master/SparkleXrmSamples/QuoteLineEditor_0_1_0_managed.zip) managed solution and check it out. Open a quote, and use the 'Quote Products' tab on the form to add/edit/remove quote products.Once you've finished, deleting the solutions afterwards will remove all trace!

Building the Source
-------------------
To build the source you will need to install:
* VS2012
* [Developer Toolkit for VS2012](http://msdn.microsoft.com/en-us/library/hh372957.aspx)
* Script# v0.7.5 (Install through Tools->Extensions & Updates)
* PowerShell Tools for Visual Studio 2012 v1.0.5 (Install through Tools->Extensions & Updates)

The DebugWeb project allows you to run and debug the samples without publishing to CRM. The [standalone samples](http://www.sparklexrm.com/s/Tutorials/SetUpNewProject.html) projects use fiddler to allow debugging, but I found having a dedicated test web easier for the full source.

Expand Down
18 changes: 18 additions & 0 deletions spkl/SparkleXrm.Tasks/CodeParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class CodeParser
#region Private Fields
private string _filePath;
private string _code;
private Encoding _encoding;
private Dictionary<string,Match> _pluginClasses;
private Dictionary<string, Match> _pluginTypes;
private Dictionary<string, Match> _workflowTypes;
Expand All @@ -36,6 +37,19 @@ public CodeParser(Uri filePath, string customClassRegex)
{
_filePath = filePath.OriginalString;
_code = File.ReadAllText(_filePath);

// Get current encoding of the file
// Need to read part of the file to get the current encoding
using (var reader = new StreamReader(_filePath, Encoding.Default, true))
{
if (reader.Peek() >= 0)
{
reader.Read();
}

_encoding = reader.CurrentEncoding;
}

if (customClassRegex != null)
ClassRegex = customClassRegex;

Expand Down Expand Up @@ -97,6 +111,10 @@ public string Code
get { return _code; }
}

public Encoding CurEncoding
{
get { return _encoding; }
}
public string FilePath
{
get { return _filePath; }
Expand Down
4 changes: 3 additions & 1 deletion spkl/SparkleXrm.Tasks/Config/SolutionPackageConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ namespace SparkleXrm.Tasks.Config
public enum PackageType
{
unmanaged,
managed
managed,
both_unmanaged_import,
both_managed_import
}
public class SolutionPackageConfig
{
Expand Down
1 change: 1 addition & 0 deletions spkl/SparkleXrm.Tasks/Config/WebResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class WebResourceFile
public string uniquename;
public string displayname;
public string file;
public int? languagecode;
public string description;
}
}
3 changes: 2 additions & 1 deletion spkl/SparkleXrm.Tasks/Config/WebresourceDeployConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public class WebresourceDeployConfig
public string profile;
public string root;
public string solution;
public string autodetect;
public string deleteaction;
public List<WebResourceFile> files;
}

}
4 changes: 2 additions & 2 deletions spkl/SparkleXrm.Tasks/CrmSvcUtil/SourceCodeTypeExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

public class SourceCodeTypeExtractor
{
private const string ClassPattern = @"([a-zA-Z0-9\(\"",\s\.\)\]\s\n\[:])+public\spartial[a-zA-Z0-9\s:\.,_]+{(?:[^{}]|(?<open>{)|(?<-open>}))+(?(open)(?!))}";
private const string ClassPattern = @"([a-zA-Z0-9\(\"",\s\.\)\]\s\n\[:_])+public\spartial[a-zA-Z0-9\s:\.,_]+{(?:[^{}]|(?<open>{)|(?<-open>}))+(?(open)(?!))}";
private const string EnumPattern = @"([a-zA-Z0-9\(\"",\s\.\)\]\s\n\[:])+public\senum[a-zA-Z0-9\s_]+{(?:[^{}]|(?<open>{)|(?<-open>}))+(?(open)(?!))}";

public List<TypeContainer> ExtractTypes(string input)
{
{
var classMatches = new Regex(ClassPattern).Matches(input);
var result = (from Match match in classMatches
select new TypeContainer(ContainerType.ClassContainer, match.Value))
Expand Down
3 changes: 3 additions & 0 deletions spkl/SparkleXrm.Tasks/EntitiesTrim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5443,6 +5443,9 @@ public enum webresource_webresourcetype

[System.Runtime.Serialization.EnumMemberAttribute()]
Vectorformat_SVG = 11,

[System.Runtime.Serialization.EnumMemberAttribute()]
Resourceformat_RESX = 12,
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion spkl/SparkleXrm.Tasks/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public enum ExceptionTypes {
IMPORT_ERROR,
CRMSVCUTIL_ERROR,
SOLUTIONPACKAGER_ERROR,
NO_WEBRESOURCES_FOUND
NO_WEBRESOURCES_FOUND,
WEBRESOURCE_ERROR
}

public ExceptionTypes ExceptionType { get; protected set; }
Expand Down
Loading

0 comments on commit 9da12da

Please sign in to comment.