Skip to content

Commit ad83d41

Browse files
authored
chore: cleanup and simplify examples (#10743)
1 parent c508000 commit ad83d41

119 files changed

Lines changed: 1907 additions & 18696 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[env]
2-
# workaround needed to prevent `STATUS_ENTRYPOINT_NOT_FOUND` error
2+
# workaround needed to prevent `STATUS_ENTRYPOINT_NOT_FOUND` error in tests
33
# see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864
44
__TAURI_WORKSPACE__ = "true"

.changes/tauri-build.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-build": "patch:feat"
3+
---
4+
5+
Add `WindowsAttributes::new_without_app_manifest` to create `WindowsAttributes` without the default manifest.
6+

.gitignore

Lines changed: 36 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,55 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# smoke-tests repo
9-
/smoke-tests
10-
11-
# Runtime data
12-
pids
13-
*.pid
14-
*.seed
15-
*.pid.lock
16-
17-
# Directory for instrumented libs generated by jscoverage/JSCover
18-
lib-cov
19-
20-
# Coverage directory used by tools like istanbul
21-
coverage
22-
23-
# nyc test coverage
24-
.nyc_output
1+
# dependency directories
2+
node_modules/
253

26-
# node-waf configuration
27-
.lock-wscript
4+
# Optional npm and yarn cache directory
5+
.npm/
6+
.yarn/
287

29-
# Compiled binary addons (http://nodejs.org/api/addons.html)
30-
build/Release
8+
# Output of 'npm pack'
9+
*.tgz
3110

32-
# Dependency directories
33-
node_modules/
34-
jspm_packages/
11+
# dotenv environment variables file
12+
.env
3513

36-
# Typescript v1 declaration files
37-
typings/
14+
# .vscode workspace settings file
15+
.vscode/settings.json
3816

39-
# Optional npm cache directory
40-
.npm
17+
# npm, yarn and bun lock files
18+
package-lock.json
19+
yarn.lock
20+
bun.lockb
4121

42-
# Optional yarn cache directory
43-
.yarn
22+
# rust compiled folders
23+
target/
4424

45-
# Optional eslint cache
46-
.eslintcache
25+
# test video for streaming example
26+
streaming_example_test_video.mp4
4727

48-
# Optional REPL history
49-
.node_repl_history
28+
# examples /gen directory
29+
/examples/**/gen/
5030

51-
# Output of 'npm pack'
52-
*.tgz
31+
# old cli directories
32+
/tooling/cli.js
33+
/tooling/cli.rs
5334

54-
# Yarn Integrity file
55-
.yarn-integrity
35+
# logs
36+
logs
37+
*.log
38+
npm-debug.log*
39+
yarn-debug.log*
40+
yarn-error.log*
5641

57-
# dotenv environment variables file
58-
.env
42+
# runtime data
43+
pids
44+
*.pid
45+
*.seed
46+
*.pid.lock
5947

48+
# miscellaneous
6049
/.vs
6150
.DS_Store
6251
.Thumbs.db
6352
*.sublime*
6453
.idea
6554
debug.log
66-
package-lock.json
67-
.vscode/settings.json
68-
*/.vscode/
69-
proptest-regressions/
7055
TODO.md
71-
72-
# rust compiled folders
73-
target
74-
75-
# lock for libs
76-
#/Cargo.lock Committed to prevent msrv checks from failing
77-
/tooling/bench/tests/Cargo.lock
78-
/yarn.lock
79-
80-
# ignore frida handlers
81-
__handlers__/
82-
83-
# benches
84-
gh-pages
85-
test_video.mp4
86-
87-
# old cli directories
88-
/tooling/cli.js
89-
/tooling/cli.rs

Cargo.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ members = [
1616
# integration tests
1717
"core/tests/restart",
1818
"core/tests/acl",
19+
20+
# examples
21+
"examples/file-associations/src-tauri",
22+
"examples/api/src-tauri",
1923
]
2024

2125
exclude = [

core/tauri-build/src/lib.rs

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ fn cfg_alias(alias: &str, has_feature: bool) {
223223

224224
/// Attributes used on Windows.
225225
#[allow(dead_code)]
226-
#[derive(Debug, Default)]
226+
#[derive(Debug)]
227227
pub struct WindowsAttributes {
228228
window_icon_path: Option<PathBuf>,
229229
/// A string containing an [application manifest] to be included with the application on Windows.
230230
///
231231
/// Defaults to:
232232
/// ```text
233-
#[doc = include_str!("window-app-manifest.xml")]
233+
#[doc = include_str!("windows-app-manifest.xml")]
234234
/// ```
235235
///
236236
/// ## Warning
@@ -255,10 +255,28 @@ pub struct WindowsAttributes {
255255
app_manifest: Option<String>,
256256
}
257257

258+
impl Default for WindowsAttributes {
259+
fn default() -> Self {
260+
Self::new()
261+
}
262+
}
263+
258264
impl WindowsAttributes {
259265
/// Creates the default attribute set.
260266
pub fn new() -> Self {
261-
Self::default()
267+
Self {
268+
window_icon_path: Default::default(),
269+
app_manifest: Some(include_str!("windows-app-manifest.xml").into()),
270+
}
271+
}
272+
273+
/// Creates the default attriute set wihtou the default app manifest.
274+
#[must_use]
275+
pub fn new_without_app_manifest() -> Self {
276+
Self {
277+
app_manifest: None,
278+
window_icon_path: Default::default(),
279+
}
262280
}
263281

264282
/// Sets the icon to use on the window. Currently only used on Windows.
@@ -275,7 +293,7 @@ impl WindowsAttributes {
275293
///
276294
/// Defaults to:
277295
/// ```text
278-
#[doc = include_str!("window-app-manifest.xml")]
296+
#[doc = include_str!("windows-app-manifest.xml")]
279297
/// ```
280298
///
281299
/// ## Warning
@@ -641,8 +659,6 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
641659

642660
if let Some(manifest) = attributes.windows_attributes.app_manifest {
643661
res.set_manifest(&manifest);
644-
} else {
645-
res.set_manifest(include_str!("window-app-manifest.xml"));
646662
}
647663

648664
if let Some(version_str) = &config.version {
File renamed without changes.

0 commit comments

Comments
 (0)