How to specify AssemblyVersion in LLBLGen? - llblgenpro

I'm using LLBL Gen Pro 3.5 command line (CLIRefresher and CLIGenerator) to create the solutions.
It automatically creates a AssemblyInfo.cs which contains this code:
AssemblyVersion("1.0")
I want to set it to another version while building the project. For example:
AssemblyVersion("2.1.0.234")
Question1: How can I tell LLBL to create the project with this version?
Question2: If it is not possible, how can I tell LLBL NOT to create this file, so I can add this file later using MSBuild?

A1: you can, through a custom template for assemblyinfo. It's bound in the file SD.TemplateBindings.SharedTemplates.templatebindings in the folder \Frameworks\LLBLGen Pro\Templates
You can define a new binding by creating a new templatebindings file, store it in the folder you define as 'AdditionalTemplates' folder in the project properties, and you should give that templatebindings folder a higher precedence than the one you're 'overriding' (or move it up in tab 2 on the code generator config dialog). See the SDK docs for details.
A2: It is possible, see A1. But here's the thing: this file is written once (done in the preset you're using to generate code). If the file exists the next time you generate code, it's left alone. This means that if you change it, e.g. by giving it a different version number, it won't be overwritten.
So while you could change the template easily, in this case it's not needed: you can do whatever you want with the file after it's been generated, it's not generated again.
(ps: please ask questions about LLBLGen Pro on our forums at http://www.llblgen.com/tinyforum, as we don't monitor stackoverflow that regularly. Thanks)

Related

Xcode Input File vs Input File list

I am using Carthage to add the CSVImporter library to my Xcode project. To add the framework to my project, it says to create files named input.xcfilelist and output.xcfilelist. Then, one must add the paths to the needed frameworks to those files. Finally, it says to add the input.xcfilelist to the Input File Lists section and likewise for the output.xcfilelist. I seem to not be able to create distinct files with frameworks as sub-sections of the file. Is it enough to just add the frameworks directly into the input and output file sections?
In my understanding, you can add every single framework into Input Files part. You also can create the InputFile.xcfilelist and put all your frameworks into the file. There's no difference.
You just create any file change the format to .xcfilelist should works.

How to customize generated Source Code Using Altova Mapforce Project

Background: When I generate the code for my mapping project, only one map will run, regardless of which file type I send in to the command.
I would like to modify the project code generation so that when the maps are generated the applicationConsole.cs allows multiple files and file types, and chooses the appropriate map based upon the parameters I send in.
so far, my project contains 4 maps, each one is different and has a parameter indicating whether or not to run the map. Once the code is generated, the applicationConsole.cs does not differentiate when running the maps. the first map listed in the applicationConsole.cs is run and the others are not. if the first map matches the given parameters, the output is correct, but if the next file coming in does not match, the console closes rather than moving on to the next map.
I am trying to avoid direct manipulation of the applicationConsole.cs, due to having to generate the code frequently.
the question: Does anyone know how to modify the output of Mapforce Project code generation to add a switch for map type based on file type?
In altova mapforce Application Install Directory,there is one SPL Directory. this is generate auto generate code as per your selected Language.
Take the backup of that Directory and modify SPL Directory code as per your requirement.
You need to learn SPL (Spy Programming Language) .
http://manual.altova.com/Mapforce/mapforce-enterprise/index.html?cgthewaytospl(spyprogrammingla.htm
If you need anything else then please inform me here. I have Good command on Customize the SPL.
Thank you
Take a look at refactoring under Java and C#
Really when you look at the stub code generated and you need to combine a couple maps the first refactoring task is to rename the namespace, Altova uses it's namespace as a default, so a mapa namespace would be helpful mapb namespace etc.
I'll provide the C# examples
http://msdn.microsoft.com/en-us/library/vstudio/6kxxabwd.aspx
Then you have the console app so you want to copy the applicationConsole.cs and rename it your project name or class name and then extract the method
http://msdn.microsoft.com/en-us/library/vstudio/0s21cwxk.aspx
Finally you would want to extract the interface so as to return the exception Constructor
http://msdn.microsoft.com/en-us/library/vstudio/fb3dyx26.aspx
and:
http://msdn.microsoft.com/en-us/library/tz6bzkbf.aspx
What you would have is a project with your start-up being the original applicationConsole.cs that you copied and renamed in a project or solution folder. When you update the map you should be able to over-write the code in that folder with what Mapforce generated.
This file was generated by MapForce 2013r2sp2.
YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
Refer to the MapForce Documentation for further details
This is what you will see in that file, use the technique outlined above and the tool is very easy to use. If you are a desktop programmer the refactoring might be new but it saves allot of time and effort down the road and makes the product complete.

How do I create a Visual Studio project template that includes linked files?

In Visual Studio 2010, I want to create a project template that includes links to two files that should exist on the system. One of them is a common AssemblyInfo.cs file. Another is the strong name key file (*.snk).
I need these references to be relative, because each developer's workspace will be set up differently. Is it possible for the project template to somehow figure out where these files reside in each developer's environment?
From reading about templates, it sound like they're pretty static so I wonder if tricks can be done to do something like this. If nothing else, I can add bogus references that will cause compilation errors and force the developer to hook these files in. But if I can do it for them, that would be better.
You should set the CreateInPlace property to true in the vstemplate. The documentation says
Specifies whether to create the project and perform parameter replacement in the specified location, or perform parameter replacement in a temporary location and then save the project to the specified location.
If you want relative paths to work, you need the parameter replacement to occur in the place where you're creating the project, not in a temporary location.
Microsoft have confirmed that this is a bug with the extensibility model and project templates. I managed to get round this by using IWizard. I added the following code in the RunFinished method of my IWizard implementation:
//Get linked file directory
string coreDir = Path.GetDirectoryName(MyProject.FullName);
//Data folder
ProjectItem propertiesProjectItem = slSharedProject.ProjectItems.Cast<ProjectItem>().Where(p => p.Name == "Data").First();
propertiesProjectItem.ProjectItems.AddFromFile(coreDir + #"\Service\TheFileIWantToLink.cs");
This code links in a copy of TheFileIWantToLink.cs file to my shared Silverlight project (slSharedProject).
You could try to integrate a Wizard into your Project Template and set the Paths to the linked files. If i remember right you don't have to create an User Inteface; you only have to specify the correct replacements in the replacementsDictionary and VS will replace the values in your Template File. See this or this for further information.

Set the default description for custom build rules in Visual Studio (2008)

In VS, it is possible to set a custom build rule at the individual file level. However, unless you change the description of the build step (which is what msbuild outputs when running the external tool), all you get is the default, which says "Performing Custom Build Step," followed by the error output of the tool.
I recently got burned by this in an inherited solution, where the build rule for a .asm file buried deep in a project was failing, and NASM didn't provide any useful debug information. Since I didn't know what file was failing, it took me forever to find the problem. One thing I tried was changing the description for all the projects in the solution (by selecting them all at once and opening the properties panel) and adding macros to show the project and file affected. Since the build rule was attached to a file, however, this naturally didn't work.
I also tried searching for the default description string in all the project files, but the project files don't store this information unless you set the value. So clearly, there's got to be a default somewhere. Anyone know how you can set this?
I doubt you can change the default for everything, but what you can do is create a property sheet in which you set a custom description, and than add that property sheet to all projects needing it.

Software To Help Me Reuse Code

I often find myself writing small (5-20 lines) files for things like input validation, reading a URL and so on. In fact, I probably write nearly the same files over and over because I either forget that I've already implemented such functionality in another project or I don't want to have to go searching for that file.
I want to know if there is a way to simply add code to a global repository from an IDE (in my case Visual Studio) and simply extract that code into whatever project I'm working on. It should be able to:
Extract code to a new file or to the currently open file in my IDE.
w.r.t. #1 I want smart defaults based on how I added the code to the repository.
Easy to use UI.
I don't need replacement/substitution of variables.
For instance, if I right click on a file I want to add to the repository then the default extraction operation is to create a new file. If, instead, I highlight some text in the currently open file and commit that, then the default is just to paste the snippet into the currently open file.
I've tried VS's snippet manager a few times, always with disappointment and quick abandonment. My biggest complaint is its interface and complexity required to add new code to it, plus the inability to extract the code to a file versus just inside whatever I have open.
You might want to check out ReSharper's Live Templates.
I don't use them to the extent that you're obviously looking for, but you can definitely create new file-based templates. I use that all the time when I create a new unit testing fixture class - just Add New Item -> From Template -> NUnit Test Fixture, where "NUnit Test Fixture" is one of my defined file templates.
Additionally, all the templates can be assigned a shortcut sequence, so you can auto-replace a given combination of text with a code snippet.
All the template configuration is file based, so you can save them to solutions or global workspaces as well.

Resources