Re: Project Template Questions

From: David Avendasora (webobject..vendasora.com)
Date: Sun Apr 12 2009 - 06:26:03 EDT

  • Next message: Ramsey Gurley (JIRA): "[OS-JIRA] Created: (WOL-992) Entity Modeler eats factoryMethodArgumentType = EOFactoryMethodArgumentIsNSData;"

    Okay,

    I got it working. To get:

    MyProjectJCBuilder.launcher

    I used:

    __projectName__JCBuilder.launcher

    If I had paid more attention to the markup in the WIki it would have
    been obvious. In several places you had just missed the escape
    character on one of the underlines so the wiki was dropping it.

    With that said, When using the __ notation, I wasn't able to make the
    dots work at all. I had been using ${WOLipsContext.getProjectName()}
    to get the Project Name because that is how it was used in the example
    project. It turns out that simply using ${projectName} works just
    fine. I did need to use the dot so that in the build.properties file I
    could get the lowercase version of $projectName, but the dot works
    when using the normal Velocity markup.

    Thanks Mike for the additional explanation. I've updated the Wiki. If
    you get a chance, I'm sure it could use a once-over to make sure I got
    things right.

    Dave

    >

    On Apr 11, 2009, at 10:57 AM, Mike Schrag wrote:

    >>> In addition to variables inside of Velocity templates, you can
    >>> also use template inputs in folder names. However, because $ is
    >>> not allowed on some filesystems, we instead surround the variable
    >>> names with "_" (for instance $someVariable would be
    >>> __someVariable_ in the filename or path).
    >>
    >> Wait. Two "_" in front, and one after? Does that mean that it is
    >> using one "_" for the $, and one each for the "{" and "}" ?
    > Oh, weird -- yeah well, this is what you get when I write something
    > fast :)
    >
    > I think it's two __ in front and back -- you replace ${ with __
    > and } with __, so ${something} becomes __something__. I don't think
    > I ever tried one with dots, but I would expect it to become
    > __something.with.dots__
    >
    >>> As an example, the Wonder Application template has an input named
    >>> "basePackage" (of type Package), which creates a magic variable
    >> What is a magic variable as opposed to a normal variable? I'm
    >> guessing that's just literary license because the whole thing is
    >> almost magical, but it leaves doubt in my mind that I've missed
    >> something. Am I just nit-picking? I think so, but I'm just not
    >> entirely sure.
    > A magic variable is one that gets generated for you ... If you
    > declare a type "package" there is automagically a dependent variable
    > that generates a variant where that package's dots are replaced by
    > slashes, which will expand to folders when you use that variable in
    > the filesystem.
    >
    >>
    >>> named "basePackage_folder"
    >> What was the non-file/folder variable? was it $
    >> {basePackage.folder}? $basePackage.folder? $basePackage_folder? I
    >> don't know because in the example up to now, it's always referred
    >> to as basePackage.
    > there is ${basePackage} and a generated ${basePackage_folder}
    >
    >> Where did the "folder" come from?
    > That's what it was trying to say ... If your variable type is
    > package, you get an automatic _folder variant that has slashes in it.
    >
    >
    >>> (where the dots are turned into slashes)
    >>
    >> Slashes? Is that supposed to be "underlines"? Or does it mean that
    >> the dots in the package variable are turned into back-slashes as
    >> file delimiters? Being uncertain about this makes the following
    >> line even less clear.
    > #2
    >
    >>
    >>> , and the Source folder on the filesystem is named "Wonder
    >>> Application/Sources/_basePackage_folder_".
    >> What? No it isn't. In the template project that works, it is just
    >> called "__basePackage_folder__" (note two "_" before and after) and
    >> is located in the template "Sources" directory.
    > I'm not sure why these are missing the __'s ... typo.
    >
    >> I want to use the Project Name entered in the new project wizard to
    >> name a file in my project. Such as:
    >>
    >> MyProjectJCBuilder.launch
    >>
    >> I've tried:
    >>
    >> _WOLipsContext_getProjectName_JCBuilder.launch
    >> __WOLipsContext_getProjectName_JCBuilder.launch
    >> __WOLipsContext_getProjectName__JCBuilder.launch
    > can you use getProjectName without the (), I don't recall what the
    > restrictions are, but whatever you put in a regular template,
    > replace ${ with __ (two underscores) and } with __ (two underscores).
    >
    >> _WOLipsContext_getProjectName_
    >> __WOLipsContext_getProjectName_
    >> __WOLipsContext_getProjectName__
    > that middle underscore is wrong (should be a dot), at the very
    > least, and maybe you need getProjectName() -- I remember there's
    > somewhere where that is enforced in a weird way in velocity. But
    > like I said, I don't think I've ever used a . notation in this
    > syntax before -- only the single variable name ones.
    >
    > ms



    This archive was generated by hypermail 2.0.0 : Sun Apr 12 2009 - 06:27:35 EDT