Skip to content

Spkl dev 191212 #347

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

Merged
merged 21 commits into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
76f62e4
Resolves #176
scottdurow Nov 3, 2017
72e807c
Updated dependancies to v9
scottdurow Nov 3, 2017
ffccae1
1.0.4 Updated assembly name and added dependnacy on fakeiteasy
scottdurow Nov 4, 2017
cd315fd
Added support for setting all ExecutionContext properties
scottdurow Nov 10, 2017
5bb4f09
Fixes #218 & SetState & SetStateDynamicEntity message property of Ent…
aelsmore Apr 17, 2018
e9d3c52
Fixes #232
scottdurow May 4, 2018
440da7d
Version 1.0.6
scottdurow May 4, 2018
9449f96
Merged from spkl-fake-dev
scottdurow May 4, 2018
3eb2136
Merge branch 'master' of https://github.com/scottdurow/SparkleXrm
scottdurow May 4, 2018
49cce0b
ix dependency load error - Cannot resolve dependency to assembly 'Sy…
aelsmore May 17, 2018
b50c7dc
Merge remote-tracking branch 'upstream/spkl_dev' into spkl_dev
aelsmore May 17, 2018
1fe0444
Fix #226: Predefined Type '' is not defined or imported (#236)
janis-veinbergs May 21, 2018
6a71d19
Merge branch 'spkl_dev'
scottdurow Jul 10, 2018
fa61048
Merge branch 'master' of https://github.com/scottdurow/SparkleXrm
scottdurow Jul 10, 2018
5af1f07
Fixed typo (#280)
ryanklee Apr 16, 2019
243b84e
Fix some typos (#311)
FixRM Apr 16, 2019
9527b52
Let OOB batch files to pass parameters like "/p" to spkl.exe
FixRM May 20, 2019
f5f5b02
Add support for workflow base class
Dec 4, 2019
139d8cb
Merge changes
Dec 4, 2019
ce528b6
PR #324 Let OOB scripts to pass parameters to spkl.exe
scottdurow Dec 12, 2019
9952f55
Merge branch 'pr/346-fix-dependency-load-error' into spkl_dev_191212
scottdurow Dec 12, 2019
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
2 changes: 2 additions & 0 deletions spkl/SparkleXrm.Tasks/PluginRegistraton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public void RegisterWorkflowActivities(string path)
if (assembly == null)
return;

AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += (sender, args) => Assembly.ReflectionOnlyLoad(args.Name);

// Search for any types that interhit from IPlugin
IEnumerable<Type> pluginTypes = Reflection.GetTypesInheritingFrom(assembly, typeof(System.Activities.CodeActivity));

Expand Down
14 changes: 9 additions & 5 deletions spkl/SparkleXrm.Tasks/Reflection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,17 @@ public static IEnumerable<Type> GetTypesImplementingInterface(Assembly assembly,

public static IEnumerable<Type> GetTypesInheritingFrom(Assembly assembly, Type type)
{
// Load the containing assembly into the reflection context so that we can find all types deriving from System.Activities.CodeActivity
System.Reflection.Assembly.ReflectionOnlyLoad(type.Assembly.FullName);
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve;
var containingAssembly = AppDomain.CurrentDomain.ReflectionOnlyGetAssemblies().Where(ab => ab.GetType(type.FullName) != null).First();
var types = assembly.DefinedTypes.Where(p => containingAssembly.GetType(type.FullName).IsAssignableFrom(p));
var definedTypes = assembly.DefinedTypes.Where(p => p.BaseType != null && p.BaseType.Name == type.Name).ToList();

var allTypes = new List<TypeInfo>(definedTypes);
foreach (var abstractType in definedTypes.Where(t => t.IsAbstract))
{
var inheritingTypes = assembly.DefinedTypes.Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(abstractType.UnderlyingSystemType)).ToList();
allTypes.AddRange(inheritingTypes);
}
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= CurrentDomain_ReflectionOnlyAssemblyResolve;
return types;
return allTypes;
}
public static IEnumerable<CustomAttributeData> GetAttributes(IEnumerable<Type> types, string attributeName)
{
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/deploy-plugins.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl plugins [path] [connection-string] [/p:release]
"%spkl_path%" plugins "%cd%\.."
"%spkl_path%" plugins "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/deploy-webresources.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl webresources [path] [connection-string]
"%spkl_path%" webresources "%cd%\.."
"%spkl_path%" webresources "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/deploy-workflows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl workflow [path] [connection-string] [/p:release]
"%spkl_path%" workflow "%cd%\.."
"%spkl_path%" workflow "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/download-webresources.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl instrument [path] [connection-string] [/p:release]
"%spkl_path%" download-webresources "%cd%\.." /o
"%spkl_path%" download-webresources "%cd%\.." /o %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/earlybound.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl earlybound [path] [connection-string] [/p:release]
"%spkl_path%" earlybound "%cd%\.."
"%spkl_path%" earlybound "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/instrument-plugin-code.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl instrument [path] [connection-string] [/p:release]
"%spkl_path%" instrument "%cd%\.."
"%spkl_path%" instrument "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/pack+import.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl instrument [path] [connection-string] [/p:release]
"%spkl_path%" import "%cd%\.."
"%spkl_path%" import "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/unpack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl instrument [path] [connection-string] [/p:release]
"%spkl_path%" unpack "%cd%\.."
"%spkl_path%" unpack "%cd%\.." %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion spkl/spkl/Package/spkl/unpacksolution.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For /R %package_root% %%G IN (spkl.exe) do (
:continue
@echo Using '%spkl_path%'
REM spkl instrument [path] [connection-string] [/p:release]
"%spkl_path%" unpacksolution "%cd%\.." ""
"%spkl_path%" unpacksolution "%cd%\.." "" %*

if errorlevel 1 (
echo Error Code=%errorlevel%
Expand Down