19:00, EET
December 21, 2022
11:41, EET
Moderators
February 11, 2020
Hello,
At the moment, CodeGen does not have support for omitting the generation date. This could be implemented in a future version.
If you’re working on a Maven project, you could consider using the CodeGen Maven plugin. This would allow you to generate the classes as part of the project’s build process and you wouldn’t need to include the generated classes in your Git repository. See CodeGen’s manual for more information on integrating it into a Maven project.
13:12, EET
December 21, 2022
9:50, EEST
April 3, 2012
Hi,
Sorry for the confusion, but seems this was already done at some point, but not documented (other than a small mention of https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_4_Release_Notes.html#version-4-3-0).
In the configuration (maven or the standalone) do
<generates>
<generate>
…
<timestampOutputs>false</timestampOutputs>
</generate>
</generates>
…
And then it shouldn’t output the javadoc at for the type (that basically only included the timestamp).
12:19, EEST
December 21, 2022
Thanks Bjorn, it works perfectly.
I have another problem when syncing files to Git:
every time i run the CodeGen, the “___Ids.java” files have the methods in different order. Same thing for the list of interfaces in the “Ids.java” file.
Is it possible to always have them in the same order?
So I don’t see modified files on Git.
Thank you,
Andrew
13:08, EEST
April 3, 2012
Hmm good point, I think we have not that much checked them. I don’t think that is doable directly without us making a new release (and I cannot guarantee that it would be in the next one, but let’s see). We do currently use a lib called JavaPoet, so it depends does it have deterministic output, but I think at the moment the Codegen just has internally things in a Set etc. so the output might not be deterministic due to that.
However, maybe instead an alternative solution could be to run some sort of an auto-formatter externally after you have run the generator? For example: https://github.com/google/google-java-format. Though, as an idea maybe we could include something like that internally and just format the output regardless (maybe with a flag to control), but that is something to be investigated later. In general I would assume you to have something similar for non-generated code anyway (that formats them when you save the file), maybe you can just run that manually.
P.S.
One option also, depending how much you like is to have a separate part that generates the model, produces an artifact that is included to the real project as source code dependency (e.g. in maven dependency plugin to unpack and include it as extra sources via the build helper plugin). Though, you would need to exclude any files you wish to modify manually. Technically method implementations can also be plugged from the outside, so the only thing requiring manual modifications is if you wish to store some state in the XXXTypeNode(s).
Most Users Ever Online: 1919
Currently Online:
54 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 734
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1