separate sphinx build and source directories for version control - python-sphinx

I have a working directory containing my project and it is in a version control system. I'd like to create a doc directory inside my project that contains only restructured text files for sphinx.
That is, I don't want sphinx to build html files inside my project, but put them outside so they don't get put into version control.

So if you question is 'How can I build documentation outside of the source tree', the documentation helps:
sphinx-build -b html sourcedir builddir
Just point builddir to a location outside of your source tree.
Or, depending on your version control system, add the directory you generate your documentation to an 'ignore file' (e.g. .gitignore, .hgignore, ...)

Related

cppcheck-vs-addin - How to remove folder from check

I'm trying to configure cppcheck-vs-addin to automatically check my code on save. So far, so good. However, when I run it on my whole project, I want to exclude several folders (containing sources and headers I have no control on).
Files im trying to exclude are in folder libs\something\files.*
Folder tree is something like
src
| Folder A
| Folder B
libs
| LibsA
| LibsB
What I have tried so far :
-In settings, I added -ilibs to the additionnal arguments field
-In Edit solution suppressions / Excluded include path : .*\\libs\\.* (this should work for headers file, but I also have source files)
-In Edit solution suppressions / Files excluded from check .*\\libs\\.* (this option only seem to work on file name, not on the containing folder, so in this case it does nothing)
Additionnal question, is it possible to view the cppcheck.exe command that is run? It could help understanding what im doing.
If you have installed CPPCheck (and that it is on it's default location), add the path C:\Program Files (x86)\Cppcheck to Environment variable. Now update your pre build events from your project property and invoke cppcheck directly from there. Check this image how you can specify PreBuild Events
Visual Studio C++ Project Property Page to setup Pre-Build Event
Now you can provide argument to exclude directory (like any third party code etc.) from scan.
cppcheck --project=$(MSBuildProjectFullPath) -i "$(ProjectDir)foo\src\" --output-file="$(OutDir)$(TargetName).xml"
--project=$(MSBuildProjectFullPath) selects your current project file (.vcproj or .vcxproj) file,
-i Specifies the directory you want to exclude from scan
--output-file="$(OutDir)$(TargetName).xml" creates the output file in project output directory with analysis results.
To see detail argument list, type cppcheck --help in your command line.

File Content Replacer having no effect on artifacts

I'm using a relatively new feature of TeamCity: File Content Replacer. In my current setup I have a version.js file in my VCS:
window["MyPlugin"].version = "1.0.##VCS_REVISION##.##CI_BUILD_NUMBER##";
I use the File Content Replacer build feature to replace that last part with:
%build.vcs.number%.%system.build.number%
So far so good!
I have one relevant build step. It's an MSBuild step, but it does nothing except call a ps1, which does two relevant things:
Moves all js files to an "output" folder;
Zips all js files into a "zips" folder;
Those are also my two artifacts (an output folder, and a zip file).
However, the File Content Replacer reverts its changes, but this revert is also reflected in artifact nr 1, which are files that are not under version control (even though they are located as a subfolder of my project folder). The version.js file in the zip file is not reverted.
If I change artifact 1 to be my/output/folder => all.%build.vcs.number%.zip then the zip file will also contain a reverted state instead of the output I want.
How do I set TeamCity up so that the artifact files are not affected by this revert? Or do I need something other than this Build Feature?
I'm using TeamCity 9.1.3 build 37176 running on Windows 2012 Server (VM) and the default database for evaluation purposes. I'm using TFS 2013 as my VCS.
PS. I've also asked about this on the JetBrains forums.
File content replace reverts changes before "Publishing artifacts" stage. This is "by design". You can check it in the build log. However you can find modified files in hidden artifacts .teamcity/JetBrains.FileContentReplacer/.
If you want to publish changed file as regular artifact you should create a copy of the file (or pack/archive it as as you've already done). Also instead of using File Content Replacer build feature you can create a script that would make needed changes which aren't reverted.

How to configure haxe build file (HXML) to build from src directory?

I'm trying to build a pre-existing HaxePunk project in sublime (switching away from FlashDevelop).
problem: Error: Could not process argument
Here's my .hxml file:
-neko
-cp "c:/path/to/project/src"
-main Main
I've read somewhere that you shouldn't use the /src convention for your src files. That's annoying, since I want assets and binaries in their own directories separate from src files. How do I properly configure this?
You really should use the the src convention and not stuff everything within the same directory. You also don't want to make the build specific to your machine, so in you example above you don't want an absolute path but a relative one. So try the following:
#content of c:/path/to/project/build.hxml
-neko bin/output.n
-cp src
-main Main
Note that for -cp you use the relative path. The path is relative to where haxe is executed. That usually coincides with where your build.hxml file is, but it is not mandatory.
Also, you didn't specify an output file for neko. Note that you will have to create the directory bin by hand because the compiler will not do that for you and will complain if it doesn't exist.
These information are general and in no way tied with Sublime. Sublime should play just nice with these settings.

Minify JSON (or XML) in XCode build phase

I'm building an iOS app that frequently loads JSON configuration files at runtime.
However, the files are very generous with comments and indenting.
How can I tell XCode to copy minified versions of the files to the bundle during build?
You just need to add a build phase to your target. Here is an example, my build script that converts a multimarkdown file to an HTML file.
# Create the HTML file from the Markdown File
/usr/local/bin/multimarkdown --process-html --output="${SCRIPT_OUTPUT_FILE_0}" --to=html "${SCRIPT_INPUT_FILE_0}"
# Publish the Help Text and Image to Dropbox
if [ -d ~/Dropbox/Public/DCWS-Help-Text ]; then
rsync -t "${SRCROOT}/DC Wire Sizer/en.lproj/"* ~/Dropbox/Public/DCWS-Help-Text/
fi
I create the file in the source directory but added it to my git ignore file. It is a build product and not in source control, but you need to make sure it is in your project and part of the target, so it gets copied into the bundle. Also make sure your build script runs before your copy bundle phase.

Xcode 4.2 — add derived files to project

I'm using bison parser generator in my Xcode 4 project. I've written custom build rule for generating C++-source file from *.y grammar file:
/usr/local/bin/bison
--defines="${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.hpp"
--output="${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.cpp"
--verbose "${INPUT_FILE_PATH}"
As you can see, Xcode places generated files in $DERIVED_FILES_DIR folder. Now I need to export generated header file grammar.hpp with object files as library.
The problem is that Xcode doesn't allow export files, that aren't included in project.
The first solution, as it seems, is to create a group with absolute path set to $DERIVED_FILES_DIR. Well, it actually works until I change my build settings to build Release configuration, since $DERIVED_FILES_DIR is dependent on build settings.
The second solution is somehow set group path to literally variable, i.e.
path = $DERIVED_FILES_DIR
So far I've found two possible ways to do it: How to reference files with environment variables? and File references relative to DERIVED_FILE_DIR in Xcode. Either way doesn't work for me.
Maybe someone knows better way to add generated files to project?
Your best options are:
Generate the files in your SRCROOT
Generate the files in BUILT_PRODUCTS_DIR
These both have "Relative to..." options that should allow you to add the files to your project.
I ended up generating files in ${SRCROOT} directory with custom make build target using Makefile that handles regenerating derived files. I just added these generated files to project, and made all actual build target depend on this make target.

Resources