in

The ORM Foundation

Get the facts!

Contributing to the project?

Last post 11-23-2013 0:01 by artyom. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-18-2013 6:53

    • artyom
    • Top 200 Contributor
      Male
    • Joined on 05-13-2012
    • Almaty, Kazakhstan
    • Posts 2

    Contributing to the project?

    Hello all,

    I've implemented a basic transform from DCIL to D4 (it's the programming language used in Dataphor, please see http://www.dataphor.org), and used it to import my ORM model into Dataphor. Some features are still lacking (e.g. mapping of decimal places), but I'll hopefully resolve some of them over the next few weeks.

    I've tried to build NORMA on Visual Studio 2012, but couldn't (build fails for some reasons), so the way I'm using at the moment is a bit long-winded:

    1. I open up the solution which is located in the XML\DIL subdirectory of the current trunk (I did an svn checkout)
    2. then I add the transform as a new file, and run it, specifying the XML file that I get from NORMA (which is installed on my machine)

    So it works, and I'm planning on adding some other features to it. However, I would like to build NORMA properly, so that the D4 transform could be integrated into the next versions of NORMA.

    Now my question is, I guess, what's the way forward? Will somebody incorporate the changes for me, or help me with troubleshooting my NORMA build on VS2012, so that I could send a proper patch?

    The DCIL to D4 transform is located here: https://gist.github.com/ashalkhakov/7526578

  • 11-18-2013 19:00 In reply to

    Re: Contributing to the project?

    Hello Artyom,

    Thank you for your interest in NORMA. There are several approaches here ranging from direct NORMA integration to installation of your own Dataphor-specific extensions handled as an add-on to NORMA.

    I had not heard of Dataphor until this post, but they appear to be located a few miles south of my location. Are you associated with the company, or an external power user?

    Adding generation transforms is pretty straightforward and can be done without a full NORMA build. These aren't really DIL, which is an XML language that represents traditional SQL (DDL and DML) constructs. So, a D4 generator would go in its own directory.

    (For the casual reader, the rest of these is boringly technical. We should take details beyond this off line).

    The VS2012 build process should run as described in the README.txt file in the source root directory. The development builds are designed to run in the standard Visual Studio Experimental environment (devenv.exe /rootsuffix exp). While you can easily attach and debug a setup-installed NORMA from the source tree, I strongly recommend against trying to build the project with a setup install already in place, unless you enjoy hand-cleaning the global assembly cache (GAC).

    The sourceforge repository is mirrored off of a private repository, I don't use it for live development.

    To build, you need the prerequisites (VS2012 Pro, VSSDK, DSL Tools SDK, PLiX installer that comes with NORMA). This should let you run FirstTimeBuildVS2012.bat from a VS2012 command prompt (as administrator recommended). This runs the BuildDevTools.bat and Build.bat files for VS2012. I've seen odd build error ordering issues with BuildDevToolsVS2012.bat, just keep running it until it runs cleanly (I know this doesn't sound encouraging, but this only needs to be run once per the lifetime of a machine). After the devtools build cleanly, BuildVS2012.bat /t:Rebuild will give you a clean build of the rest. I do not recommend the BuildAll*, BuildTests*, or BuildSetup* variants as these need significantly more stuff. The magic environment variable for VS2012 is TargetVisualStudioVersion=v11.0. This needs to be set before opening any of the *VS2012.sln files.

    Do not run the regen all files in a solution. This regenerates all of the PLiX files (my XML-based code generation system), plus all of the DSL-generated files (the T4 templates shipped with the DSL toolkit). I've had to make several changes to the stock DSL generators to handle everything from naive handling of 1-1 relationship handling to valid XML doc comment generation. However, these templates are not open source and I do not have the rights to post them publicly, so you'll need to get them from me privately. I also haven't tried the VS2012 DSL generators (the 2005 code works for 05 and 08, 2010 works for 2012) and don't have the corresponding template tweaks, so I guess I'm not 100% build capable on VS2012 (I also haven't ported all of the testing bits to all platforms).

    Having said all of that, you don't really need to build the full project to install generators. The NORMA code generators are only loosely attached to the designer (one registry entry to add ORMCustomTool to any .orm file in a project, one automation object callback to get a snapshot of the current (potentially unsaved) XML, and another automation object callback to turn on required extensions). (Sorry, this is far from obvious) All of the generators are installed when the ORMCustomTool generator is built, which calls Tools\ORMCustomTool\Install.bat. The easiest approach to add your own extensions is to just copy that file and blow away most of it. The 'setupenvironment' call at the top is important. You can also edit the SetupEnvironment.bat file to install against the main VS branch instead of a debug build (search for Exp in that file).

    The .sln files under the XML directory are for convenience and are not part of the build.

    -Matt

  • 11-23-2013 0:01 In reply to

    • artyom
    • Top 200 Contributor
      Male
    • Joined on 05-13-2012
    • Almaty, Kazakhstan
    • Posts 2

    Re: Contributing to the project?

    Hello Matthew, Sorry for the delay.
    Matthew Curland:
    I had not heard of Dataphor until this post, but they appear to be located a few miles south of my location. Are you associated with the company, or an external power user?
    We are not associated with Alphora, just an external user. We are currently implementing some new features needed in a project, and our branch of Dataphor 3.0 is freely available (please see https://bitbucket.org/dshalkhakov/dataphor). I wrote a few emails to Alphora and DCG, but didn't hear anything back. Perhaps you could visit them? I think Dataphor would be a great compilation target for ORM.
    Matthew Curland:
    Adding generation transforms is pretty straightforward and can be done without a full NORMA build. These aren't really DIL, which is an XML language that represents traditional SQL (DDL and DML) constructs. So, a D4 generator would go in its own directory.
    After a week of using the DCIL to D4 transform, I am now thinking that a full integration into NORMA is not necessary, so an external generator suffices for our needs. I will probably create a new project on Bitbucket or GitHub, and create a batch file for piggy-backing it onto an existing NORMA installation in the system. Thank you very much for giving the gory details of building NORMA from scratch. I will probably not use this knowledge for now, unfortunately. However, it would still be interesting in its own right to figure out how NORMA works. For instance, what is sorely lacking in NORMA is support for value comparison constraints (or queries, but that is a much bigger undertaking, presumably), and I think it could be added.
Page 1 of 1 (3 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service