Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Excluding decompiler related features from spoon-core #2766

Merged
merged 23 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ env:
- SCRIPT=travis-verify.sh
- SCRIPT=travis-maven339-jdk8.sh
- SCRIPT=travis-jdk10.sh
# - SCRIPT=travis-spoon-bytecode-jdk8.sh
nharrand marked this conversation as resolved.
Show resolved Hide resolved
# - SCRIPT=travis-spoon-bytecode-verify.sh

install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -B -V
script: ./chore/travis/$SCRIPT
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ CtClass l = Launcher.parseClass("class A { void m() { System.out.println(\"yeah\

Some examples about the usage of Spoon can be found on [spoon-examples](https://github.com/SpoonLabs/spoon-examples).

:warning: We introduced in Spoon 7.1.0 an external dependency that is not available on Maven Central.
nharrand marked this conversation as resolved.
Show resolved Hide resolved
In order to use it properly, please add also the following repository in your pom:

:warning: We introduced in Spoon 7.1.0 an external dependency that is not available on Maven Central.
In order to use classes from this dependency, please add also the following repository in your pom:
```
<repositories>
<repository>
Expand All @@ -60,7 +59,7 @@ In order to use it properly, please add also the following repository in your po
</repository>
</repositories>
```

From version 7.2.0, the dependency in question is removed from `spoon-core`.

## Contributing in 2 seconds

Expand Down
2 changes: 1 addition & 1 deletion chore/travis/travis-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# This script computes and publish (through coveralls) the coverage of Spoon
# It is meant to berun on TravisCI
# It is meant to be run on TravisCI
#
# Note thet Coveralls/Jacoco does not work on JDK9, see https://github.com/trautonen/coveralls-maven-plugin/issues/112

Expand Down
10 changes: 10 additions & 0 deletions chore/travis/travis-spoon-bytecode-jdk8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# This script intends to be run on TravisCI
# It executes compile and test goals

source /opt/jdk_switcher/jdk_switcher.sh

cd spoon-bytecode

jdk_switcher use oraclejdk8 & mvn -Djava.src.version=1.8 test
21 changes: 21 additions & 0 deletions chore/travis/travis-spoon-bytecode-verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# This script intends to be run on TravisCI
# it runs verify and site maven goals
# and to check documentation links

# fails if anything fails
set -e

source /opt/jdk_switcher/jdk_switcher.sh

pip install --user CommonMark==0.7.5 requests pygithub
nharrand marked this conversation as resolved.
Show resolved Hide resolved

jdk_switcher use oraclejdk9

cd spoon-bytecode

mvn -Djava.src.version=1.9 verify license:check site javadoc:jar install -DskipTests -DadditionalJOption=-Xdoclint:none

# checkstyle in src/tests
mvn checkstyle:checkstyle -Pcheckstyle-test
1 change: 1 addition & 0 deletions doc/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ public class InsertPrintTransformer implements TypeTransformer {
}
}
```
:warning: The `SpoonClassFileTransformer` feature (and all features relying on decompilation) are not included in `spoon-core` but in `spoon-bytecode`. If you want to use them you should declare a dependency to `spoon-bytecode`.
2 changes: 2 additions & 0 deletions doc/launcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ Spoon provides two out of the shelf decompilers, CFR by default, and Fernflower.
JarLauncher launcher = new JarLauncher("<path_to_jar>", "<path_to_output_src_dir>", "<path_to_pom>", new FernflowerDecompiler(new File("<path_to_output_src_dir>/src/main/java")));
```

:warning: The `JarLauncher` feature (and all features relying on decompilation) are not included in `spoon-core` but in `spoon-bytecode`. If you want to use them you should declare a dependency to `spoon-bytecode`.

## About the classpath

Spoon analyzes source code. However, this source code may refer to libraries (as a field, parameter, or method return type). There are two cases:
Expand Down
200 changes: 4 additions & 196 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,205 +20,26 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-pom</artifactId>
<version>7.2.0-SNAPSHOT</version>
<relativePath>spoon-pom</relativePath>
</parent>

<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<packaging>jar</packaging>
<version>7.2.0-SNAPSHOT</version>
<name>Spoon Core</name>
<description>Spoon is a tool for meta-programming, analysis and transformation of Java programs.</description>
<url>http://spoon.gforge.inria.fr/</url>
<inceptionYear>2007</inceptionYear>

<licenses>
<license>
<name>CeCILL-C</name>
<comments>French equivalent to LGPL</comments>
<url>http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<organization>
<name>Inria</name>
<url>http://www.inria.fr</url>
</organization>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/INRIA/spoon/issues</url>
</issueManagement>

<!-- to generate the list for the README -->
<!-- xmlstarlet sel -t -m "//_:developer/_:name" -o "* " -v . -n pom.xml -->
<developers>
<developer>
<name>Olivier Barais</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>David Bernard</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Benoit Cornu</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Didier Donsez</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Favio DeMarco</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Christophe Dufour</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Nicolas Harrand</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Sebastian Lamelas Marcote</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Matias Martinez</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Martin Monperrus</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Carlos Noguera</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Renaud Pawlak</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Nicolas Pessemier</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Nicolas Petitprez</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Phillip Schichtel</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Lionel Seinturier</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Stefan Wolf</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Gérard Paligot</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
<developer>
<name>Alcides Fonseca</name>
<roles>
<role>Contributor</role>
</roles>
</developer>
</developers>

<scm>
<url>https://github.com/INRIA/spoon</url>
<connection>scm:git:https://github.com/INRIA/spoon.git</connection>
<developerConnection>scm:git:ssh://github.com/INRIA/spoon.git</developerConnection>
<tag>HEAD</tag>
</scm>

<properties>
<java.src.version>1.8</java.src.version>
<java.test.version>1.8</java.test.version>
<runtime.log>target/velocity.log</runtime.log>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.cfr>0.132.0</version.cfr>
</properties>

<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>maven.inria.fr-snapshot</id>
<name>Maven Repository for Spoon Snapshots</name>
<url>http://maven.inria.fr/artifactory/spoon-public-snapshot</url>
</snapshotRepository>
<site>
<id>gforge.inria.fr-site</id>
<name>inria</name>
<url>scp://scm.gforge.inria.fr/home/groups/spoon/htdocs/mvnsites/spoon-core</url>
</site>
</distributionManagement>

<repositories>
<!-- This repository is actually needed for revapi to compare against the last Spoon Snapshot -->
<repository>
<id>maven.inria.fr-snapshot</id>
<name>Maven Repository for Spoon Snapshots</name>
<url>http://maven.inria.fr/artifactory/spoon-public-snapshot</url>
</repository>
<!-- This repository is needed for cfr -->
<repository>
<id>inria</id>
<name>triskell-public-release</name>
<url>http://maven.inria.fr/artifactory/triskell-public-release</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.eclipse.jdt</groupId>
Expand Down Expand Up @@ -309,24 +130,11 @@
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.windup.decompiler.fernflower/fernflower -->
<dependency>
<groupId>org.jboss.windup.decompiler.fernflower</groupId>
<artifactId>fernflower</artifactId>
<version>2.5.0.Final</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<!-- released on maven.inria.fr -->
<groupId>org.benf</groupId>
<artifactId>cfr</artifactId>
<!-- 0.132 is the version of July 2018 -->
<version>0.132.0</version>
</dependency>
</dependencies>

<build>
Expand Down
Loading