Commit Graph

158 Commits

Author SHA1 Message Date
Allan Odgaard
116e5e9a6c Check that build files do not reference unknown targets 2019-07-07 20:52:50 +02:00
Allan Odgaard
f7aef9b2b0 Fix syntax error in (ninja) relaunch app build rule 2019-07-06 17:28:40 +02:00
Allan Odgaard
0d18d5b88f Bump modification date of files copied to build directory
This is required because copying an executable to the build directory now depends on its signature, but the signature’s date is always newer (or same) as the executable being copied, which leads to the target being considered out-of-date and thus rebuilt (copied again).
2019-07-04 10:58:54 +02:00
Allan Odgaard
d5cae62621 Rework small part of build script to be less redundant
It’s the same number of lines, but it feels better to me, as the logic/processing is not repeated for each type of compiler argument.
2019-07-04 10:58:01 +02:00
Allan Odgaard
bb772913c9 Variables from target file take precedence over command arguments (-D)
This may seem non-standard but since presence of a variable in our target file will drop a potential -D when, it does not make sense to have -D take precedence over what is in the target file.
2019-06-30 10:32:45 +02:00
Allan Odgaard
91b67f36c1 Skip passing variables to gen_build that are declared in our target file
This is to automatically drop variables that are moved from ./configure to our main target, e.g. APP_MIN_OS.
2019-06-30 10:32:45 +02:00
Allan Odgaard
68ec5e42a1 Cycles in our build dependencies could result in an incorrect build file 2019-06-29 16:36:25 +02:00
Allan Odgaard
260fad0c3f Make all variables in root target file available to ninja commands
Ideally we would have a section with “public” variables, but that will require making the format more complex, so for now, everything gets declared as a variable in the ninja build file, even though for now, we really just need to export APP_MIN_OS.
2019-06-29 15:05:48 +02:00
Allan Odgaard
6a8eb992fc Add to_h method to Context
This converts the context object to a hash with all (merged) values.
2019-06-29 15:01:20 +02:00
Allan Odgaard
9511926afc Use $args instead of $FLAGS in ninja commands
This is to avoid confusion with the compiler $FLAGS variable.
2019-06-29 15:00:05 +02:00
Allan Odgaard
27a7dd8815 Add some optional build rules for notarization/release notes
These can be included from a potential $USER.ninja file.
2019-06-29 14:12:29 +02:00
Allan Odgaard
e92d6aaac2 Broaden regex to match version strings in release notes 2019-06-29 07:24:21 +02:00
Allan Odgaard
224554f6a2 Let built bundles be phony targets in build file
The signature step takes the bundle as input and therefore depends on this, but if the bundle does not already exist, ninja will (correctly) complain that there is no rule to create it.

For bundles the sequence is now the following:

- Copy/run depends on signature
- Signature depends on bundle
- Bundle depends on linked executable and all resources
2019-06-27 11:20:48 +02:00
Allan Odgaard
412e6798ca Update build generator script
This changes a bunch of things:

1. Each framework now creates its own include directory for exported headers, and any target linking with this framework, gets that directory added to its include search path. This ensures deterministic behavior, unlike previously where a single shared directory was used, so even if target A did not explicitly link with target B, there was a reasonable chance that target B’s headers would be available when target A was built.

2. There is a new IMPORT keyword to indicate that a target depends on the headers of another framework but does not want to link with it. For example the `commit` shell command imports headers from the CommitWindow framework (related to their communications protocol) but linking with the CommitWindow framework would not be practical (as that would bring in all the resources of the CommitWindow).

3. All embedded targets are signed before being copied to their destination.

4. A new CS_ENTITLEMENTS keyword allows specifying `codesign` entitlements. Currently the hardened runtime is enabled, although this does make development problematic, as modifying files of a running instance (as done during rebuild) can cause TextMate to crash with EXC_BAD_ACCESS (Code Signature Invalid). Worse though, it seems the system has a cache of blacklisted executables indexed by inode. So if e.g. the embedded `mate` executable gets blacklisted, one has to manually remove and rebuild it, before it gets possible to use it again (by default, rebuilding causes the inode to be re-used, but I may change the build system to unlink before copy).

5. The build file no longer contains rules related to deployment. Instead variables are declared that a user build file can reference to extend the build with notarization/deployment rules (without having to hardcode build directory paths).

6. The code has been made modular with a Compiler super class that is subclassed to add support for file transformations (xib, ragel, asset catalogs, etc.) and a transformed file can have its own settings.

7. If target A links with target B, the linker flags of target B will now be included when linking target A.

8. Currently no indexing of help books. Unsure if this is actually useful.

9. Previously it was possible to have umbrella targets that would not generate any output, but just change settings for their sub-targets. This is no longer supported, as the implementation was arcane. I would like to introduce a different system for managing sectioned settings. Related to this; settings in target files are now always merged, regardless of whether using ‘=’ or ‘+=’.
2019-06-26 23:32:19 +02:00
Allan Odgaard
f92d36571a Use DISPATCH_APPLY_AUTO instead of explicit global queue
This is “strongly recommended” (according to `man dispatch_apply`) and should work on 10.9 and later (according to a WWDC session).
2018-11-12 19:15:12 +07:00
Ronald Wampler
62ee2f94be Add support for building Asset Catalogs
We compile all assets into one file that resides in the main app bundle so while we can have multiple asset catalogs (per Framework, etc.), individual assets should still be namespaced.
2018-10-28 12:12:04 +07:00
Allan Odgaard
8e186231fd Fix typo in bin/gen_build 2018-10-28 12:09:12 +07:00
Paul Collins
108b99149c Handle rate-limiting when using GitHub’s API to obtain author emails 2018-02-06 17:14:40 +07:00
Paul Collins
d00a5cd4a0 Create credits database file’s enclosing directory as necessary 2018-02-06 17:11:31 +07:00
Allan Odgaard
14e91b6d35 Output error when referencing non-existing target 2017-09-12 16:57:00 +02:00
Allan Odgaard
e072a6a1ac Update CxxTest subproject (despite not really being used) 2017-03-10 12:22:35 +07:00
Allan Odgaard
5caf3f789d Update build file generator
We no longer build frameworks as standalone targets but instead link it all together, which also means resources from “frameworks” will end up in the main bundle.

Currently the new build file generator does not create test targets and changing linker settings in frameworks is not inherited by the main target (since there is no naive way to “merge” framework specific linker settings).

For custom library dependencies (capnp, kj, and libressl) we specify them via `LIBS` using `/path/to/libfoo.a` so that the root target will inherit these dependencies and using the absolute path ensures that we get the static (rather than dynamic) version.
2016-11-06 16:49:46 +07:00
Allan Odgaard
d261e2801e Do not copy extended attributes to build directory
Also exclude extended attributes when creating the tar archive, and copy symbolic links as links (instead of copying the file they reference).
2016-11-02 23:02:17 +07:00
Allan Odgaard
8dbe66cdb1 Remove support for building targets with manual retain/release 2016-10-31 17:30:30 +07:00
Allan Odgaard
56610d4e89 Drop rules to skip running tests since they do not work 2016-10-31 17:30:30 +07:00
Allan Odgaard
ecfcce9ebb Remove unused build directive 2016-10-24 02:21:29 +07:00
Ronald Wampler
5fb4c6850e throw() → noexcept (C++11) 2016-10-18 23:06:49 +02:00
Allan Odgaard
9818980b8c Change where we redirect stdin/out in ‘relaunch target’ build script 2016-08-22 16:14:36 +02:00
Allan Odgaard
7dbb44c4a0 Make parallel test execution the default (again) 2016-07-12 11:35:29 +02:00
Allan Odgaard
168c06402c Setup CFRunLoop in test runner 2016-07-10 17:49:43 +02:00
Allan Odgaard
436e43d78f Specify OS requirements (to server) via depends DSL 2016-07-05 12:13:06 +02:00
Allan Odgaard
c36ec7757e Send minimum OS requirement to server when we upload a new build 2016-06-22 22:53:38 +02:00
Ronald Wampler
9337b12616 Pass our minimum deployment target to ibtool
This suppresses the below warning when compiling xibs with Xcode 7 or later.

    warning: This file is set to build for a version older than the deployment target. Functionality may be limited. [9]

We should revisit this when we update our minimum deployment target to 10.8 or higher, as it may not be needed.
2016-06-21 06:19:04 +02:00
Allan Odgaard
863ed2a691 When running tests synchronously failures would be ignored 2016-06-21 06:19:04 +02:00
Martin Kühl
597a49015d Run tests synchronously by default
Running tests in parallel (which is the default)
results in spurious failures in the `scm` git tests,
probably due to an undiagnosed race condition.

This change lets tests run serially by default,
but provides a flag `-p` (or `--parallel`)
which enables running them in parallel again.

It also adds a variable `test_flags`
which is passed to each test run,
and which can be set by running

    env test="-v" ./configure
2016-01-15 12:07:16 +01:00
Martin Kühl
bbced5c3f3 Protect gen_credits against invalid responses
The `gen_credits` scripts can spuriously fail
raising this error in the `user_by_email` method

    NoMethodError: undefined method `[]' for nil:NilClass

when `YAML.load(response.body)` returns nil.

This change protects the build against these failures
by returning nil early.
2016-01-15 12:07:16 +01:00
Allan Odgaard
720f9eac98 Expect more than just {?name} in GitHub’s URI template
Currently GitHub supports both name and label parameters.
2015-10-03 17:33:21 +07:00
Allan Odgaard
f8c823195f Update script to create release notes
We now place the GitHub version comparison link in the list of changes rather than in the heading.
2015-01-19 12:29:33 +07:00
Allan Odgaard
23386c1138 Enable session restore (if disabled) when relaunching after build 2014-11-30 09:12:08 +07:00
Allan Odgaard
fe798f4c0e Don’t explicitly define targets as applications or libraries
Libraries can be identified by either being linked with other targets, or exporting headers, so that is what we do.
2014-11-20 14:58:34 +01:00
Allan Odgaard
83d859ff52 Remove support for our special “EXPORTS” symbol
This allowed framework headers to test whether they were build as part of the framework itself, or part of building something that depends on the framework.

Ideally though we should not need two different paths for those two cases, and we no longer have.
2014-11-17 15:17:28 +01:00
Allan Odgaard
f16e83fb4f Get rid of APP_REVISION
This was just mirroring the last part of our version number so redundant and it wasn’t monotonically increasing as we switched from alpha.n → beta.1 (with n > 1), so it probably did more harm than good.
2014-10-30 20:49:10 +01:00
Allan Odgaard
aa96f1f342 Account for tar potentially failing 2014-10-03 21:49:13 +02:00
Allan Odgaard
e92759af78 Ensure we create signature before uploading file
This is so that we do not upload anything if signature creation fails.
2014-10-03 21:49:13 +02:00
Allan Odgaard
e13ec4dc18 Call developer shell tools via xcrun instead of using $xcodedir 2014-09-05 14:31:05 +02:00
Allan Odgaard
de60f228ac Do not assume CC/CXX is a single executable
The downside is that we no longer have our .o files depend on the compiler (so we need to do a clean build after upgrading the compiler) and if there is a space in the path to the compiler, it will fail.

The upside is that we can let CC/CXX be a command with arguments, e.g. ‘xcrun clang’.
2014-09-05 14:05:17 +02:00
Joachim Mårtensson
2df7620b8d Add Ruby 2.0 support for build scripts 2014-08-03 09:05:33 +02:00
Allan Odgaard
d422a21006 Do proper string conversion of non-string values
Only values from the root target goes through this code, so it wasn’t causing a problem, as none of those keys had a multi-element array, but in ruby 2.0 embedding an array in a string seems to use inspect instead of to_s:

	Ruby 1.8: "#{['foo']}" #=> foo
	Ruby 2.0: "#{['foo']}" #=> ["foo"]
2014-08-03 09:05:09 +02:00
Allan Odgaard
dfe38c3708 Set required version of ninja to 1.5 2014-07-24 08:18:50 +02:00
Brad Choate
6172d9ae8f Adding some 2012 committers. 2014-07-22 13:10:46 -07:00