question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get the list of generated source files by the compiler?

See original GitHub issue

Hi,

I’m trying to quickly integrate the compiler into a non-maven project, and I am doing:

    TemplateEngine templateEngine = TemplateEngine.create(
        new DirectoryCodeResolver(source), target, ContentType.valueOf(contentType));
    templateEngine.setTrimControlStructures(trimControlStructures);
    templateEngine.setHtmlTags(htmlTags);
    templateEngine.setHtmlAttributes(htmlAttributes);
    templateEngine.setHtmlCommentsPreserved(htmlCommentsPreserved);

    int amount;

    try {
      templateEngine.cleanAll();
      amount = templateEngine.generateAll();
      // here instead of amount I'd like to have a List<String> with the generated file names
    } catch (Exception e) {
      fatal("Failed to generate templates: " + e.getMessage());
      return;
    }

As you can see it is a shameful copy and paste of the maven plugin. Hovever, now I’d like to get the list of generated java files instead of the number of generated files.

The reason is that I want to further process the generated files. This would be for a tight integration between jte, vertx and es4x (graaljs).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pmlopescommented, Feb 11, 2021

For now I can work with snapshots, as I’m still gluing stuff 😃 once I’ve it working I’ll ping you

1reaction
pmlopescommented, Feb 11, 2021

Yes this is great as I can quickly automate it to be used outside a “maven/gradle” world as well as use it on a different language using graalvm/js!

Read more comments on GitHub >

github_iconTop Results From Across the Web

GNU make: generate list of source files - c++ - Stack Overflow
All object files are generated using the same compiler options. I am thinking to generate the list of all source files and then...
Read more >
Generate source files - IBM
To generate only the source files for objects defined in your project, click the Source node or one of its subordinate nodes in...
Read more >
Generating sources - The Meson Build system
Using custom_target(). Let's say you have a build target that must be built using sources generated by a compiler. The compiler can either...
Read more >
Java Generated Code | Protocol Buffers - Google Developers
List <Builder> getFooBuilderList() : Returns the entire field as an unmodifiable list of builders. Repeated Enum Fields (proto3 only). The compiler will generate...
Read more >
Content roots | IntelliJ IDEA Documentation - JetBrains
The content root directory in IntelliJ IDEA is marked with the ... The IDE considers that files in the Generated Sources folder are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found