summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-01-15 21:14:02 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-01-15 21:14:02 -0500
commitbf1a90b7220be0d15dcb3dc55e3f07b72b3e0b75 (patch)
treee37cdda2a63dbf4626c5703d8d9ae01a4cf16bd4 /build
parentbc113f3d2a76166e6b98ad0c2644197fffc573d2 (diff)
downloadaura-central-bf1a90b7220be0d15dcb3dc55e3f07b72b3e0b75.tar.gz
Move things so they will be better placed
Diffstat (limited to 'build')
-rw-r--r--build/moz.configure/platform.configure39
-rw-r--r--build/version2k.py38
2 files changed, 77 insertions, 0 deletions
diff --git a/build/moz.configure/platform.configure b/build/moz.configure/platform.configure
new file mode 100644
index 000000000..90b9b9da2
--- /dev/null
+++ b/build/moz.configure/platform.configure
@@ -0,0 +1,39 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This option is contrary to how moz.configure normally works as it typically
+# uses postive options only but this is a very special case
+option(name='--disable-platform',
+ help='Builds the application/extension without binary components or the platform')
+
+# This function will handle setting the minimum required configuration when the
+# platform isn't built.
+#
+# It also will supply the following include with an empty string which it will silently
+# ignore if platform building is disabled else it will supply the toolkit moz.configure
+# path.
+#
+# @depends are not allowed access to many things so we steal a cheat used elsewhere to
+# allow it to set the config by directly addressing the implimenting functions in the
+# bowls of moz.configure
+#
+# As a side note these @depends functions don't return something useful in a normal
+# pythonic way as they are sandboxed functions or something that only evaluate properly
+# by other parts of moz.configure. So despite looking rational it doesn't internally
+# work like you would expect.
+@depends('--disable-platform')
+@imports('__sandbox__')
+def platform(value):
+ if not bool(value):
+ __sandbox__.set_config_impl('MOZ_DISABLE_PLATFORM', '1')
+ __sandbox__.set_config_impl('MOZ_PACKAGER_FORMAT', 'omni')
+ __sandbox__.set_config_impl('MOZ_JAR_MAKER_FILE_FORMAT', 'flat')
+ return ''
+ else:
+ return '../mozilla/toolkit/moz.configure'
+
+# Include the toolkit moz.configure or silently continue with an empty string from above
+include(platform) \ No newline at end of file
diff --git a/build/version2k.py b/build/version2k.py
new file mode 100644
index 000000000..74ca88df5
--- /dev/null
+++ b/build/version2k.py
@@ -0,0 +1,38 @@
+from datetime import date
+from datetime import timedelta
+from datetime import datetime
+import sys
+import argparse
+
+moduleOptionParser = argparse.ArgumentParser()
+moduleOptionParser.add_argument("--version", "-v", dest="version", nargs="*")
+moduleOptionParser.add_argument("--msbuild", "-b", dest="msbuild", action="store_true")
+moduleOptionParser.add_argument("--msdate", "-d", dest="msdate", type=int)
+args = moduleOptionParser.parse_args()
+
+if len(sys.argv) <= 1:
+ moduleOptionParser.print_help()
+ sys.exit(1)
+
+if args.version:
+ with open(args.version[0]) as f:
+ strVersion = f.readline()
+ f.close()
+
+ if (strVersion == '52.9.0000'):
+ strVersion = '{0}.{1}'.format('52.9', (datetime.utcnow().date()-date(2000,01,01)).days)
+
+ if len(args.version) == 2 and args.version[1] == 'build':
+ print strVersion[5:]
+ else:
+ print strVersion
+
+ sys.exit(0)
+
+if args.msbuild:
+ print (datetime.utcnow().date()-date(2000,01,01)).days
+ sys.exit(0)
+
+if args.msdate:
+ print date(2000,01,01)+timedelta(days=args.msdate)
+ sys.exit(0)