Skip to content
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

fix(codegen): write output file when contents change #4889

Merged
merged 1 commit into from
Aug 8, 2022
Merged

fix(codegen): write output file when contents change #4889

merged 1 commit into from
Aug 8, 2022

Conversation

brian14708
Copy link
Contributor

@brian14708 brian14708 commented Aug 8, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Currently an app build is needed even when no code has changed. After some investigation, it was trigger by the writing of the temporary icon file used for embedding.

Even with this change, two builds are required to avoid further rebuilds. Maybe it's better to preprocess the icons in build.rs?

@brian14708 brian14708 requested a review from a team as a code owner August 8, 2022 08:15
Copy link
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

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

Clever one, thanks!

@lucasfernog
Copy link
Member

lucasfernog commented Aug 8, 2022

Even with this change, two builds are required to avoid further rebuilds. Maybe it's better to preprocess the icons in build.rs?

We have a way to do this, enabling the codegen feature of tauri-build and changing your build.rs to:

fn main() {
  let mut codegen = tauri_build::CodegenContext::new();
  if !cfg!(feature = "custom-protocol") {
    codegen = codegen.dev();
  }
  codegen.build();
  tauri_build::build()
}

then change tauri::generate_context!() to tauri::tauri_build_context!().

aaaaaaaactually this has a bug, i'll open a PR to fix it.

@lucasfernog lucasfernog merged commit f957cbb into tauri-apps:dev Aug 8, 2022
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.

None yet

2 participants