Skip to content

Multiple refactorings#168

Merged
jkoritzinsky merged 22 commits into
SharpGenTools:masterfrom
andrew-boyarshin:revenge_of_the_sith
Oct 31, 2020
Merged

Multiple refactorings#168
jkoritzinsky merged 22 commits into
SharpGenTools:masterfrom
andrew-boyarshin:revenge_of_the_sith

Conversation

@andrew-boyarshin

Copy link
Copy Markdown
Contributor

See commit list for the list of changes, review by commit, instead of all at once.

@andrew-boyarshin

Copy link
Copy Markdown
Contributor Author

@jkoritzinsky this PR is ready to be reviewed and merged.

@andrew-boyarshin

Copy link
Copy Markdown
Contributor Author

Reminder.

@jkoritzinsky jkoritzinsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions/comments here and there. Overall looks great!


namespace SharpGen.Runtime
{
public static class ComActivationHelpers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the COM-specific types should live in SharpGen.Runtime.COM instead of in the SharpGen.Runtime base layer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, and yet I propose moving this class and the CLSCTX enum to SharpGen.Runtime, since it is independent of all other COM types, but provides bare minimum of the COM utilities. It is also used in tests in my mine branch. IUnknown and the rest will remain in SharpGen.Runtime.COM, along with the existing ComUtilities class, which will be reimplemented on top of this class.

@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for splitting out SharpGen.Platform?

@andrew-boyarshin andrew-boyarshin Jul 6, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To drop runtime-specific dependencies from SharpGen. RID-specific assembly lookup is highly error-prone (sometimes it just doesn't work, for example when MSBuild ALCs are used). This split removes RID-specific assemblies from SharpGen plugins' (e.g. SG.Doc.MSDN) dependency graph.
It also paves the road for the migration off the CastXML by creating interface and implementation parts. The interface is not a complete C++ parser abstraction, rather, it is a first draft of such.

<TfmConsumerPropsLines Include="&lt;Project&gt;" />
<TfmConsumerPropsLines Include="&lt;ItemGroup&gt;" />
<TfmConsumerPropsLines Include='&lt;SharpGenConsumerMapping Include=&quot;$(EmbeddedConsumerProp)(MSBuildThisFileDirectory)/$(SharpGenConsumerBindMappingConfigId).BindMapping.xml&quot;/&gt;' />
<TfmConsumerPropsLines Include='&lt;SharpGenConsumerMapping Include=&quot;%24(MSBuildThisFileDirectory)/$(SharpGenConsumerBindMappingConfigId).BindMapping.xml&quot;/&gt;' />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you validate that the %24 works? I thought that that didn't work and you'd have to use something like the built-in MSBuild::Escape method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I've validated this to work.

DependsOnTargets="CreateIntermediateDir;MapCppToCSharp;RemoveGeneratedCSharpFiles"
Inputs="@(SharpGenSdkAssembly);@(CSharpModel);@(DocLinksCache);@(SharpGenExternalDocs)"
Outputs="@(GeneratedCSharpFiles)"
Outputs="@(GeneratedCSharpFiles);$(SharpGenIntermediateDir)ForceNotUpToDate"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By adding the ForceNotUpToDate, this is basically removing the point of the Inputs and Outputs fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. That was a mistake made when removing GetGeneratedCSharpFiles target. mine branch does everything differently.

@andrew-boyarshin

Copy link
Copy Markdown
Contributor Author

@jkoritzinsky it would be great to finally have this merged.

@jkoritzinsky jkoritzinsky merged commit 1327b38 into SharpGenTools:master Oct 31, 2020
@andrew-boyarshin andrew-boyarshin deleted the revenge_of_the_sith branch October 31, 2020 17:45
@andrew-boyarshin andrew-boyarshin added this to the 2.0 milestone Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants