premake5 Is it possible to generate a project without a workspace? - build

I have project A which is used in two different workspaces. I would like to generate it "standalone" and then reference it using externalproject in both my workspaces, but I'm unable to do this: premake5 complains if I try to generate a project without a workspace.
So right now, my solution is to include project A in workspace 1, and using externalproject in the workspace 2, or generating project A for each workspace, or create a "fake" workspace to generate it alone and then discard the extra.
Is there a way to simply generate a project without a workspace ? If not, for those who encounters this issue, how did you solve it ?
Thanks.

No, Premake currently requires a solution/workspace. Though you could always code your script to delete the solution after it is created, maybe something like:
premake.override(premake.main, 'postAction', function(base)
os.remove('MySolution.sln')
end)

Related

TFS Build 2015 - Using Globally Referred Files in Every Build

So, we are in this process of migrating XAML Builds to vNext (2015) Builds on TFS, and we are trying to "do things as clean as possible", since we had many, many customizations on the XAML builds that could be avoided and actually gave us problems along the way.
One major issue we are facing is with paths and "global files". Let me explain:
There are some files that, for commodity reasons, we have on a single place and every SLN file on that Collection refers them. Those files are such ones as Code Analysis RuleSets, Signing Files (SNK), etc. So the change is made in one place only and it affects every build.
Well, in XAML Builds we have a Build that runs with CI that downloads (Gets) those files, and since we hammered-in the same exact pathing for TFS and Machine (with a environment variable for the beginning of the path), the path is the same on the Developers and Build machines. However, this creates dependencies between builds and workspace issues.
My question here is, is there a configuration that I am missing that allows referring to files in other branches other than the build one? Since I’m trying to keep the build machines as “disposable” as possible, it’s running with an Agent Config Out of the Box: No custom paths, no hardwiring.
I already tried referring the files directly with their source control path, for example. The only options I’m seeing are either creating a PowerShell/CMD Script that downloads those files right into the same folder as the SLN or keeping it “as it is” and use relative paths putting a “Build” Build Step before the actual Build Step so it downloads the files to the server.
Isn’t there an “Elegant” way of doing this? Or is our methodology wrong from the get go?
You can add a Copy Files step to copy the files that the build needs:

can Hudson Build do multiple builds with different web.configs

I use hudson build to build my application. I have a web.debug.config, a web.release.config and a web.beta.config. My question is this. Is there a way to make hudson build job to do a separate build for each of these every time I do a build?
You could use a matrix (multi-configuration) project to do this, making the matrix variable the configuration type.
The linked documentation isn't too great, but hopefully it will get you going.
There is a serious lack of documentation on the Matrix projects and after trying all sorts I gave up on that and have a much simpler solution to what I was trying to achieve.
To achieve a build of each config I just added extra build steps with different command line parameters like this.
Click add a build step -> Build a VS project or solution with MSBUILD
In the command line arguments field add the following:
/property:Configuration=Debug
I then simply added another build step that does another build except with:
/property:Configuration=Release
And another with /property:Configuration=Beta
This runs through each build sequentially using the different configs on each build.

Allowing developer-specific settings in VS2008 Native C++ projects

Is it possible to combine the following properties, and if so, how?
Store in our version control system some Visual Studio 2008 native C++ (VCPROJ) project files for the developers in our team that use this IDE.
Allow some of those developers to tweak their projects (e.g. using debug version of third-party libraries instead of the usual ones).
Make sure these modifications are done in files that are not versioned.
In other words, I would like to allow developers to tweak some settings in their projects without risking that these changes are committed.
An 'optional VSPROP' file approach seems doomed to fail, as VS2008 refuses to load projects that refer to non-existent VSPROP files...
Any other suggestion? Is this possible with VS2010?
You may not be able to do this but using a solution that generates the vcproj like CMake for example would let you do this. Scripts all your project with CMake and literally conditionally include a config file(if present for example) that developers can change on their setup.
Branches could solve this problem: you create a branch, play with different versions of third-party, merge changes to trunk if results are good.
Well, as a preliminary solution you could put the project file into something like .hgignore or .gitignore after its initial commit.
This way changes to it can't be done accidentally.
At least that's how I handle .hgignore itself.
We use a versionned "common_configuration" folder, and a script which copies project files from this "common_configuration" folder towards the "project" folder.
We have another script to copy the configuration backwards, so the developpers need to make a conscious action to commit their local changes to the global version control system.
It answers partly your needs :
The upside : we have a way to keep a common configuration for everyone, and no accidental committing of local configuration
The downside : blindly copying the files actually crushes local changes. We live with it. We could write some more clever merger tool (using diff, or xml specific manipulations), but don't want to spend to much time on supporting the deployment tools.

Xcode: multiple projects, more than one main executable

Hi I'm new to Xcode. I'm trying to learn c++ and I was wondering if it is possible to have multi projects and choose which project should run. I used ms visual studios before and I like how under a solution I can create multiple projects and choose which one is the executable one. Xcode also has targets not exactly sure what they are maybe they play a role? I tried messing around but I constantly have issue because of duplicate mains. I'm going through a chapter and there are case studies. I'm trying to keep every chapter organized in one project well something like that. Any help thanks!
Xcode targets are probably what you are looking for. You can have many targets in a single project, and whichever one you select as active will be used when you tell Xcode to compile or run. If you are having problems with duplicate mains, you probably have all of your .cpp files in all of your targets. If you have main1.cpp and main2.cpp in the same target, Xcode will attempt to use both of them and run into a conflict. Including all common files in all targets, but only the appropriate main files will likely solve your problems.
for creating a new main.cpp file you should go to
File-New-target.
After it gets created just select your file here to choose which file you want to execute:
Actually you can create a workspace, then create each exercise as a project or as a target inside a root project, the second option is preferred if the exercises need to share the same libs and setup.
To select the active scheme to debug and run you can use this selection menu close to debug controls.

Flex builder and multiple and potentially duplicated projects in the same work space?

Is it possible have two projects with the same name in flex builder?
Here is the scenario
~/projects/myprojectdev/ProjectName
~/projects/myprojectstable/ProjectName
myprojectdev
and
myprojectstable
are more or less the same tree structure and duplicates of the same codebase.
I am using git to manage them as separate repositories. I can do some stuff in the myprojectdev folder and then occasionally merge changes over to the myprojectstable folder when I am satisfied. But I want to keep code from myprojectstable in my working space in flex builder to be able to launch it and occasionally compare the code between dev and stable. I may also want to open different versions of the same project codebase and compare them in the working environment. The problem is that in both folders the "ProjectName" is the same. And so I can't import both into my Flex Builder workspace. I get the warning
A project with the same name already
exists in your workspace. Rename or
delete the existing project.
But I don't want to rename the project or mess with its folder structure. What do I do? Do I have to keep these in different folders? e.g.
~/projects/myprojectdev/ProjectNameDev
~/projects/myprojectstable/ProjectNameStable
You can rename a project (in eclipse/flex builder) without actually renaming the folder it is in. Edit the .project file in your ProjectNameDev and ProjectNameDev to give the projects different names. You might need to restart eclipse to get it to recognize the new name.