Uncodin / bypass

Skip the HTML, Bypass takes markdown and renders it directly on Android and iOS.
http://uncodin.github.com/bypass/
Apache License 2.0
1.52k stars 193 forks source link

Gradle Support? #138

Open andrewgiang opened 11 years ago

andrewgiang commented 11 years ago

Hi was wondering if you could add gradle support for this library thanks!

DDRBoxman commented 11 years ago

Once NDK support gets added to the Android Gradle build system.

dlew commented 10 years ago

NDK support has been added to Gradle as of 0.7.0.

casidiablo commented 10 years ago

Any progress on this?

PabloK commented 10 years ago

Im also in need of this.

casidiablo commented 10 years ago

Fortunately, library per se is really small, so I ended up copying the Java class, and the .so files to my project. But I'm still waiting for this to be upgraded.

PabloK commented 10 years ago

Thank you for the tip at the moment i will wait for the aar. But I might do as you later if this is not fixed.

krngrvr09 commented 10 years ago

Hey @casidiablo , could you please explain where did you copy the Java classes and the .so files. thanks a lot! :D

ekx commented 10 years ago

I would also really appreciate aar packages.

@krngrvr09: The java files should just go into the src folder with the other java files (of course the package structure should be kept). I put the .so files in a folder called "native-libs" and use the following gradle script.

task copyNativeLibs(type: Copy) {
    from(new File(getProjectDir(), 'native-libs')) { include '**/*.so' }
    into new File(buildDir, 'native-libs')
}

tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }

clean.dependsOn 'cleanCopyNativeLibs'

tasks.withType(PackageApplication) { pkgTask ->
    pkgTask.jniFolders = new HashSet<File>()
    pkgTask.jniFolders.add(new File(buildDir, 'native-libs'))
}

You can take a look at how I did it here

krngrvr09 commented 10 years ago

So I am putting Bypass.java, Element.java and Document.java in the src folder. And, this might be a very trivial question, but where are the .so files?

ekx commented 10 years ago

You mean where you get them from? You have to compile it like described here Or do you mean where to put them? It doesnt matter as long as you modify the script accordingly (In the script and my example the folder "native-libs" is used.)

krngrvr09 commented 10 years ago

Oh yes. I got that. thank you so much for your help. :D I am now getting an error Error:(50, 0) Could not find property 'PackageApplication' on project <project_name>. Have you encountered thisbefore, or do you know how to fix it? Thanks in advance.

ekx commented 10 years ago

Not really. Where did you add the script I posted? It should be added in the "build.gradle" file of the subproject.

krngrvr09 commented 10 years ago

Yeah, I added it there only. Is there anything else I should be aware of? I have not set up the NDK. Is that why the issue is coming? But as far as I understand, the NDK does the job of compiling the code, and putting the .so files in the required folder, which is exactly what we're skipping, right?

ekx commented 10 years ago

You have to compile them once and put them in the native-libs folder. After that the NDK isn't needed anymore.

krngrvr09 commented 10 years ago

Okay, understood. But this still doesn't solve the error posted above. Lets see. I'll keep you updated about the progress. Thanks again.

krngrvr09 commented 10 years ago

Hey! So, the build is now running successfully. I had to manually import PackageApplication. So, now I am getting a different error: java.lang.UnsatisfiedLinkError: Native method not found: com.usebackpack.Bypass.processMarkdown:. Any idea?

casidiablo commented 10 years ago

That usually means that Java could not find/load the native libraries. Are you sure they are in the APK?

Also, for an example of how I use the libs directly, take a look at https://github.com/casidiablo/github-jobs/tree/develop

krngrvr09 commented 10 years ago

Hey @casidiablo , You are not using android studio, right?

casidiablo commented 10 years ago

@krngrvr09 I do. But these days I use just plain IntelliJ.

martnst commented 10 years ago

@ekx Thanks for you post.

romainpiel commented 10 years ago

I would love that too, any updates on uploading an aar to maven central? Right now, using a git submodule and configuring it this way is not ideal.. https://github.com/RomainPiel/bypass/blob/master/platform/android/library/build.gradle

nootfly commented 9 years ago

and update here?

incubator commented 9 years ago

@RomainPiel @nootfly NDK support in Gradle is very straight forward. Take a look at this article. http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/

artworkad commented 9 years ago

:+1: this needs to be on gradle.

KynoYang commented 9 years ago

any progress on this?

PerfectCarl commented 9 years ago

I would be interested in this

jipeprojects commented 9 years ago

:+1:

magmaerupts commented 9 years ago

+1 gradle support

damien5314 commented 9 years ago

+1

St3ffn commented 9 years ago

+1

Jawnnypoo commented 9 years ago

For your convenience, I have compiled Bypass into a gradle compatible library here: https://github.com/Commit451/bypasses

stefan-niedermann commented 9 years ago

+1

sagiller commented 8 years ago

really want gradle been supported.

amit-upadhyay-IT commented 7 years ago

To easily import the updated bypass library in android follow this link - https://github.com/amit-upadhyay-IT/bypass-android