Thursday, September 21, 2017

JDK 9 + JEP-238 + Maven + Preprocessor

I have made small example project to show how to use Java preprocessor and Maven to build multi-release JAR (as described in JEP-238) which is supported in JDK 9.

Sunday, September 3, 2017

JBBP 1.3.0

Java Binary Block Parser 1.3.0 is out and accessible in the Maven Central. The Main feature of the version - to generate Java class sources from JBBP scripts, the feature allows to use the framework for more or less high-load systems. The Library still has size less than 200 kBt but since the version it needs Java 1.6+ (minimal Android version is still 2.0). Also there are published two plugins for Maven and Gradle which allow to generate Java classes from JBBP scripts on fly during project build phase.
Also of course minor refactoring and bugfixing.
The Library is used by Orange for its Datavenue Live Objects service

Sunday, February 12, 2017

JCP 6.1.1 is out

New version of Java Comment Preprocessor 6.1.1 is out. In the New Version mainly improved maven options and improved some text functions to make it more compatible with GoLang.
Now it is possible preprocess GoLang and it is possible to load a binary file and represent it as a byte array through just only line command (see example)
var imageArray = []uint8{/*$binfile("./image.png","uint8[]")$*/}

Monday, November 7, 2016

mvn-golang plugin 2.1.2 is out

Maven plugin to work with GoLang in maven is out and accessible through the Maven central. Also I made some example of project with multiple modules and shared sources, it can be downloaded as zip or investigated in github

Sunday, October 9, 2016

How to compile Prolog with GProlog and SWI-Prolog (Linux)


Application must contain such piece of code

 Then executable file can be built with
gplc --min-size
To decrease size of resulted file just use upx utlity
upx --all-methods exeFile


Add some main goal into Prolog application
main :- Goal, Goal, Goal.
Compile with string
swipl -O --foreign=save --toplevel=halt --goal=main --stand_alone=true -o exeFile -c
Check usage of system libraries with
ldd exeFile
It will show something like =>  (0x00007ffcdc3f8000) => /usr/lib/ (0x00007febe1ec8000) => /lib/x86_64-linux-gnu/ (0x00007febe1cab000) is used by the executable file and must be bundled together with compiled file

Sunday, August 7, 2016

added one more example for JBBP

Added one more example for JBBP to show how to add a custom type into parser, as example I have written a parser for three byte non-signed integer value with "int24" as name of the type . The Example formed as a JUnit test and published in the GitHub.

Sunday, July 3, 2016

Java Comment Preprocessor 6.1.0

The New 6.1.0 version of Java Comment Preprocessor is out and published in Maven central. From main features of the new version I can distinguish
added option to enable whitespace between comment chars and directive, it 1) makes possible to write in such style
// #local VAR="hello"
also spaces will be allowed in //$$, //$ and /*-*/ directives
2) fixed bug in work with absolute path files
3) added function binfile(STR,STR) which converts binary files into text representation
byte[] TEXT=byte[]{/*$binfile("./file.bin","byte[]")$*/};
will be converted into
byte[] TEXT=byte[]{(byte)0x89,(byte)0x50,(byte)0x4E,(byte)0x47,(byte)0xD,(byte)0xA,(byte)0x1A,(byte)0xA};
it supports "base64","base64s" (it splits text to 80 char lines), "byte[]" and "byte[]s"