rovo89 / XposedBridge

The Java part of the Xposed framework.
3.91k stars 1.1k forks source link

Add gradle build file #43

Closed shakalaca closed 8 years ago

shakalaca commented 9 years ago

For the love of gradle :)

Signed-off-by: Shaka Huang shakalaca@gmail.com

pR0Ps commented 8 years ago

Does this build file generate an XposedBridgeApi.jar file?

rovo89 commented 8 years ago

I have spent some time in the past few days to come up with a solution that rebuilds the hidden API stubs if required, without relying on the prebuilt jar. I have pushed it to https://github.com/rovo89/XposedBridge/tree/gradle. I plan to merge it to the "art" branch soon, but if anyone has any recommendations for changes, please mention them.

@pR0Ps Do you really mean the API (the file that developers build their modules against)? There shouldn't be any need to compile it yourself. If you extend the API with new functions, they would only be usable in a custom version of the framework.

If you mean XposedBridge.jar instead (the file that is installed on the device): That's simply the renamed APK (i.e. app/build/apk/app-release-unsigned.apk). The build script is also adjusted to include the required build steps: https://github.com/rovo89/XposedTools/tree/gradle

pR0Ps commented 8 years ago

@rovo89: I do mean the actual API jar file that developers build against (the one that you've provided here).

The reason for this is that I'd like to be able to build a module completely from source. This includes any jar files that are required to build it. I don't have any intention of doing any modifications to it before building.

rovo89 commented 8 years ago

Remember that this jar, unlike others, must not be included in your module, there are only references to the classes which will be resolved at runtime from the actual XposedBridge.jar that the user has installed. So it's comparable to the Android SDK. I assume you don't compile that yourself either, so I recommend to just reference the provided jar.

For the future, I plan to make a proper API release with just the methods that modules are allowed to use. That one would also be uploaded to a repository for use in Gradle. But I'm not there yet.

shakalaca commented 8 years ago

@rovo89 I'll close this pr since your solution is much better and correct than this hack, thank you and happy new year ! :)