Questions tagged [code-generation]
Topics related to the generation of code as the output of an application, instead of directly writing code by a programmer.
3,666
questions
-1
votes
0
answers
8
views
How to develop a deep learning platform like deepNetworkDesigner in matlab?
I tried deepNetworkDesigner in matlab which i found quite convenient to build deep learning model. But the tool in matlab does not contain some useful package like sklearn, scipy,etc. thus I want to ...
0
votes
0
answers
22
views
How to generate .tasty files directly?
I know how to inspect a scala 3 .tasty file, as described here 1 2. However, I would like to also go the other way, with the goal of generating one or more scala objects and classes based on an input ...
0
votes
1
answer
44
views
golang common structs in different namespaces
I have 160+ .xsd schemas and for each file I generated xsd.go files with xsdgen, but each document has common Header of CommonType.
namespace some_document
type Document struct {
Header ...
0
votes
0
answers
35
views
Dart 3: How to generate builder files into a custom folder instead of been next to the original class
How can I change the location where the files are going to be generated from this command dart run build_runner build.
Current folder project structure after running that command:
├── lib
│ ├── ...
1
vote
1
answer
66
views
Ballerina -Using Java Library with Dependencies
I want to use the Java Kubernetes API Client in Ballerina.
I have read this, this and this.
The only place, where Java based dependencies are a matter is this.
If one of these classes is required ...
0
votes
1
answer
54
views
Can't find class in generated sources produced by custom annotation processor when running java program
I have written an annotation processor to generate classes to the generated sources directly during compilation. The class generates with valid syntax, and to the correct, matching (same as interface ...
2
votes
0
answers
26
views
How to import a generated python module
I am generating python modules (using antlr).
e.g. foo_pb2.py, bar_pb2.py
If I generate them into my python source directory; then, importing those modules works as expected.
However, I do not want to ...
0
votes
0
answers
13
views
how to write a small, complete example of an Annotation Processor with maven?
I need to implement an Annotation Processor that generates a Java class related to the annotated class. However, my biggest challenge at the moment is understanding how to use Maven to implement such ...
2
votes
0
answers
42
views
Isar Generator Constructor parameter type does not match property type when using super
I am using clean architecture for my project and want to add a database to my application so I decided to use isar database but because of clean architecture I need my isar collections to be only on ...
1
vote
2
answers
58
views
Stack overflow during compilation on large list literal in OCaml
I have a small project for checking if a number is prime. The idea is to prepare (generate) a list of primes up to a certain point for the library function to use (use a code generator for that).
...
0
votes
0
answers
11
views
Finding sourcegenerated files
I am using VS 17.8.0 Preview 7.0. And I get two errors while compiling the source generated from a razor file. But I can't find the *.g.cs files at all. They should be in the obj folder as far as I ...
1
vote
0
answers
104
views
How come gcc 13.1 does not generate any code when including <iostream>?
Let's say I have a very simple program like this:
#include <iostream>
int main()
{
return 12;
}
When compiling this program with gcc (from gcc-4.x to gcc-12.x), the generated code is ...
0
votes
0
answers
29
views
Error with compile-time logging code generation in Microsoft.extension.logging
I have an application with several projects. To refactor the way we handle logging in our application, I created a logging project with a specific provider using the ILoggerProvider interface. I also ...
0
votes
1
answer
134
views
How to generate unit tests for Python using src and test folder structure (preferable with PyCharm integration)?
In my python project I have following folder structure:
src
foo
foo.py
baa
baa.py
test
foo
baa
and would like to generate a unit test file test/foo/test_foo.py that tests src/foo/foo....
0
votes
0
answers
19
views
Issue Generating ObjectFactory.java and package-info.java with jaxb2-maven-plugin
I am currently facing an issue while using the jaxb2-maven-plugin to generate Java classes from an XSD in my Maven project. The problem is that the ObjectFactory and package-info.java classes are not ...
0
votes
0
answers
24
views
How to test code generator(written in python) which generates .c,.h files?
I am trying to test a code generator tool to verify if it's generating code(and files) as per some requirements. The tool is written in python. The inputs to the tool is a JSON File. The outputs of ...
1
vote
1
answer
45
views
Query : Training LLM on custom library for code generation?
I wanted to train LLM with a custom library with tons of functions. Intent is to able to generate code given LLM trained on this custom library. As the library is pretty huge I run out of tokens when ...
1
vote
0
answers
26
views
Why is the difference between the code generated in postman and by httpsnippet?
I was trying to use httpSnippet to generate client-code in C# and I got
var client = new RestClient("https://api.apyhub.com/extract/text/word-file");
var request = new RestRequest(Method....
0
votes
0
answers
37
views
Two-way Matlab/Simulink<->C++ workflow
I'm trying to figure out an efficient close-loop workflow where I can:
take a simulink model and convert/generate c++ code
take said outputted c++ and covert it back to something that can run as a ...
0
votes
1
answer
29
views
Matlab Codegeneration Issue, parameters replaced by constants
We have been trying to update some autogenerated code we had in matlab2013a to matlab2022b version, because we changed toolchain and dependencies.
To do so, we opened the configuration parameter ...
2
votes
1
answer
52
views
Are each variations of a .resx file supposed to generate their own Designer.cs file?
I haven't been able to find much about how .Designer.cs files work in relations to .resx files in the official docs, and Googling for this kind of situation hasn't resulted in any useful information.
...
1
vote
0
answers
38
views
Handling Assignment Expressions with 'When' Clauses in Compiler Code Generation
the compiler is divided into the front-end (that parse the source
program) and the back-end (that generates the machine code). In turn, the front-end is
divided in three phases:
the lexical analysis ...
0
votes
0
answers
52
views
How to generate server code from an OpenAPI Specification (OAS) in Django Rest Framework?
I'm working on a Django Rest Framework project, and I have an OpenAPI Specification (OAS) file that I'd like to use for code generation. My goal is to automatically generate API endpoints, serializers,...
1
vote
0
answers
59
views
URL encoding in path parameter with Chi
I used oapi-codegen to generate go code from an api yaml specification. The generated code is compliant with the Chi router. The generated code for this path looks like
r.Group(func(r chi.Router) {...
0
votes
1
answer
41
views
How to use common expression elimination together (CSE) with codegen
I'm trying to use sympy.utilities.codegen. I need compute a complicated function and its derivative. As a simplified example the function f is
x = Symbol('x')
y = Symbol('y')
f = 1 / (x - y)
df = f....
-1
votes
1
answer
183
views
Avocode / Ceros Inspect alternative
since Avocode and also Ceros Inspect software was sunset recently, is there any good alternative for software that opens Adobe XD files and generates CSS codes?
0
votes
0
answers
23
views
How do I add source code generated by a tool to my Netbeans Ant project?
I'm using ANTLR4 to generate a parser and lexer for a project with Netbeans and Ant. I was able to add a "-pre-compile" target override to my build.xml that executes the ANTLR4 tool to ...
0
votes
0
answers
18
views
How to handle compilation wiht code generated through code generators in .net?
Disclaimer, i am relatively new to .net and am not using it in a professional environment.
I am currently playing around with the newest HotChocolate graphql library for .net which uses code ...
0
votes
0
answers
25
views
How can we perform code generation based on KotlinDSL
Is there a simple(or not so simple) way to generate code based on KotlinDSL. I am facing an application that needs to expose an API distributed over different nano services. I have a DSL describing ...
0
votes
1
answer
82
views
Azure Build Pipeline fails when having a Source-Generator
I created a source generator using the IIncrementalGenerator Interface provided since .NET6. When I run the build locally everything works fine and my files get generated. Even when running a local ...
0
votes
0
answers
74
views
Converting XSD to Java classes using Castor 1.4.1
I have been using Castor version 0.9.3 to convert XML schema definitions (XSD) to Java objects by unmarshalling XML to Java objects. Here is how I included Castor 0.9.3 in my project
<dependency>...
0
votes
0
answers
56
views
Generation of source code based on specification files
I am starting a new project in Scala (my first one in this language) and I'm trying to automate modelling my main data class. I want to have a specification file from which I can just generate the ...
0
votes
0
answers
11
views
Calling CMake function with list arguments [duplicate]
I'm programming a c++ library that utilizes automatic code generation. I'm using the CMake command add_custom_target() to do so. As there are multiple separate parts of the library that will use code ...
1
vote
1
answer
24
views
How to pass log4j-core to xmlbeans maven generation phase?
I found the description of the xmlbeans 5 maven plugin configuration.
It tells to add the dependency on log4j-core of the schema generation to the configuration.
However, it seems not to work. I still ...
0
votes
0
answers
39
views
How to generate types from a json schema with IDEA Golang?
I saw in another topic that IntelliJ has an option menu to generate a POJO from a json schema,
but where is the equivalent function in IDEA Golang?
When I click on a schema.json file or .json file, ...
0
votes
0
answers
18
views
Do FAANG companies use code templates and generation for services and what do they use?
If you are a company with coding standards, and you want certain types of services to have the same structure, it seems like you would want a template for certain service types. For example, maybe you ...
0
votes
0
answers
178
views
datamodel-code-generator can't handle JSON Compound Schema Document
I am trying to turn a JSON Schema into a pydantic model using datamodel-code-generator. The Schema is a Compound Schema Document, meaning that $id is used in a subschema. It leads to issue related to ...
0
votes
1
answer
28
views
ZHS Permission Problem on Proton generation on MacM1
I am using Apple MacBook Air with M2 Chip to develop softwares and etc. Currently my company using protocol buffers to serialize entity models. I am having issues with generating Dart files through ...
0
votes
0
answers
87
views
Can I automatically populate the AutomationId property of .NET MAUI controls?
I am looking for a way to automatically populate the AutomationId property of .NET MAUI controls in the pages of an app.
I have begun looking into .NET source generators with the great series "...
0
votes
0
answers
52
views
How to automatic generate variable in neovim like in Jetbrains IDEA
when new a ArrayList in Jetbrains IDEA , like:
new ArrayList<String>()
then write '.var' at last
new ArrayList<String>().var
then press Tab,IDEA automatic generate the local variable
...
0
votes
0
answers
18
views
Flutter: download dart code and create class instance dynamically at runtime
In my app I want a option to have user to download dart code that contains a class and which extends a baseclass defined in the app and override it's methods.
I need to create the instance of that ...
0
votes
0
answers
23
views
GetSymbolInfo returning null for attribute in source generator
I'm trying to make a source generator that's triggered based on an attribute being set on the class. I'm wanting to get the name of the class that's decorated with the attribute, but when I run the ...
1
vote
0
answers
198
views
Flutter build_runner throws InvalidType is not a class element
After updating Flutter to v3.13.0 & Dart v3.1.0 (stable channel as of 23 Aug 2023)
My code generation has broken.
It was working perfectly fine for versions v3.10.6 & Dart v3.0.7.
Here is my ...
1
vote
1
answer
43
views
Protogen goroutine stack exceeds
Recently i've run into a problem with code generation in golang. I have a huge proto file and now need to add logging to most of the messages, using external package. However, if i add logging for too ...
0
votes
0
answers
30
views
Problem with state machine code generation
I'm testing EA code generation in v 15.2 for state machines containing substates.
I use "Example Model/Model Simulation/State Machine Models/Nested Traces" as eaxmple for C++ code generation....
0
votes
1
answer
50
views
Is there a way to skip generating a class using JAXB XML to Java?
I have a schema that I'm trying to use (unmodified) to create Java classes / enums with XJC. However for a couple of the implemented classes, I have a different implementation.
So I'm using the normal ...
0
votes
1
answer
95
views
Is there any tool for eclipse or as CLI which can create repositories for JPA Entity Classes
I have lot of JPA Entity Classes and I have to write service and repository classes for all Entities, Manually it may take lot of time to write each and everything from scratch.
I have Create Entities ...
0
votes
0
answers
194
views
How to prompt engineer/ context for llm (Code Generation)
I am building a natural language to sql application and for that im using:
https://teknium-replit-v2-codeinstruct-3b.hf.space/
using its api, im generating sql code but I dont know how to provide ...
0
votes
1
answer
36
views
How would I reduce the amount of duplicated code that only differs by .await -ing the async functions? [duplicate]
I have a codebase that I am working on in Rust and I intend to have sync and async versions available through a feature flag, as I thought that was the best way to make sure the whole ecosystem ...
1
vote
2
answers
379
views
What to run instead of flutter packages pub run build_runner build --delete-conflicting-outputs
My Flutter app requires code generation for multiple reasons, such as mock generation for tests, or both Floor and Isar persistence back-ends require generation. I achieve this by executing flutter ...