Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Generate docs when using library mode #10

Closed
wants to merge 13 commits into from
Closed

Generate docs when using library mode #10

wants to merge 13 commits into from

Conversation

skeet70
Copy link

@skeet70 skeet70 commented Oct 10, 2023

Adds a call to generate docs when using library mode (as recommended by the docs for proc macros). This worked in our medium sized project that uses only proc-macros+library mode.

@MeerKatDev
Copy link
Member

Hi, could you solve the conflicts? I'm sorry if I messed up with them myself. Let me know if I can somehow help.

@MeerKatDev MeerKatDev force-pushed the main branch 3 times, most recently from 72ad9fa to a26981f Compare October 26, 2023 13:42
@skeet70
Copy link
Author

skeet70 commented Oct 26, 2023

Hi, could you solve the conflicts? I'm sorry if I messed up with them myself. Let me know if I can somehow help.

I merged main in. It's still working for our project and the tests I can run still pass.

uniffi_docs/Cargo.toml Outdated Show resolved Hide resolved
@@ -100,7 +100,12 @@ pub fn generate_external_bindings<T: BindingGenerator>(
}
}

for source in sources.iter() {
for source in sources.iter_mut() {
Copy link
Member

Choose a reason for hiding this comment

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

from what I understood, they (mozilla) would prefer &mut sources

Copy link
Member

Choose a reason for hiding this comment

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

Also, in the last version of the code, this part was extracted

Copy link
Member

Choose a reason for hiding this comment

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

I mean - is it possible to reuse the code here?

Copy link
Author

Choose a reason for hiding this comment

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

Very possible, I've just been blazing forward with using this, trying to release and document the product we're building with it. I have another hackday in two weeks, but I can try to come back and take a look at consolidating in between tickets before then.

Copy link
Author

Choose a reason for hiding this comment

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

I think I've done this, and removed the methods I had added to do it. If you were thinking of a different reusable part let me know.

// Simple error enums only carry a message
case {{ variant.name()|class_name }}(message: String)
{% endfor %}

{%- else %}
{% for variant in e.variants() %}
{% include "EnumVariantDocsTemplate.swift" %}
Copy link
Member

Choose a reason for hiding this comment

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

thank you!

@skeet70 skeet70 requested a review from MeerKatDev November 13, 2023 21:59
@skeet70 skeet70 closed this Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants