code-generation

Diff two methods in eclipse

隐身守侯 提交于 2019-12-25 07:59:15
问题 I have an eclipse which generates java code. So if a method is there and is regenerated I want to show the old method and the newly generated one so the user can see the difference. Is this possible? 回答1: If your code generator is the one used by default by EMF, you can copy the generated method, and remove the @generated tag to the original one, then simply suffix the copied generated method with Gen and keep the @generated tag. For instance : /* original code */ public String getName() { ..

How to run a script\executable before start debugging in VS2015?

守給你的承諾、 提交于 2019-12-25 06:31:10
问题 I need to run a code generator before starting compilation\execution of my code in Visual Studio 2015. Is there any way to add a script that will run my .bat.py file when I click "Start Local Debugger"? I use UnrealEngine 4 and in my project there already are some .cs files that use precompilation scripts, but these scripts are not fired if the project is already up-to-date. Any solutions? 回答1: Open properties of your startup project in VS (should be your game, not UE4). You need

Has anyone used any .Net code generation frameworks in Mono? (Subsonic, .netTiers, etc..)

主宰稳场 提交于 2019-12-25 04:34:11
问题 Mono appears to have really come a log way since the last time I really used it. I'm interested in doing some ASP.Net development using Mono. I have used .netTiers/CodeSmith at work and really enjoy the speed with which code generation gives you a clean working data access layer. The question is has anybody used any code generation with Mono? I am open to learning something like SubSonic or NHibernate if those work better with Mono. Thanks in advance for any help. 回答1: I have used subsonic

Has anyone used any .Net code generation frameworks in Mono? (Subsonic, .netTiers, etc..)

荒凉一梦 提交于 2019-12-25 04:34:05
问题 Mono appears to have really come a log way since the last time I really used it. I'm interested in doing some ASP.Net development using Mono. I have used .netTiers/CodeSmith at work and really enjoy the speed with which code generation gives you a clean working data access layer. The question is has anybody used any code generation with Mono? I am open to learning something like SubSonic or NHibernate if those work better with Mono. Thanks in advance for any help. 回答1: I have used subsonic

Template- and manifest-based Code Generation for Java

佐手、 提交于 2019-12-25 03:27:25
问题 I am building a heavily plugin-based application. The plugins communicate via a shared message bus. For several obvious reasons, including assurance of type safety, I end up writing code similar to this: public class OtherPluginController { ... public void doSomething(int intParam, String stringParam) { Command cmd = new Command(); cmd.target = "OtherPlugin"; cmd.name = "doSomething"; cmd.params.put("intParam", intParam); cmd.params.put("stringParam", stringParam); MessageBus.emit(cmd); } ...

How can I automatically generate a constructor that receives and stores services for free?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 16:26:31
问题 Problem I regularly find myself manually typing out code that looks like this: public class SomeClass { readonly ServiceA serviceA; readonly ServiceB serviceB; public SomeClass(ServiceA serviceA, ServiceB serviceB) { this.serviceA = serviceA.; this.serviceB = serviceB; } } Requirements I would like to save time by having a way to generate as much of this as possible. I don't want to use a tool that requires a purchase. The only information that is variable here is the class name and the types

How to generate entity classes from nhibernate mapping files during runtime

怎甘沉沦 提交于 2019-12-24 16:20:28
问题 i need some help with c# and nhibernate. I'm working on a project that requires the entity classes to be generated from hbm files at runtime. I get the mapping files from a service, and then need to generate the classes dynamicaly and configure nhibernate to use them. The problem is that i'm new to nhibernate and not much of a pro in c#, so me writing the piece of code that achieves this is very error-prone. I was wondering if you know of any open source software that i could use. Worst case

C# generics wrapper generator

白昼怎懂夜的黑 提交于 2019-12-24 15:57:38
问题 I'm looking for a code generator (preferably with source) that will allow me to generate wrapper classes (using reflection) for generic classes that i have in my code. I've done a bit of searching but can't seem to find anything that will do what i need here, so i thought i'd ask here before i start writing my own. Ultimately, i'll probably have to write my own but would like to at least get a head start if someone's already written something like this. It's a little difficult to explain what

Isabelle's Code generation: Abstraction lemmas for containers?

馋奶兔 提交于 2019-12-24 14:12:39
问题 I am experimenting with the Code generator. My theory contains a datatype that encodes an invariant: typedef small = "{x::nat. x < 10}" morphisms to_nat small by (rule exI[where x = 0], simp) definition "is_one x ⟷ x = small 1" Now I want to export code for is_one . It seems that I first have to set up the data type for the code generator as follows: code_datatype small instantiation small :: equal begin definition "HOL.equal a b ⟷ to_nat a = to_nat b" instance apply default unfolding equal

How to generate the method stubs for all un-implemented methods in interfaces/abstract classes using eclipse?

北城余情 提交于 2019-12-24 14:10:32
问题 In eclipse I have the following problem very often while writing java code: While coding (especially in the early time of coding) I often have to change interfaces until everything fits well. If I change such a Superclass I have to modify every single Subclass to implement the method. This is clearly necessary to make the whole code run but I would like to test things without having to code every in a single bit. Further the trick with Opening the class Clicking on the (errorous) class name