Bug 1212773 - Pass a base directory to jar maker, instead of a chrome directory. r=gps

This commit is contained in:
Mike Hommey 2015-10-09 08:35:48 +09:00
parent 53fe63ba3f
commit ee2be20998
4 changed files with 8 additions and 11 deletions

View File

@ -1256,7 +1256,7 @@ endif
libs realchrome:: $(FINAL_TARGET)/chrome
$(call py_action,jar_maker,\
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(QUIET) -d $(FINAL_TARGET) \
$(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) \
$(JAR_MANIFEST))

View File

@ -115,7 +115,7 @@ search-preqs =\
.PHONY: searchplugins
searchplugins: $(search-preqs)
$(call py_action,jar_maker,\
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(QUIET) -d $(FINAL_TARGET) \
-s $(topsrcdir)/$(relativesrcdir)/en-US/searchplugins \
-s $(LOCALE_SRCDIR)/searchplugins \
$(MAKE_JARS_FLAGS) $(search-jar))

View File

@ -229,7 +229,7 @@ class JarMaker(object):
)
p.add_option('--relativesrcdir', type='string',
help='relativesrcdir to be used for localization')
p.add_option('-j', type='string', help='jarfile directory')
p.add_option('-d', type='string', help='base directory')
p.add_option('--root-manifest-entry-appid', type='string',
help='add an app id specific root chrome manifest entry.'
)
@ -378,7 +378,7 @@ class JarMaker(object):
chromebasepath = 'jar:' + chromebasepath + '.jar!'
chromebasepath += '/'
jarfile = os.path.join(jardir, jarinfo.name)
jarfile = os.path.join(jardir, 'chrome', jarinfo.name)
jf = None
if self.outputFormat == 'jar':
# jar
@ -596,4 +596,4 @@ def main(args=None):
infile = sys.stdin
else:
(infile, ) = args
jm.makeJar(infile, options.j)
jm.makeJar(infile, options.d)

View File

@ -166,13 +166,12 @@ class TestJarMaker(unittest.TestCase):
def _jar_and_compare(self, infile, **kwargs):
jm = JarMaker(outputFormat='jar')
jardir = os.path.join(self.builddir, 'chrome')
if 'topsourcedir' not in kwargs:
kwargs['topsourcedir'] = self.srcdir
for attr in ('topsourcedir', 'sourcedirs'):
if attr in kwargs:
setattr(jm, attr, kwargs[attr])
jm.makeJar(infile, jardir)
jm.makeJar(infile, self.builddir)
cwd = os.getcwd()
os.chdir(self.builddir)
try:
@ -239,8 +238,7 @@ class TestJarMaker(unittest.TestCase):
jm = JarMaker(outputFormat='symlink')
jm.sourcedirs = [self.srcdir]
jm.topsourcedir = self.srcdir
jardir = os.path.join(self.builddir, 'chrome')
jm.makeJar(os.path.join(self.srcdir,'jar.mn'), jardir)
jm.makeJar(os.path.join(self.srcdir,'jar.mn'), self.builddir)
# All we do is check that srcdir/bar points to builddir/chrome/test/dir/foo
srcbar = os.path.join(self.srcdir, 'bar')
destfoo = os.path.join(self.builddir, 'chrome', 'test', 'dir', 'foo')
@ -288,8 +286,7 @@ class TestJarMaker(unittest.TestCase):
jm = JarMaker(outputFormat='symlink')
jm.sourcedirs = [self.srcdir]
jm.topsourcedir = self.srcdir
jardir = os.path.join(self.builddir, 'chrome')
jm.makeJar(os.path.join(self.srcdir,'jar.mn'), jardir)
jm.makeJar(os.path.join(self.srcdir,'jar.mn'), self.builddir)
expected_symlinks = {
('bar', 'foo.js'): ('foo.js',),