Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module support for -javaagent arguments to dex command #5645

Closed
wants to merge 2 commits into from

Conversation

kennr
Copy link
Contributor

@kennr kennr commented Apr 24, 2014

Added option for module developers to specify a property name of "dexAgent" with a jar file name in their timodule.xml. This allows for prepending the dexArgs in the runDexer function with "-javaagent:", which is necessary for some modules.

@cb1kenobi @ingo

We tried using the build hook system, but it does not allow for the correct placement of "-javaagent" in the dexArgs. This is a generic solution for any module developers who need to add -javaagent. They put the .jar file in their modules directory add this line to their timodule.xml:
class.foo.jar

@kennr
Copy link
Contributor Author

kennr commented Apr 24, 2014

Oops, this is the whole line that should be added to their timodule.xml if they want -javaagent:

<property name="dexAgent" type="string">class.foo.jar</property>

@skypanther
Copy link
Contributor

I've created https://jira.appcelerator.org/browse/TIMOB-18114 to correspond to this PR.

@kennr Have you signed the CLA?

Would you also update this PR so that it's in sync with the current master?

@@ -3806,7 +3813,11 @@ AndroidBuilder.prototype.runDexer = function runDexer(next) {
'--output=' + this.buildBinClassesDex,
this.buildBinClassesDir,
path.join(this.platformPath, 'lib', 'titanium-verify.jar')
].concat(Object.keys(this.moduleJars)).concat(Object.keys(this.jarLibraries));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this line need to be changed? It appears to be changed for no reason. I prefer it be restored.

@kennr
Copy link
Contributor Author

kennr commented Dec 2, 2014

@skypanther Thank you! I'm waiting for the OK from our end before signing the CLA, but in the meantime, I've updated the PR so it's in sync with the current master.

@cb1kenobi I've since added comments in the PR explaining a little why this changed. The -javaagent arg needs to come before the rest of the dexArgs, otherwise it won't work for our dex process. As you'll see at the bottom of our change, the line is restored, just with the dexArgs updated.

Here is our latest module that you can test the dexAgent option with. You'll notice the android module's timodule.xml file now has the dexAgent property in it:
<property name="dexAgent" type="string">class.rewriter.jar</property>

Thanks!

@cb1kenobi
Copy link
Contributor

@kennr Array.unshift() will place the specified value at the beginning of the array regardless of the array's length. There was no point in moving the concat() calls.

Cleaned this up by putting the concat() call back.
@ingo
Copy link
Contributor

ingo commented Dec 4, 2014

Attention: We do not appear to have a record of @kennr signing the contributors license agreement (CLA). This is a required step for all open-source contributions. If you are the contributor, please visit Appcelerator CLA for more information. If you believe you signed already and you have received this message in error, please email cla@appcelerator.com and we will address it promptly.

@kennr
Copy link
Contributor Author

kennr commented Dec 19, 2014

@ingo @cb1kenobi The CLA has been signed by the necessary parties at New Relic today, December 18th. Please let me know if there's anything else that needs to be done for this to move forward. Thanks!

@cb1kenobi
Copy link
Contributor

CR looks good. Needs a FR. @kennr how do we test this?

@kennr
Copy link
Contributor Author

kennr commented Dec 19, 2014

@cb1kenobi Here is our latest module that you can test the dexAgent option with. You'll notice the android module's timodule.xml file now has the dexAgent property in it:
<property name="dexAgent" type="string">class.rewriter.jar</property>

You can also verify this PR doesn't break by building and running the Kitchen Sink app or any other app with a module that doesn't have the dexAgent property. If you'd like to verify the data you're sending to New Relic, I can set you up with a trial account (that's not public). Let me know if you need anything.

Thanks!

@kennr
Copy link
Contributor Author

kennr commented Jan 14, 2015

@cb1kenobi Just checking in on the status of this. Do you need anything else from us on this PR or are we good to go? Thanks!

@ingo
Copy link
Contributor

ingo commented Jan 14, 2015

@kennr We will be testing this next sprint. Thanks!

@hansemannn
Copy link
Collaborator

Closing this PR in favor of the above linked one. Thanks!

@hansemannn hansemannn closed this Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants