Skip to content

Commit 8419d36

Browse files
committed
fix: windows build
1 parent 1df59c4 commit 8419d36

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bridge/scripts/code_generator/bin/code_generator.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ function genPluginAPICodeFromTypeDefine() {
356356
}
357357
}
358358

359+
fs.rmSync(path.join(dist, '../include/plugin_api_gen'), {recursive: true, force: true});
360+
fs.symlinkSync(path.join(dist, 'plugin_api_header_gen'), path.join(dist, '../include/plugin_api_gen'), 'dir');
361+
359362
}
360363

361364
function genRustCodeFromTypeDefine() {

bridge/scripts/code_generator/templates/idl_templates/plugin_api_templates/interface.cc.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ double WindowPublicMethods::RequestAnimationFrame(Window* window,
7171
<%= generatePublicReturnTypeValue(method.returnType, true) %> <%= className %>PublicMethods::<%= _.startCase(method.rustName || method.name).replace(/ /g, '') %>(<%= className %>* <%= _.snakeCase(className) %>, <%= generatePublicParametersTypeWithName(method.args, true) %>SharedExceptionState* shared_exception_state) {
7272
MemberMutationScope member_mutation_scope{<%= _.snakeCase(className) %>->GetExecutingContext()};
7373
<% if (method.returnTypeMode?.dartImpl) { %>
74+
<% if (method.args.length != 0) { %>
7475
NativeValue args[] = {
7576
<% _.forEach(method.args, function(arg, index) { %>
7677
<%= generateNativeValueConverter(arg.type) %>(<%= _.snakeCase(arg.name) %>),
7778
<% }) %>
7879
};
79-
<%= _.snakeCase(className) %>->InvokeBindingMethod(binding_call_methods::kaddColorStop, <%= method.args.length %>, args, FlushUICommandReason::kDependentsOnElement<% if(method.returnTypeMode?.layoutDependent){ %> | FlushUICommandReason::kDependentsOnLayout <% } %>, shared_exception_state->exception_state);
80+
<% } %>
81+
<%= _.snakeCase(className) %>->InvokeBindingMethod(binding_call_methods::kaddColorStop, <%= method.args.length %>, <%= method.args.length == 0 ? 'NULL' : 'args' %>, FlushUICommandReason::kDependentsOnElement<% if(method.returnTypeMode?.layoutDependent){ %> | FlushUICommandReason::kDependentsOnLayout <% } %>, shared_exception_state->exception_state);
8082

8183
<% } else { %>
8284

0 commit comments

Comments
 (0)