diff options
author | Danny van Bruggen <lol@meuk.info> | 2017-07-10 20:58:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-10 20:58:30 +0200 |
commit | 8b7773fd2265511c7d3f99e686aa8b4a44ea4b40 (patch) | |
tree | 1f7ed7aa787b063d95b1dd7a1c05d014603abd01 | |
parent | 85f7b387757558d6599e6dc038008c66ad83bb88 (diff) | |
parent | 64e1a3c1dd50f50e3a25af04234a5f404c47cf36 (diff) | |
download | javaparser-8b7773fd2265511c7d3f99e686aa8b4a44ea4b40.tar.gz |
Merge pull request #993 from matozoid/issue_992_module_redo
Issue 992 module redo
-rw-r--r-- | javaparser-core-generators/pom.xml | 59 | ||||
-rw-r--r-- | javaparser-metamodel-generator/pom.xml | 56 | ||||
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | readme.md | 6 | ||||
-rwxr-xr-x | run_core_generators.sh | 3 | ||||
-rwxr-xr-x | run_metamodel_generator.sh | 2 |
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> @@ -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> @@ -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 |