aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny van Bruggen <lol@meuk.info>2017-07-10 20:58:30 +0200
committerGitHub <noreply@github.com>2017-07-10 20:58:30 +0200
commit8b7773fd2265511c7d3f99e686aa8b4a44ea4b40 (patch)
tree1f7ed7aa787b063d95b1dd7a1c05d014603abd01
parent85f7b387757558d6599e6dc038008c66ad83bb88 (diff)
parent64e1a3c1dd50f50e3a25af04234a5f404c47cf36 (diff)
downloadjavaparser-8b7773fd2265511c7d3f99e686aa8b4a44ea4b40.tar.gz
Merge pull request #993 from matozoid/issue_992_module_redo
Issue 992 module redo
-rw-r--r--javaparser-core-generators/pom.xml59
-rw-r--r--javaparser-metamodel-generator/pom.xml56
-rw-r--r--pom.xml2
-rw-r--r--readme.md6
-rwxr-xr-xrun_core_generators.sh3
-rwxr-xr-xrun_metamodel_generator.sh2
6 files changed, 75 insertions, 53 deletions
diff --git a/javaparser-core-generators/pom.xml b/javaparser-core-generators/pom.xml
index 226de85dd..916ef5ba5 100644
--- a/javaparser-core-generators/pom.xml
+++ b/javaparser-core-generators/pom.xml
@@ -3,12 +3,12 @@
<parent>
<artifactId>javaparser-parent</artifactId>
<groupId>com.github.javaparser</groupId>
- <version>3.2.9-SNAPSHOT</version>
+ <version>3.2.11-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>javaparser-core-generators</artifactId>
- <description>A visitor generator framework, and the generators for javaparser-core</description>
+ <description>A code generator framework, and the generators for javaparser-core</description>
<dependencies>
<dependency>
@@ -18,29 +18,34 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.6.0</version>
- <executions>
- <execution>
- <id>generate-javaparser-core</id>
- <phase>test</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <classpathScope>test</classpathScope>
- <mainClass>com.github.javaparser.generator.core.CoreGenerator</mainClass>
- <arguments>
- <argument>${project.basedir}</argument>
- </arguments>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <profiles>
+ <profile>
+ <id>run-core-generators</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.6.0</version>
+ <executions>
+ <execution>
+ <id>generate-javaparser-core</id>
+ <phase>test</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <classpathScope>test</classpathScope>
+ <mainClass>com.github.javaparser.generator.core.CoreGenerator</mainClass>
+ <arguments>
+ <argument>${project.basedir}</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/javaparser-metamodel-generator/pom.xml b/javaparser-metamodel-generator/pom.xml
index 25463824e..ff3eae8f5 100644
--- a/javaparser-metamodel-generator/pom.xml
+++ b/javaparser-metamodel-generator/pom.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javaparser-parent</artifactId>
<groupId>com.github.javaparser</groupId>
- <version>3.2.9-SNAPSHOT</version>
+ <version>3.2.11-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -21,27 +22,6 @@
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.6.0</version>
- <executions>
- <execution>
- <id>generate-javaparser-metamodel</id>
- <phase>test</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <classpathScope>test</classpathScope>
- <mainClass>com.github.javaparser.generator.metamodel.MetaModelGenerator</mainClass>
- <arguments>
- <argument>${project.basedir}</argument>
- </arguments>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
@@ -53,4 +33,34 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>run-metamodel-generator</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.6.0</version>
+ <executions>
+ <execution>
+ <id>generate-javaparser-metamodel</id>
+ <phase>test</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <classpathScope>test</classpathScope>
+ <mainClass>com.github.javaparser.generator.metamodel.MetaModelGenerator</mainClass>
+ <arguments>
+ <argument>${project.basedir}</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/pom.xml b/pom.xml
index b49a26eda..f6c88c8bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,6 +3,8 @@
<modules>
<module>javaparser-core</module>
<module>javaparser-testing</module>
+ <module>javaparser-core-generators</module>
+ <module>javaparser-metamodel-generator</module>
</modules>
<groupId>com.github.javaparser</groupId>
diff --git a/readme.md b/readme.md
index 797f5ea38..c4dc3de2c 100644
--- a/readme.md
+++ b/readme.md
@@ -59,6 +59,12 @@ If you checkout the sources and want to view the project in an IDE, it is best t
mvn javacc:javacc
```
+If you modify the code of the AST nodes, specifically if you add or remove fields or node classes,
+a lot of stuff needs to be rebuilt.
+The `run_metamodel_generator.sh` script will rebuild the metamodel,
+which is used by the code generators which are run by `run_core_generators.sh`
+Make sure that `javaparser-core` at least compiles before you run these.
+
## Manual
Examples of how to use the library can be found on the [Manual](https://github.com/javaparser/javaparser/wiki/Manual) page of the wiki
diff --git a/run_core_generators.sh b/run_core_generators.sh
index e7dfac220..517e7e963 100755
--- a/run_core_generators.sh
+++ b/run_core_generators.sh
@@ -7,7 +7,7 @@
pushd javaparser-core-generators
# Generate code
-mvn clean package
+mvn clean package -P run-core-generators
# Go back to previous directory
popd
@@ -17,4 +17,3 @@ mvn clean install -DskipTests
if [ "$?" -ne 0 ]; then
exit 1
fi
-Well \ No newline at end of file
diff --git a/run_metamodel_generator.sh b/run_metamodel_generator.sh
index 3acaf2825..f8da7d763 100755
--- a/run_metamodel_generator.sh
+++ b/run_metamodel_generator.sh
@@ -12,7 +12,7 @@ fi
pushd javaparser-metamodel-generator
# Generate code
-mvn clean package
+mvn clean package -P run-metamodel-generator
# Go back to previous directory
popd