Lunching atl files using ATL plugin - uml

I am using ATl plugin to lunch atl using java class.
Before i was running ATL files by using ATL configuration wizard.
The input i was giving in the configuration were:
ATL Module: sample.atl
Metamodel UML: sampleprofile.uml
Source Model system: samplemodel.uml
Target: output.uml
After running the output was the correct and the one i wanted.
The problem is that when i use the ATL plugin to lunch the atl files it only requires me as input:
Name of the ATL file and Name of the metamodel.The problem is that i dont know where to specify the samplemodel.uml. Because this should be also as input. Therefore the output.uml i am getting is not the one i am expecting to get.
Does anyone know how can i specify this second file inside the generated java class ?
Thank you in advance!

you don't need to change the generated java class. Just import the generated class (for instance Families2Persons) from your java program and launch the transformation like this:
Families2Persons runner = new Families2Persons();
runner.loadModels("/pathto/samplemodel.uml");
runner.doFamilies2Persons(new NullProgressMonitor());
runner.saveModels("/pathto/output.uml");
If you want you can also launch the transformation from command line passing the two paths as arguments.

Related

RoslynPad: could not load file or assembly exception

I am using RoslynPad project to test how external plugins (Class libraries) could be used in the script.
I have created Class Library with a single class and method.
In roslynPad project i have added "plugin_demo" into RoslynHostReferences NamespaceDefault structure.
I have also added reference to plugin dll:
MetadataReference newref = MetadataReference.CreateFromFile("G:\\projects\\demos\\plugin_demo\\plugin_demo\\bin\\Debug\\plugin_demo.dll");
MetadataReferences = MetadataReferences.Add(newref);
Now i see that my new class is seen by diagnostics and autocomplition also works.
The code with a method call compiles fine.
But when i run it i get exception:
Could not load assembly or file. File not found.
I have copied plugin_demo.dll into directory where compiled roslynPad dll resides. Still no result.
I have checked that class library and roslynpad use the same .Code version.
What can be the problem?
What is correct way of adding assemblies to roslyn project?
Thanks
I have solved the problem after debugging. The roslynPad project generates file nams_deps.json when editor is launched. It must be deleted and after that the assembly is found.

How to convert picocli groovy-grape script to native standalone app?

I have a made my first groovy CLI app with picocli. Now, I want it to be available for use without any JVM installed on the client machine, maybe with the use of GraalVM.
This is for an opensource project:
https://github.com/kchaitanya863/db2csv
Another easy option is to dockerize your script (read this blog about how to do it https://groovy-lang.gitlab.io/101-scripts/docker/basico-en.html)
If you want to build a linux executable you need to change your project:
convert to a gradle project (maven is also an option but gradle has a lot of plugins)
change your script to a class with a tipical main (and move it to the standard directory src/main/groovy/mypackage)
add some tasks into you build.gradle similar to these https://gitlab.com/snippets/1797638
You will need to:
statically compile your groovy script
make the args variable available after static compilation with
final String[] args = getProperty("args") as String[]
specify a reflection configuration file for the classes dynamically loaded/invoked using reflection by Groovy (this may be useful)
specify a reflection configuration file for the classes loaded/invoked using reflection by picocli. The picocli-codegen module provides a picocli.codegen.aot.graalvm.ReflectionConfigGenerator tool to generate the configuration file.
If your script has any #Grape dependencies, you may need to turn off the Grape dependency manager with -Dgroovy.grape.enabled=false and add all dependencies to the classpath manually instead
Credit: I got most of these tips from this article by Szymon Stepniak
If you want to use Graal with Groovy, check out this article:
https://e.printstacktrace.blog/graalvm-and-groovy-how-to-start/

is it possible to export classes that are on C++ dll?

I have some C++ project that i writing as dll - ( unmanaged code - not cli )
I want to create some class and export this class to other project that will import this dll
Is it possible ?
How to do it ?
In Visual Studio, you have several alternatives:
In your project, you can simply create a Reference to another project. I think this is probably the option you're looking for.
You can also use a .DEF file or add a __declspec in your code (or better, in a header file). You just need to make sure the .dll is in your runtime %PATH% when you execute your program.

VS CShellManager not declared

I have downloaded an API to further develop it and this error appears: C2065 CShellManager not declared. I guess it might be declared in a library which is not included by default, but it should be in the zip I have downloaded. How can a look for the declaration of this class in order to know the file in which is declared and to include this library in the source code?
The CShellManager class is a part of MFC framework. It is defined in afxshellmanager.h header file.
This class was introduced in VS 2008 as part of so called MFC Feature Pack.
Basically it is only required if your project uses CMFCShellTreeCtrl and such. If this is the case then you need to call CWinAppEx::InitShellManager() in OnInitInstance() of your app class to initialize the instance of the Shell Manager.

Sharing classes between multiple TypeScript files using Node.JS Tools for Visual Studio

I am currently working on a Node.JS project written in TypeScript using Node.JS Tools for Visual Studio (NTVS). I have a few classes and enums spread out in 3 or 4 files in my project. I am now trying to use the classes defined in those files from my main app file. From my previous work with Node, I know that I would normally need a require call to import each other file/class if I were working with a text editor and the command-line compiler. But, if I open any TypeScript file in my project and start typing the name of a class defined in a different file, Visual Studio shows IntelliSense autocomplete for the class name and its members. This makes me think that the NTVS and/or TypeScript configuration are automatically making all of my classes available project-wide. But if I click the 'run' button, errors are printed to the console because Node can't find the referenced classes at runtime.
This behavior leads me to believe that IntelliSense isn't actually telling me that the classes are available, just that they exist (which seems odd). If I add a require call to the top of the file, and use that imported value instead of the original class name, Node finds the class and I can use it in my code. But this presents two problems:
I must come up with a new name to use for the variable that I import the class into. If I require() it with the original name, Visual Studio shows errors saying that the identifier is a duplicate, because it seems to believe that the original class is available project-wide.
I don't get the autocomplete or type checking in my usage of the class. This pretty much defeats the purpose of using TypeScript.
So, what's the proper way to do this import? Is there a way to make all my classes available globally? If not, what import statements do I need?
This behavior leads me to believe that IntelliSense isn't actually telling me that the classes are available, just that they exist
unless you have top level import or export statement the file is considered a global module and is available project wide : http://basarat.gitbooks.io/typescript/content/docs/project/modules.html
A global module will not work at runtime in node.js
You should use file level modules using import/export and compile with --module commonjs

Resources