Skip to content

Commit

Permalink
Merge pull request #4411 from srahim/timob-14270-3_1_X
Browse files Browse the repository at this point in the history
[TIMOB-14270] (3_1_X)Adds support for the New Relic module's dex agent.
  • Loading branch information
ayeung committed Jun 24, 2013
2 parents 4fcc33b + d9b8620 commit 79e653f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions support/android/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2350,6 +2350,24 @@ def jar_includer(path, isfile):
dex_args = [self.java, '-Xmx1024M', '-Djava.ext.dirs=%s' % self.sdk.get_platform_tools_dir(), '-jar', self.sdk.get_dx_jar()]
else:
dex_args = [dx, '-JXmx1536M', '-JXX:-UseGCOverheadLimit']

# Look for New Relic module
newrelic_module = None
for module in self.modules:
if module.path.find("newrelic") > 0:
newrelic_module = module
break

# If New Relic is present, add its Java agent to the dex arguments.
if newrelic_module:
info("Adding New Relic support.")

# Copy the dexer java agent jar to a tempfile. Eliminates white space from
# the module path which causes problems with the dex -Jjavaagent argument.
temp_jar = tempfile.NamedTemporaryFile(suffix='.jar', delete=True)
shutil.copyfile(os.path.join(newrelic_module.path, 'class.rewriter.jar'), temp_jar.name)
dex_args += ['-Jjavaagent:' + os.path.join(temp_jar.name)]

dex_args += ['--dex', '--output='+self.classes_dex, self.classes_dir]
dex_args += self.android_jars
dex_args += self.module_jars
Expand Down

0 comments on commit 79e653f

Please sign in to comment.