-
Notifications
You must be signed in to change notification settings - Fork 174
feat: Linux supported, automate with native assets fix sqlite support #613
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
Open
bhola-dev58
wants to merge
10
commits into
CCExtractor:main
Choose a base branch
from
bhola-dev58:feature/linux-automation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f832b5e
feat: Linux supported, automate with native assets fix sqlite support
3f3d526
modified: removed unused imports and polished logging
6861c5d
refactor: improve platform guards for iOS and Web compatibility
e624db6
chore: final cleanup of unused imports and comments in main.dart
0e75408
refactor: integrate native library with Rust bridge and fix formatting
2b60ac4
feat: expand desktop support to include Windows and macOS
083bd77
remove irrelevant generated files from PR
96cfa1e
resolve merge conflicts in lib/main.dart
ee70123
resolve upstream conflicts in main.dart
3e25972
fix: typo in main function declaration
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import 'dart:io'; | ||
| import 'package:native_assets_cli/native_assets_cli.dart'; | ||
| import 'package:native_assets_cli/code_assets.dart'; | ||
|
|
||
| void main(List<String> args) async { | ||
| await build(args, (input, output) async { | ||
| // Check if code assets are supported/requested | ||
| // Note: hook/build.dart is only called if the package has native assets. | ||
|
|
||
| final targetOS = input.config.code.targetOS; | ||
| if (targetOS != OS.linux) return; | ||
|
|
||
| final rustDir = input.packageRoot.resolve('rust/'); | ||
|
|
||
| // 1. Run cargo build --release | ||
| final result = await Process.run( | ||
| 'cargo', | ||
| ['build', '--release'], | ||
| workingDirectory: rustDir.toFilePath(), | ||
| ); | ||
|
|
||
| if (result.exitCode != 0) { | ||
| stdout.write(result.stdout); | ||
| stderr.write(result.stderr); | ||
| throw Exception('Rust build failed'); | ||
| } | ||
|
|
||
| // 2. Locate the library | ||
| final libName = 'libtc_helper.so'; | ||
| final libPath = rustDir.resolve('target/release/$libName'); | ||
|
|
||
| if (!await File.fromUri(libPath).exists()) { | ||
| throw Exception('Built library not found at $libPath'); | ||
| } | ||
|
|
||
| // 3. Add the asset to the output | ||
| output.assets.code.add(CodeAsset( | ||
| package: input.packageName, | ||
| name: 'main.dart', | ||
| linkMode: DynamicLoadingBundled(), | ||
| file: libPath, | ||
| )); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: CCExtractor/taskwarrior-flutter
Length of output: 50387
Windows and macOS are opt-in in code but not in the build system.
hook/build.dartline 11 gates the entire build to Linux only withif (targetOS != OS.linux) return;—when building for Windows or macOS, the hook skips all compilation and asset generation. However, lines 29–33 now loadtc_helper.framework/tc_helperandtc_helper.dll, and line 41 initializes the Rust FFI for all three desktops. On Windows and macOS, the app will crash at startup trying to load libraries that were never built.Remove the Windows and macOS branches from
lib/main.dart(lines 29–33), or extendhook/build.dartto handle those platforms. Currently, only Linux has a working native asset pipeline.🤖 Prompt for AI Agents