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

c4scli does NOT create png files #58

Open
marcosecurity opened this issue Jul 1, 2024 · 1 comment
Open

c4scli does NOT create png files #58

marcosecurity opened this issue Jul 1, 2024 · 1 comment

Comments

@marcosecurity
Copy link

Hi,
I created your sample Internetbanking project like the following:
public class ContainerDiagramSample : ContainerDiagram
{
protected override string Title => "Container diagram for Internet Banking System";

protected override IEnumerable<Structure> Structures => new Structure[]
{
    Person.None | Boundary.External 
                | ("Customer", "Personal Banking Customer", "A customer of the bank, with personal bank accounts."),
    
    SoftwareSystem.None | ("BankingSystem", "Internet Banking System", 
        "Allows customers to view information about their bank accounts, and make payments."),
    
    SoftwareSystem.None | Boundary.External 
                        | ("MailSystem", "E-mail system", "The internal Microsoft Exchange e-mail system."),
    
    Bound("c1", "Internet Banking",
        Container.None | (WebApplication, "WebApp", "WebApp", "C#, WebApi", 
            "Delivers the static content and the Internet banking SPA"),
        
        Container.None | (Spa, "Spa", "Spa", "JavaScript, Angular", 
            "Delivers the static content and the Internet banking SPA"),
        
        Container.None | (Mobile, "MobileApp", "Mobile App", "C#, Xamarin", 
            "Provides a mobile banking experience"),
        
        Container.None | (Database, "SqlDatabase", "SqlDatabase", "SQL Database", 
            "Stores user registration information, hashed auth credentials, access logs, etc."),   
        
        Container.None | (Queue, "RabbitMQ", "RabbitMQ", "RabbitMQ", 
            "Stores user registration information, hashed auth credentials, access logs, etc."),
        
        Container.None | (Api, "BackendApi", "BackendApi", "Dotnet, Docker Container", 
            "Provides Internet banking functionality via API.")
    )
};

protected override IEnumerable<Relationship> Relationships => new[]
{
    this["Customer"] > this["WebApp"] | ("Uses", "HTTPS"),
    this["Customer"] > this["Spa"] | ("Uses", "HTTPS"),
    this["Customer"] > this["MobileApp"] | "Uses",
    
    this["WebApp"] > this["Spa"] | "Delivers" | Position.Neighbor,
    this["Spa"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"),
    this["MobileApp"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"),
    this["SqlDatabase"] < this["BackendApi"] | ("Uses", "async, JSON/HTTPS") | Position.Neighbor,
    this["RabbitMQ"] < this["BackendApi"] | ("Uses", "async, JSON"),
    
    this["Customer"] < this["MailSystem"] | "Sends e-mails to",
    this["MailSystem"] < this["BackendApi"] | ("Sends e-mails using", "sync, SMTP"),
    this["BackendApi"] > this["BankingSystem"] | ("Uses", "sync/async, XML/HTTPS") | Position.Neighbor
};
using C4Sharp.Diagrams;
using C4Sharp.Diagrams.Plantuml;
using C4Sharp.Diagrams.Themes;
using ModelDiagrams.Diagrams;

private static void Main()
{
	var diagrams = new Diagram[]
	{
		new ContextDiagram { ... },
		new ContainerDiagram { ... },
		new ComponentDiagram { ... },
		new DeploymentDiagram { ... },
		new EnterpriseDiagram { ... },
	};

	new PlantumlSession()
		.UseDiagramImageBuilder() // To generate PNG Files
		.UseDiagramSvgImageBuilder() // To generate SVG Files
		.UseStandardLibraryBaseUrl() // To use C4-Planguml Library from their github
		.Export(diagrams);
}

}
Put that Programs.cs in a csproj and create a .sln file.
I ran:
c4scli build InternetBankingSystem_1.0.sln -o .
and I obtained:
**Running dotnet build
dotnet build complete
Starting analysis
Solution analysis is completed
Generating C4 diagram in: .\c4

C4 diagram PNG files

C4 diagram SVG files

C4 diagram MD files

C4 diagram PUML files**

but only the .puml files were created in the .c4s folder, with no images in c4 folder, that remains empty.

I'm under Windows 11, with c4sharp.7.0.189 and c4scli.3.0.189 installed.

Do I miss something?

@marcosecurity marcosecurity changed the title c4scli does create png files c4scli does NOT create png files Jul 3, 2024
@yanjustino
Copy link
Member

Please, verify if in your Windows you have the Java Runtime installed. It's a dependency to build images by Plantuml engine.

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

2 participants