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

No auto library specifying #144

Closed
Cubody opened this issue Jan 15, 2024 · 9 comments
Closed

No auto library specifying #144

Cubody opened this issue Jan 15, 2024 · 9 comments

Comments

@Cubody
Copy link

Cubody commented Jan 15, 2024

Why doesn't it automatically include references?

For example,

using System.Security.Cryptography;

I need to specify manually
bflat build --os:windows -r "...\net8.0\System.Security.Cryptography.ProtectedData.dll"

@Cubody
Copy link
Author

Cubody commented Jan 15, 2024

It also ignores auto-generated GlobalUsing.cs

@MichalStrehovsky
Copy link
Member

The library doesn't ship with .NET. it comes from nuget. You have to specify it for the same reason you'd have to specify e.g. newtonsoft.json.

@Cubody
Copy link
Author

Cubody commented Jan 15, 2024

I have it from Nuget

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

var path = Console.ReadLine();
var decrypted = Encoding.Unicode.GetString(
    ProtectedData.Unprotect(
        File.ReadAllBytes(path),
        null,
        DataProtectionScope.LocalMachine));

var directory = Path.GetDirectoryName(path);

File.WriteAllText(Path.Combine(directory, "UserSettings.decrypted"), decrypted);

image

@Cubody
Copy link
Author

Cubody commented Jan 15, 2024

Oh, nvrm, I see. So I need to specify all libraries I have in a big project?

@Cubody
Copy link
Author

Cubody commented Jan 15, 2024

As I know dotnet generates cache of nuget libraries with path to it. Maybe it's possible to automate it?

@MichalStrehovsky
Copy link
Member

bflat is just a compiler. You can orchestrate nuget (even downloads from nuget) with separate tools. For example, MSBuild, or even nuget.exe. bflat is not a build system, you have to bring your own build system. There are many to choose from (GNU Make, MSBuild, ninja, bazel, etc., or just use a shell script).

@Cubody
Copy link
Author

Cubody commented Jan 15, 2024

I see, thank you. What about auto generated files?

I know that this is not supported yet, maybe you can advise how I can specify the generated files myself, but with the addition of a recursive scan of the base files from the project. I would like not to specify the entire project.

@Cubody
Copy link
Author

Cubody commented Jan 15, 2024

I found how to do it ;d
And it works with System.Text.Json

<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>

@xiaoyuvax
Copy link

u may try my small tool bflatA(https://github.com/xiaoyuvax/bflata) which scans the .csproj for dependency and build .rsp building script for ur project.

@Cubody Cubody closed this as completed Jan 24, 2024
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

No branches or pull requests

3 participants