Commit Graph

69 Commits

Author SHA1 Message Date
Allan Odgaard
6f264a2520 Fix issue with reference types used in assertions 2013-07-26 13:53:57 +02:00
Allan Odgaard
a42e93f8b8 Ensure -include «pch» is the first compiler option
This is incase we want to set ‘-include’ via a FLAGS variable, as that only works when it is listed after a potential precompiled header include.
2013-07-21 13:25:29 +02:00
Allan Odgaard
03d72414f3 Specify that dependency files are ‘gcc’ (for ninja 1.3.0) 2013-05-17 15:31:14 +07:00
Allan Odgaard
6e4b305587 fixup! Cleanup a failed GitHub upload 2013-05-02 16:13:33 +07:00
Allan Odgaard
610624ca5a Improve variable handling when rebuilding build.ninja
Variables which are not referencing other variables are no longer provided with their literal value. Variables which do reference other variables have the reference escaped, so that ninja won’t expand the reference when rebuilding build.ninja.

There is still some redundancy in that APP_VERSION has the major + tag part stated both at the top and as a command line argument, haven’t yet figured out how to best deal with this.
2013-04-11 10:24:47 +07:00
Allan Odgaard
be83c7d91d Cleanup a failed GitHub upload
This might be moot given that the API should have been disabled by now.
2013-04-10 21:47:35 +07:00
Allan Odgaard
c54360fce3 Don’t expand APP_* variables in build.ninja
This makes it simpler to edit the generated file as one only need to edit the top variable section.
2013-04-01 13:22:41 +07:00
Allan Odgaard
f4f0e073d3 Use ‘alpha’ prefix instead of ‘r’ 2013-03-17 17:08:54 +01:00
Allan Odgaard
ca91ce58c6 Add options to generated test executable
The current options are:

 -b/--benchmark   Run benchmarks instead of tests.
 -m/--measure     Measure time of each test. This disables concurrency.
 -r/--repeat <n>  Number of times to repeat each test/benchmark.
 -v/--verbose     Be verbose.
 -h/--help        Show this help.
 -V/--version     Show version number.
2013-03-10 14:34:44 +01:00
Allan Odgaard
99969996c5 Ensure test assertions are only evaluated once 2013-03-10 14:34:43 +01:00
Allan Odgaard
687d0ee9e4 Ensure we use /usr/bin/mktemp
It appears some variants of mktemp require the template parameter to contain a minimum number of X’es.
2013-03-01 16:30:10 +01:00
Allan Odgaard
1f4eecbab7 Always use system default ruby 1.8
Maybe fixes #845.
2013-02-27 13:42:23 +01:00
Allan Odgaard
ccf63ae206 Use proper PCH for tests
We previously passed an array to ‘pch_for’ where we should have passed a source path, though it appear to have worked.
2013-02-25 15:28:37 +01:00
Allan Odgaard
2f3cd66a2b Support relative includes in tests
Since we inline the test file, rather than include it, relative includes from this inlined code would not work.
2013-02-23 09:19:45 +01:00
Allan Odgaard
9ebcfcbd79 Support to_s for most integer types
Here “most” refers to signed and unsigned 16, 32, and 64 bit integers.
2013-02-22 15:53:05 +01:00
Allan Odgaard
01417054cb Add test system supporting grand central dispatch
The motivation for introducing a new test generator is that CxxTest cannot be used with tests that (indirectly) schedule code to run in the main queue.

There are a few other advantages of breaking with CxxTest:

 1. Less boilerplate: A test file need only contain a
    function named with a ‘test_’ prefix. No classes,
    inheritance, or similar. If you need fixtures, use the
    multitude of ways that C/C++ allows that (constructor
    functions or non-POD types with static storage).

 2. Concurrent tests: Test functions are scheduled with
    ‘dispatch_apply’ and will thus run concurrently. If
    you need serial execution you can wrap your tests in a
    block and schedule that to run in the main queue.
    Though you should catch exceptions and re-throw these
    in the test’s original queue, as the test assertions
    are using exceptions.

 3. Easier output of custom types: The assertion macros
    will call ‘to_s’ on the arguments given, so the only
    thing required to make these output nicely is to
    provide a ‘to_s’ overload for your custom type /
    enumeration. I know that the standard way to do this
    is overloading operator<< for a stream, but the
    TextMate code-base already uses the ‘to_s’
    convention.

Long-term I can see a few other advantages, like calling preprocessor on the input files to support #if/#else/#endif to disable tests, better support for Cocoa code (NSRunLoop), and introducing test timeouts.
2013-02-21 15:54:37 +01:00
Allan Odgaard
a1b9c305da Move version knowledge outside upload script 2013-02-18 16:11:12 +01:00
Allan Odgaard
66350b6492 Remove ‘after_bump’ phony rule
Turns out a phony rule in ninja isn’t exactly the same as an alias. When the file the phony rule is supposed to be an alias of already exist when calling ‘ninja’ then rules depending on the alias are not considered out-of-date even if the aliased file is of newer date.

Build rules that previously depended on ‘after_bump’ should instead depend on ‘builddir/revision.$APP_REVISION’.
2013-02-16 10:43:55 +01:00
Allan Odgaard
6cd7d86215 Script to create default bundles would always exit successfully
We shouldn’t do anything after the essential line of the script, as we want that line’s status code to be the script’s exit status.
2013-02-11 14:21:19 +01:00
Allan Odgaard
b2ae4196c3 Update database of contributor email hashes 2013-02-05 15:05:26 +01:00
Allan Odgaard
2df0f7aa51 Revert "Do not timestamp our code signing"
Some users have reported issues opening TextMate: Finder tells them the program is corrupt and should be moved to trash. If the user adds his own (ah hoc) signature, then no such dialog is shown.

This reverts commit 1c164e3ce0.
2013-01-29 15:31:10 +01:00
Allan Odgaard
08eace5a47 Do not remove old targets if ninja failed 2013-01-28 22:08:17 +01:00
Allan Odgaard
8066344806 Don’t include $USER.ninja when username is ‘build’
Since our master build file is named ‘build.ninja’, including the user build file in this case would read the master file twice.
2013-01-25 11:01:57 +01:00
Allan Odgaard
1c164e3ce0 Do not timestamp our code signing
This means that the signature will be invalid when the certificate expires, though it also means that codesign runs faster, and as my certificate is valid for another 4 years, people shouldn’t be using the builds released today when the certificate expires.
2013-01-22 19:23:15 +01:00
Allan Odgaard
3c92d2aeb9 Introduce ‘after_bump’ build target
This target is solely intended for other targets to depend on, and will cause the dependents to be rebuilt after the APP_REVISION has been increased.

For example ‘Contributions.md’ technically depend on commit history (and online lookups), but in practice we can’t specify this in its dependencies, so previously we had to manually touch the file, if we wanted the HTML to be regenerated.

Now we can have it done automatically after each ‘bump’ by adding this rule:

    build path/to/Contributions.md: touch | after_bump

For the records, I bump the revision *before* I do ‘ninja deploy’. This ensures that deployed versions do not share revision number with a custom build (I do another ‘ninja bump’ after a successful deploy and ./configure will also set APP_REVISION to ‘current + 1’).
2013-01-22 08:03:07 +01:00
Allan Odgaard
725b9613dd When recreating build file, don’t expand APP_REVISION
This is just to make “bumping” the revision safer. Previously the revision number would be two places in the generated build file, and both needed to be bumped. Now there is only one instance. Generally the revision is bumped with ‘ninja bump’ so the user shouldn’t care about it, but sometimes manual intervention is required.
2013-01-22 08:03:07 +01:00
Allan Odgaard
9711e92897 Only build ‘bl’ if not already built
Also ensure the tbz archive is created atomically.
2013-01-22 08:03:07 +01:00
Allan Odgaard
e19686c9d8 Handle targets with no dependencies
These would not be added to the dependency graph and thus no build instructions were generated for them.
2013-01-21 15:03:52 +01:00
Allan Odgaard
aa50c31636 Workaround for ruby’s YAML.load
JSON should be a subset of YAML so we use ruby’s YAML parser to parse GitHub’s JSON. This however leads to syntax errors reported by the parser (as noted in issue #637) but if the JSON is “pretty printed” it seems to parse it fine (seems to be the extra white space for associative array pairs).

We can trick GitHub into pretty printing the JSON result by setting the user agent to be curl, so that is all this workaround does.
2013-01-04 02:07:50 +01:00
Allan Odgaard
5f635aa026 Build: Convert *.strings files to UTF-16 if needed
If the *.strings file does not contain an UTF-16 byte order mark (either big or little endian) then it is assumed to be UTF-8.
2013-01-02 01:46:48 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
2ae8d9371e Apply custom build flags last
This allows using RAVE_FLAGS to override the more general compiler flags.
2012-12-19 19:42:36 +01:00
Allan Odgaard
6e228b69aa Fix typo 2012-12-19 19:42:36 +01:00
Allan Odgaard
a7e70de9dd Help book index: Enable verbose output
This seems to be the only way to learn of problems creating the help index, as parsing errors are otherwise silently ignored.
2012-12-19 19:42:34 +01:00
Allan Odgaard
d4513dd76d Use YAML::load to parse JSON
This avoids depending on the user having installed the JSON gem (and fixes problems where user has it installed, but for a different ruby than the one used to run this script).
2012-12-14 18:03:37 +01:00
Brad Choate
09a81e9024 Seed the contributor lookup table a bit. 2012-11-12 14:49:47 +07:00
Brad Choate
eb30ea3cb8 Add dynamic contributions page to the About window 2012-11-12 14:49:47 +07:00
Brad Choate
6753f4e3d6 Evaluate embedded ruby in markdown files
This is when generating HTML for the release notes, manual, and, where we actually need this, list of contributions.

Long-term we should probably switch to template tags as we are effectively adding code to the (otherwise declarative) build graph, which means we don’t have any way to tell if the generated HTML is up-to-date or not (as that would require analyzing the embedded ruby code).
2012-11-12 14:34:22 +07:00
Brad Choate
a1a73e8593 Don’t output markdown headers when generating HTML 2012-11-12 14:30:39 +07:00
Allan Odgaard
9b00db3139 Update CxxTest 2012-11-12 13:28:34 +07:00
Allan Odgaard
df6c6f5f8b Avoid using ‘-q’ with pgrep
The version installed via MacPorts does not have such option so relaunching TextMate (after successful build) would not work.
2012-09-29 00:16:07 +02:00
Allan Odgaard
c77c6fc4e2 Let gen_build support TM_NINJA
This is for when building from TextMate and PATH has not been setup to contain the directory containing ninja.
2012-09-28 16:36:37 +02:00
Allan Odgaard
7d50b4db92 Change version bumping rules
We no longer do an implicit bump after deploy — this should be done, but as we also want to do a bump before deploy (so deployment builds do not share revision with any custom builds) we need the bump rule to be usable by itself.

Also fix issue with bumping APP_REVISION in build.ninja not affecting APP_VERSION after rebuilding build.ninja.

And additionally include user file after main build.ninja.
2012-09-25 01:41:07 +02:00
Allan Odgaard
50217a73ba Let precompiled headers depend on compiler 2012-09-24 20:58:43 +02:00
Allan Odgaard
de3a1ee2f0 Build tests with same compiler flags as their sources
We link the test’s .o with the .o objects from the library being tested, rather than link it with a potential dylib, hence why some flags matter.
2012-09-24 20:58:43 +02:00
Allan Odgaard
ed7a93af93 Allow enabling ARC per target
The issue is that the precompiled header must also be created with ARC enabled, so now we use different precompiled headers depending on wether or not the file to be compiled has -fobjc-arc enabled.

The way this is done is hardcoded for the ARC options, it might be nice to abstract it so that the PCH dependency had a name derived from the PCH-sensitive compiler options.
2012-09-22 13:23:40 +02:00
Allan Odgaard
ebbd58c513 Improve build file dependency tracking
Previously if we did something like:

    CP_Resources = resources/*

The build file would correctly depend on the ‘resources’ directory, but a change, as in, adding, removing, or renaming a file, in a directory below ‘resources’ (e.g. adding ‘resources/English.lproj/NewWindow.xib’) would not correctly update the build file to include the new resource.
2012-09-17 16:42:42 +02:00
Allan Odgaard
e721e6e0d6 Ensure builddir doesn’t contain removed files
If e.g. we rename “image.tiff” → “image.png” then the build files are correctly updated to copy “image.png” to the build directory, but until this commit, the old tiff image would stay in the build directory until manually removing it / cleaning the build directory.
2012-09-14 17:14:56 +02:00
Allan Odgaard
2b2b0b016d Make all second level headings article 2012-09-14 17:14:54 +02:00
Allan Odgaard
e4fcd7987f Update release notes styling
Thanks to Khadgar (irc nick) for this!
2012-08-28 12:54:26 +02:00