• Stars
    star
    1,735
  • Rank 26,854 (Top 0.6 %)
  • Language
    Java
  • License
    Other
  • Created about 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spoon is a metaprogramming library to analyze and transform Java source code. 🥄 is made with ❤️, 🍻 and ✨. It parses source files to build a well-designed AST with powerful analysis and transformation API.

Maven Central GHA tests Workflow Status Coverage Status Maintainability Rating Reproducible Builds

Spoon

Spoon is an open-source library to analyze, rewrite, transform, transpile Java source code. It parses source files to build a well-designed AST with powerful analysis and transformation API. It supports modern Java versions up to Java 20. Spoon is an official Inria open-source project, and member of the OW2 open-source consortium.

Documentation

The latest official documentation is available at http://spoon.gforge.inria.fr/.

Academic usage

If you use Spoon for academic purposes, please cite: Renaud Pawlak, Martin Monperrus, Nicolas Petitprez, Carlos Noguera, Lionel Seinturier. “Spoon: A Library for Implementing Analyses and Transformations of Java Source Code”. In Software: Practice and Experience, Wiley-Blackwell, 2015. Doi: 10.1002/spe.2346.

@article{pawlak:hal-01169705,
  TITLE = "{Spoon: A Library for Implementing Analyses and Transformations of Java Source Code}",
  AUTHOR = {Pawlak, Renaud and Monperrus, Martin and Petitprez, Nicolas and Noguera, Carlos and Seinturier, Lionel},
  JOURNAL = "{Software: Practice and Experience}",
  PUBLISHER = "{Wiley-Blackwell}",
  PAGES = {1155-1179},
  VOLUME = {46},
  URL = {https://hal.archives-ouvertes.fr/hal-01078532/document},
  YEAR = {2015},
  doi = {10.1002/spe.2346},
}

Professional support

If you need professional support on Spoon (development, training, extension), you are welcome to post a comment on #3251

Getting started in 2 seconds

Java version: Spoon version 10 and up requires Java 11 or later. Spoon 9.1.0 is the final Spoon release compatible with Java 8, and we do not plan to backport any bug fixes or features to Spoon 9. Note that Spoon can of course still consume source code for older versions of Java, but it needs JDK 11+ to run.

Get latest stable version with Maven, see https://search.maven.org/artifact/fr.inria.gforge.spoon/spoon-core

And start using it:

CtClass l = Launcher.parseClass("class A { void m() { System.out.println(\"yeah\");} }");

Documentation:

Contributing in 2 seconds

Create your first pull request to improve the documentation, see doc! Proceed with your first bug fix! The community is open-minded, respectful and patient. All external contributions are welcome.

Design Philosophy

R1) The Spoon metamodel is as close as possible to the language concepts.

R2) The Spoon model of a program is complete and sound.

R3) The text version of a Spoon model is well-formed and semantically equivalent to the original program.

R4) The analysis and transformation API is intuitive and regular.

R5) Transformation operators are designed to warn as fast as possible about invalid programs. This is done either with static type checking or with dynamic checks when the operators are used.

R6) When feasible, the text version of a Spoon model is close to the original one.

Compiling

To compile Spoon, you need a Java Development Kit (JDK) and Maven:

git clone https://github.com/INRIA/spoon
cd spoon
mvn compile

To run the tests:

mvn test

Download

Latest version: https://search.maven.org/remote_content?g=fr.inria.gforge.spoon&a=spoon-core&v=LATEST&c=jar-with-dependencies - Javadoc

Maven:

<dependency>
    <groupId>fr.inria.gforge.spoon</groupId>
    <artifactId>spoon-core</artifactId>
    <!-- See rendered release value at http://spoon.gforge.inria.fr/ -->
    <version>{{site.spoon_release}}</version>
</dependency>

Releases

  • August 31 2023, Spoon 10.4.1 (changelog)
  • Jul 6 2023, Spoon 10.4.0 (changelog)
  • March 13 2023, Spoon 10.3.0 (changelog)
  • Oct 2022, Spoon 10.2.0 (changelog)
  • April 2022, Spoon 10.1.0 (changelog)
  • October 2021, Spoon 10.0.0 (changelog)
  • August 2021: Spoon 9.1.0 (changelog)
  • March 2021: Spoon 9.0.0 (changelog)
  • October 2020: Spoon 8.3.0 (changelog)
  • July 2020: Spoon 8.2.0 (changelog)
  • March 2020: Spoon 8.1.0 (changelog)
  • November 2019, Spoon 8.0.0 (changelog)
  • July 2019: Spoon 7.5.0 is released (changelog)
  • May 2019: Spoon 7.4.0 is released (changelog)
  • February 10, 2019: Spoon 7.3.0 is released (changelog)
  • December 4, 2018: Spoon 7.2.0 is released (changelog)
  • October 10, 2018: Spoon 7.1.0 is released (changelog)
  • July 4, 2018: Spoon 7.0.0 is released (changelog)
  • March 8, 2018: Spoon 6.2.0 is released (changelog)
  • December 20, 2017: Spoon 6.1.0 is released, merry christmas! 🎄 (changelog)
  • November 17, 2017: Spoon 6.0.0 is released! Check the (changelog) as there are few non backward-compatible changes ⚠️
  • September 6, 2017: Spoon 5.9.0 is released (changelog) back-to-work release!
  • July 11, 2017: Spoon 5.8.0 is released (changelog) Summer release 🍺 To be preferred wrt the previous one: fix lot of bugs.
  • June 01, 2017: Spoon 5.7.0 is released (changelog)
  • March 16, 2017: Spoon 5.6.0 is released (changelog) Spring release :-)
  • January 11, 2017: Spoon 5.5.0 is released (changelog). Happy new year!
  • October 27, 2016: Spoon 5.4.0 is released (changelog).
  • September 19, 2016: Spoon 5.3.0 is released (changelog).
  • June 30, 2016: Spoon 5.2.0 is released (changelog).
  • June 22, 2016: Spoon 5.1.1 is released (changelog).
  • March 21, 2016: Spoon 5.1.0 is released (changelog).
  • February 12, 2016: Spoon 5.0.2 is released (changelog).
  • February 3, 2016: Spoon 5.0.1 is released (changelog).
  • January 25, 2016: Spoon 5.0.0 is released (changelog).
  • November 18, 2015: Spoon 4.4.1 is released (changelog).
  • November 16, 2015: Spoon 4.4.0 is released (changelog).
  • September 22, 2015: Spoon 4.3.0 is released (changelog).
  • June 15, 2015: Spoon 4.2.0 is released (changelog).
  • May 7, 2015: Spoon 4.1.0 is released (changelog).
  • April 8, 2015: Spoon 4.0.0 is released (changelog).
  • February 11, 2015: Spoon 3.1 is released (changelog).
  • December 9, 2014: Spoon 3.0 is released (changelog).
  • November 12, 2014: Spoon 2.4 is released (changelog).
  • October 9, 2014: Spoon 2.3.1 is released (changelog).
  • September 12, 2014: Spoon 2.1 is released (changelog).
  • April 2, 2014: Spoon 2.0 is released (changelog).
  • September 30, 2013: Spoon 1.6 is released.
  • April 12, 2012: Spoon 1.5 is released.

License

Spoon is Free and Open Source, double-licensed under the (CeCILL-C license - French equivalent to LGPL) and the MIT license.

JProfiler

Spoon is developed with the help of JProfiler, a Java profiler by ej-technologies GmbH. JProfiler supports the development of Spoon by providing its full-featured Java Profiler for free. We thank ej-technologies GmbH for this support.

JProfiler

Github Contributors

This list is generated by chore/generate-contributor-list.py. If you're not listed or you'd like to have your full name, please post to #3909.

  • adamjryan
  • Alcides Fonseca
  • Alexander Shopov
  • Aman Sharma
  • andrewbwogi
  • André Cruz
  • André Silva
  • Antoine Mottier
  • Anton Lyxell
  • argius
  • Arnaud Blouin
  • arsenkhy
  • Artamm
  • Artur Bosch
  • aryan
  • Ashutosh Kumar Verma
  • aveuiller
  • Axel Howind
  • Benjamin DANGLOT
  • Benoit Cornu
  • Carlos Noguera
  • Ceki Gülcü
  • Charm
  • ChrisSquare
  • Christophe Dufour
  • Christopher Stokes
  • Clemens Bartz
  • Clément Fournier
  • César Soto Valero
  • Darius Sas
  • David Bernard
  • Didier Donsez
  • Diorcet Yann
  • dufaux
  • dwayneb
  • dya-tel
  • Eddie T
  • Egor Bredikhin
  • Fabien DUMINY
  • Fan Long
  • fangzhen
  • fav
  • Favio DeMarco
  • Fernanda Madeiral
  • Filip Krakowski
  • Gabriel Chaperon Burgos
  • gibahjoe
  • GluckZhang
  • Gregor Zeitlinger
  • gtoison
  • Guillaume Toison
  • Gérard Paligot
  • Hannes Greule
  • Haris Adzemovic
  • HectorSM
  • Henry Chu
  • Horia Constantin
  • I-Al-Istannen
  • intrigus-lgtm
  • jakobbraun
  • Jan Galinski
  • jon
  • Kai Luo
  • Lakshya A Agrawal
  • leventov
  • Lionel Seinturier
  • lodart
  • Lukas Krejci
  • Luke Merrick
  • Marcel Manseer
  • Marcel Steinbeck
  • Martin Monperrus
  • MartinWitt
  • Matias Martinez
  • Maxim Stefanov
  • Maxime CLEMENT
  • Mehdi Kaytoue
  • Michael Täge
  • Mickael Istria
  • Miguel Sozinho Ramalho
  • Mikael Forsberg
  • Muhammet Ali AKBAY
  • Nicolas Harrand
  • Nicolas Pessemier
  • Nicolas Petitprez
  • Noah Santschi-Cooney
  • Olivier Barais
  • Ondřej Šebek
  • Pavel Vojtechovsky
  • peroksid90
  • Phillip Schichtel
  • Quentin LE DILAVREC
  • raymogg
  • Renaud Pawlak
  • Reza Gharibi
  • Rhys Compton
  • Rick Kellogg
  • Rijnard van Tonder
  • Rohitesh Kumar Jain
  • Roman Leventov
  • santos-samuel
  • scootafew
  • Scott Dickerson
  • Scott Pinwell
  • Sebastian Lamelas Marcote
  • Sergey Fedorov
  • Shantanu
  • Simon Larsén
  • Simon Urli
  • Spencer Williams
  • srlm
  • ST0NEWALL
  • Stefan Wolf
  • Sébastien Bertrand
  • Thimo Seitz
  • Thomas Durieux
  • tiagodrcarvalho
  • Tomasz Zieliński
  • Urs Keller
  • Viktor
  • Vincenzo Musco
  • Wolfgang Schmiesing
  • Wouter Smeenk
  • Wreulicke
  • Yann Diorcet
  • Zhang Xindong
  • Дмитрий

More Repositories

1

scikit-learn-mooc

Machine learning in Python with scikit-learn MOOC
Jupyter Notebook
1,026
star
2

VisualSedimentation

Visual sedimentation is a novel design metaphor that progressively generates and updates visualizations of streaming data, inspired by the process of physical sedimentation. This process is the result of objects falling due to gravity forces, that aggregate into compact layers over time. The process is well understood since our environment is shaped by sedimentation: mountains, hills or rivers are the visible result of this long process.
JavaScript
242
star
3

awesome-open-science-software

awesome open list of pointers about open science for software and computational science
136
star
4

velus

A Lustre compiler in Coq
Coq
57
star
5

libpointing

An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
C++
51
star
6

zelus

A synchronous language with ODEs
OCaml
49
star
7

atable

Making better ranking tables since 2014
JavaScript
40
star
8

osc

Outil de suivi des Contrats / Outil de suivi des Budgets : Application Ruby On Rails permettant le Suivi des Contrats et des budgets correspondant dans le contexte d'une entité de recherche (EPST, Laboratoire, Université, etc.).
Ruby
7
star
9

aiana-player

Media player focusing on cognitive impairments. Formerly known as the "Aiana Project".
TypeScript
6
star
10

hybridvis

A tool to create visualizations using the hybrid image method
Emacs Lisp
5
star
11

Visualization-Literacy-101

Visualization Literacy 101 is an initial attempt at designing calibrated visualization literacy tests for line graphs, bar charts, and scatterplots.
JavaScript
4
star
12

intertrace

Interaction Trace Logger and Browser
JavaScript
3
star
13

mooc-accessibility-static

MOOC Accessibility course static website
HTML
2
star
14

IFIPSpecifications

Specifications for the HAL-based IFIP library
XSLT
1
star
15

mooc-accessibility-api

Inria MOOC Accessibilité Numérique API
Python
1
star