Skip to content

Commit

Permalink
Bug 924615 - Move JarMaker.py into mozbuild; r=mshal
Browse files Browse the repository at this point in the history
  • Loading branch information
indygreg committed Oct 11, 2013
1 parent 2fe23a8 commit de8e0e2
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 22 deletions.
1 change: 0 additions & 1 deletion config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ DEFINES += -DSTATIC_EXPORTABLE_JS_API
endif
endif

# Flags passed to JarMaker.py
MAKE_JARS_FLAGS = \
-t $(topsrcdir) \
-f $(MOZ_CHROME_FILE_FORMAT) \
Expand Down
4 changes: 2 additions & 2 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1451,10 +1451,10 @@ endif
endif

libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
$(call py_action,jar_maker,\
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST)
$(JAR_MANIFEST))

endif
endif
Expand Down
1 change: 0 additions & 1 deletion js/src/config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ DEFINES += -DSTATIC_EXPORTABLE_JS_API
endif
endif

# Flags passed to JarMaker.py
MAKE_JARS_FLAGS = \
-t $(topsrcdir) \
-f $(MOZ_CHROME_FILE_FORMAT) \
Expand Down
4 changes: 2 additions & 2 deletions js/src/config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1451,10 +1451,10 @@ endif
endif

libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
$(call py_action,jar_maker,\
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST)
$(JAR_MANIFEST))

endif
endif
Expand Down
11 changes: 2 additions & 9 deletions mobile/locales/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ include $(topsrcdir)/config/makefiles/makeutils.mk
# Separate items of contention
tgt-gendir = .deps/generated_$(AB_CD)

jar-maker = \
$(firstword \
$(wildcard $(MOZILLA_DIR)/config/JarMaker.py) \
$(topsrcdir)/config/JarMaker.py \
)

GENERATED_DIRS += .deps

ifdef LOCALE_MERGEDIR
Expand Down Expand Up @@ -130,18 +124,17 @@ search-preqs =\
$(call mkdir_deps,$(FINAL_TARGET)/chrome) \
$(search-jar) \
$(search-dir-deps) \
$(jar-maker) \
$(if $(IS_LANGUAGE_REPACK),FORCE) \
$(GLOBAL_DEPS) \
$(NULL)

.PHONY: searchplugins
searchplugins: $(search-preqs)
$(PYTHON) $(jar-maker) \
$(call py_action,jar_maker,\
$(QUIET) -j $(FINAL_TARGET)/chrome \
-s $(topsrcdir)/$(relativesrcdir)/en-US/searchplugins \
-s $(LOCALE_SRCDIR)/searchplugins \
$(MAKE_JARS_FLAGS) $(search-jar)
$(MAKE_JARS_FLAGS) $(search-jar))
$(TOUCH) $@

include $(topsrcdir)/config/rules.mk
Expand Down
15 changes: 15 additions & 0 deletions python/mozbuild/mozbuild/action/jar_maker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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/.

import sys

import mozbuild.jar


def main(args):
return mozbuild.jar.main(args)


if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
9 changes: 3 additions & 6 deletions config/JarMaker.py → python/mozbuild/mozbuild/jar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
'''
import sys
import os
import os.path
import errno
import re
import logging
Expand Down Expand Up @@ -439,10 +438,11 @@ def symlink(self, src, dest):
if rv == 0:
raise WinError()

def main():
def main(args=None):
args = args or sys.argv
jm = JarMaker()
p = jm.getCommandLineParser()
(options, args) = p.parse_args()
(options, args) = p.parse_args(args)
jm.processIncludes(options.I)
jm.outputFormat = options.f
jm.sourcedirs = options.s
Expand Down Expand Up @@ -484,6 +484,3 @@ def main():
else:
infile, = args
jm.makeJar(infile, options.j)

if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 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/.

from __future__ import print_function
import unittest

Expand All @@ -8,7 +12,9 @@
from StringIO import StringIO
from zipfile import ZipFile
import mozunit
from JarMaker import JarMaker

from mozbuild.jar import JarMaker


if sys.platform == "win32":
import ctypes
Expand Down

0 comments on commit de8e0e2

Please sign in to comment.