'. '

TruffleSigtest

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(The Right Tool)
(The Right Tool)
Line 6: Line 6:
Slight problem was that the tool hasn't been updated to [[JDK]]8 language constructs (e.g. '''default''' and '''static''' methods in interfaces). However, as [[NetBeans]] need to use the tool as well, I got a great help from Tomáš Zezula. He is currently working on switching the [[NetBeans]] codebase to [[JDK]]8 and he updated the [[netbeans:APITest|APITest]] to deal properly with [[JDK]]8 features (see [http://hg.netbeans.org/apitest/rev/33e52387e536 here] and [http://hg.netbeans.org/apitest/rev/1d8a2a522dab here]). It is always [[good]] to build on shoulders of giants - e.g. use a tool that a mature project like [[NetBeans]] maintains.
Slight problem was that the tool hasn't been updated to [[JDK]]8 language constructs (e.g. '''default''' and '''static''' methods in interfaces). However, as [[NetBeans]] need to use the tool as well, I got a great help from Tomáš Zezula. He is currently working on switching the [[NetBeans]] codebase to [[JDK]]8 and he updated the [[netbeans:APITest|APITest]] to deal properly with [[JDK]]8 features (see [http://hg.netbeans.org/apitest/rev/33e52387e536 here] and [http://hg.netbeans.org/apitest/rev/1d8a2a522dab here]). It is always [[good]] to build on shoulders of giants - e.g. use a tool that a mature project like [[NetBeans]] maintains.
 +
 +
Download the [[netbeans:APITest|APITest]] from [http://deadlock.netbeans.org/job/apitest/ here].
 +
 +
==== Integrate into Build Process ====
 +
 +
[[SignatureTests|Signature testing]] needs to be integrated into build process of your project - in case there is a violation with respect to [[BackwardCompatibility]], the build should fail. As (almost) every big project "needs" its own build harness, the way to integrate differs. For example, [[NetBeans]] is using [[Ant]] based harness and thus one deals with the signature testing tool via [[Ant]] as described at [[netbeans:SignatureTest]] page.
 +
 +
The [[Truffle]] project (as well as [[Graal]]) is using [[Python]] based harness. As such [[I]] had to write a bit of [[Python]] code to integrate the [[netbeans:APITest|APITest]] into it (see [https://bitbucket.org/allr/mx/src/e7fa425baca686c418ffa3cb521fa3f853a994a6/mx_sigtest.py here]).

Revision as of 18:07, 20 November 2015

API signature tests are part of Truffle project workflow since today! Let me describe what I have done, as similar changes are likely needed in any Java project that wants to use SignatureTests to keep backward compatibility of its APIs.

The Right Tool

First and foremost one needs to select a signature testing tool. As my background is related to NetBeans, my choice was almost guaranteed. I decided to use NetBeans APITest.

Slight problem was that the tool hasn't been updated to JDK8 language constructs (e.g. default and static methods in interfaces). However, as NetBeans need to use the tool as well, I got a great help from Tomáš Zezula. He is currently working on switching the NetBeans codebase to JDK8 and he updated the APITest to deal properly with JDK8 features (see here and here). It is always good to build on shoulders of giants - e.g. use a tool that a mature project like NetBeans maintains.

Download the APITest from here.

Integrate into Build Process

Signature testing needs to be integrated into build process of your project - in case there is a violation with respect to BackwardCompatibility, the build should fail. As (almost) every big project "needs" its own build harness, the way to integrate differs. For example, NetBeans is using Ant based harness and thus one deals with the signature testing tool via Ant as described at netbeans:SignatureTest page.

The Truffle project (as well as Graal) is using Python based harness. As such I had to write a bit of Python code to integrate the APITest into it (see here).

Personal tools
buy