Bug 1256

Summary: Provide General GlueGen Annotation Processor (Replacing specialized CStruct)
Product: [JogAmp] Gluegen Reporter: Erik De Rijcke <derijcke.erik>
Component: coreAssignee: Sven Gothel <sgothel>
Status: IN_PROGRESS ---    
Severity: enhancement    
Priority: P3    
Version: tbd   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
Workaround: ---

Description Erik De Rijcke 2015-10-22 22:13:07 CEST
This bug report is based on the work done here:
https://github.com/Zubnix/gluegen

The goal of this work is to be able to invoke gluegen through a compile time annotation placed on a package (package-info.java).

Currently a working version of this goal is available at above repository.

However no working junit tests are available.

Ant gluegen task:
The current build-test.xml does 3 invocations of gluegen with 3 different cfg files. Each gluegen invocation depends on the previous invocation to properly emit source code.

After these 3 ant task gluegen invocations, the junit test classes are compiled. This mechanism works fine as the gluegen invocations themself do not perform any compilation beforehand.

Annotation processor:
The above repository tries to mimic the ant gluegen task by reusing (slightly adapting to avoid clashes) the available gluegen cfgs. To trigger a gluegen invocation, javac is invoked 3 times by ant with the gluegen annotation processor.  Each time with a different cfg, to mimic the original test case. 

This fails immediatly as the junit test classes are also compiled. Since these test classes have references to generated code that is only available in subsequent gluegen invocations.


The goal of this bugreport is to reorganise/find a way to make gluegen invocation through annotation processor testable in the current gluegen ant setup.
Comment 1 Sven Gothel 2015-10-22 23:13:29 CEST
Headline was: GlueGen Annotation processor - ant junit test setup
Comment 2 Sven Gothel 2015-10-22 23:17:58 CEST
The GlueGen annotation processor shall enable users 
to invoke GlueGen for any use cases as if invoked via commandline or ant-task.

Today we only had the CStruct annotation processor for 'C structs' only,
which is an unnecessary limitation.

The new generic GlueGen annotation simplifies build recipes,
since it removes the requirement to separately issue the GlueGen call
into the build chain.