Scons Build Dependency Optimziation? - scons

Well i have a build setup of 2 projects, one project takes .xml files from a directory and processes them into header files. These files are then used by the second project. Is there any way to check if his project needs to be re-run (the .xml files were modified or a new one was added)?

Just combine the two projects into one common source tree, and one single SConstruct (with as many SConscripts as you like in the subfolders, that get included by SConscript(file) ).
Then ensure that the header files in the include/ folder are always tried to be built, e.g. by adding them as default targets with env.Default().
SCons will only call each conversion .xml->.h when the corresponding source XML file has changed its content.

Related

How to skip certain files when running `cookiecutter --replay`?

If I make a change to my cookiecutter template I like to use cookiecutter --replay (or --replay-file) to update my existing projects with the new template changes. When doing this, how can I skip certain files?
For example one thing my template contains is a requirements/ directory containing Python requirements files:
requirements/
main.in
main.txt
tests.in
tests.txt
It's useful for the template to output a starter set of requirements files when generating a new project. But the project will almost certainly modify these files whenever it adds or upgrades requirements so when replaying the template I would not want to overwrite the requirements files with the original starter ones. That would just delete any dependencies that've been added to the project since its inception.
I'm aware of --skip-if-file-exists but I don't want to skip all existing files, only the ones in the requirements/ dir.
The only solution that comes to mind immediately is to omit the requirements dir from the project template and use a post-generate hook to write out the starter requirements files only if they don't already exist.
But I wonder if there's a way to get cookiecutter to do this for me, without having to write it in Python myself?
For example is there some way to give cookiecutter --replay a list of files and directories to skip if they already exist?

SVN tag files selectively

Gurus- We have a process to push only the modified files to integration and production environment. We will have to use 'Tag' mechanism. The process is to push the files along with the folders integration environment and another UI deployment process execute shell scripts to copy the files to respective folders and then run Make utility or ANT.
For e.g. /root/dev/scripts/ folder have files f1 and f2 in the branch, this branch can be used by multiple developers at the same time. If suppose only file f1 is modified , I should be doing the following steps.
1) Identify the files modified.
2) Create a tag out of the files selectively. In this example tag should contain /root/dev/scripts/f1.
Precisely my question is, how we can selectively find files and add to tag retaining the folder structure?

What do I do with the mogenerator files that were generated?

I finally got mogenerator to work, that is, it generated four (4) files for each entity (a .h file, a .m file and two more .h and .m files prefixed with an underscore). I noticed that I have the same identical files (without the underscore) already in my app; the difference is the older ones have program logic in them and the new ones are empty of any logic.
Somewhere I read that I have to put the new files in my app, but if I do that, I will wipe out the ones with the logic in them. So, what do I do now?
The files with the underscore are the "machine" classes and are written each time you build the project. The files without underscore are the "human" classes and are only created once and never replaced. The human class files should contain your custom logic.
If you had previously added code to the Xcode generated managed object subclass files,
move that to the mogenerator human class files.

Shared Object Files

I have two projects within one solution. Both projects contain some files that are the same. For instance, Project1 contains shared.cpp and so does Project2. However, when I edit shared.cpp and build both projects, is there any way I can make VC++ compile the source file once, then use the single object file in the linking of the two projects, rather than compiling it twice? The obvious purpose being to decrease build time.
Put shared.cpp in a separate project in the same solution and make it build as a library. Then add that project as a dependency to project1 and project2.

how to add directory to SupportFiles in InstallShield

Is there a possibility to add directory (with sub directories) to SupportFiles section in installshield. I have dynamically created content (list of files changes constantly) that I use to support my installation.
Is there any other method to add dynamically whole directory to installation package. I need files from this directory only during installation process. At the end of the installation I want IS to remove these files automatically ?
The ISSetupFile table ( which drives the Support Files pattern ) only supports extracting files to a single directory. There is no way in the UI to tell it to be dynamic although you could have a build automation step that reflects the contents of a directory and wires it up to the table using the automation interface. This still couldn't do sub directories though.
What you probably want to do is creating a self-extracting zip of the files you need as part of your build and add that EXE to Support Files. Then write custom actions that call the EXE to extract the payload to Support Files and another CA to clean it up. Look for the custom action ISSetupFilesExtract and ISSetupFilesCleanup to figure out the best way to do this.
Although I'm late to the party: #BuvinJ mentioned in a comment that you can add directories to "Advanced Files" under "Disk1." In this case, they do appear in the temporary directory (support directory), eg. SUPPORTDIR\Disk1
SUPPORTDIR is a temporary location where the installer dumps files, and cleans them up afterward. An example is C:\Users\<your user name>\AppData\Local\Temp\2\{F6B9B2D6-2A5A-4146-9297-E80A199CB0CB}.
This could be a quicker/cheaper/faster solution to writing custom actions and/or packaging up files by hand in, say, a self-extracting zip file.

Resources