jokester / tidyj

a Java (JNI) wrapper of libtidy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tidyj

A Java JNI wrapper for libtidy.

CircleCI

Features

Current: v0.2

  • basic HTML / XML tiding, and not breaking things
  • Android support and an example app

Next: v0.3

  • Control over memory usage

For Users

How to use from Java (gradle)

Currently one need to copy code (lib/src/main), CMake configuration (lib/CMakeLists.txt), and a few gradle tasks (in lib/build.gradle) to use from another Java project.

// I am not sure how should one "publish" native code for traditional Java, or how do Java developers consume them. (If you are familiar of this, creating a issue is more than welcome.)

How to use from Android

Currently one need to copy related files to Android module. See android-demo/ for an example.

Threading

All public APIs of tidyj are thread-safe.

libtidy cares little about thread and concurrency stuff: all code just run on caller thread, and do nothing after return. Not all its APIs are thread safe. We handle that in tidyj.

Memory

Currently (before v0.3), underlying tidylib uses free / memory to allocate memory in completely non-managed native heap.

For developers

How to build

To build the native code, CMake, make and configured C/C++ (both) compilers are required.

# after clone, fetch libtidy as dependcies
$ git submodule init
$ git submodule update

# `test` task will run cmake and make as needed
# If test runs, the build should be fine.
$ ./gradlew lib:test

License

MIT

How to contribute

I am open to help of any kind. If you find something interesting (can | need) to be be done, feel free to create a issue.

About

a Java (JNI) wrapper of libtidy


Languages

Language:HTML 98.7%Language:Java 0.9%Language:C++ 0.3%Language:CMake 0.0%Language:C 0.0%