Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-10-21 12:51:06 -0400
committerMartin Taal2012-10-21 12:51:06 -0400
commitc6e86fcae96c6846f56d1ace94e3f90ffff549c9 (patch)
tree777b279a8c5df97a068e3e6c43894d87572ee6e0
parent272490db663864c3435876dfbdafb1acea888bda (diff)
downloadorg.eclipse.emf.texo-c6e86fcae96c6846f56d1ace94e3f90ffff549c9.tar.gz
org.eclipse.emf.texo-c6e86fcae96c6846f56d1ace94e3f90ffff549c9.tar.xz
org.eclipse.emf.texo-c6e86fcae96c6846f56d1ace94e3f90ffff549c9.zip
Updated build example files
-rw-r--r--generator/org.eclipse.emf.texo.eclipse.generator/examples/build.xml2
-rw-r--r--generator/org.eclipse.emf.texo.eclipse.generator/examples/texo-gen-macrodef.xml22
-rwxr-xr-xgenerator/org.eclipse.emf.texo.eclipse.generator/src/org/eclipse/emf/texo/eclipse/generator/TexoGeneratorApplication.java11
3 files changed, 18 insertions, 17 deletions
diff --git a/generator/org.eclipse.emf.texo.eclipse.generator/examples/build.xml b/generator/org.eclipse.emf.texo.eclipse.generator/examples/build.xml
index 4a500f5f..cb0cc27f 100644
--- a/generator/org.eclipse.emf.texo.eclipse.generator/examples/build.xml
+++ b/generator/org.eclipse.emf.texo.eclipse.generator/examples/build.xml
@@ -16,7 +16,7 @@ Contributors:
<texo.gen
eclipse="/home/mtaal/mytmp/headless/eclipse"
data="/home/mtaal/mytmp/headless/workspace"
- project="testgen"
+ projectName="testgen"
modelLocation="/home/mtaal/mytmp/models"
jpa="true"/>
</target>
diff --git a/generator/org.eclipse.emf.texo.eclipse.generator/examples/texo-gen-macrodef.xml b/generator/org.eclipse.emf.texo.eclipse.generator/examples/texo-gen-macrodef.xml
index 59214cce..39fcab9f 100644
--- a/generator/org.eclipse.emf.texo.eclipse.generator/examples/texo-gen-macrodef.xml
+++ b/generator/org.eclipse.emf.texo.eclipse.generator/examples/texo-gen-macrodef.xml
@@ -27,14 +27,6 @@ Contributors:
<istrue value="@{jpa}"/>
</condition>
- <property name="project.value" value="@{project}"/>
-
- <condition property="project.arg" value="-project @{project}" else="">
- <isset property="project.value"/>
- </condition>
-
- <echo message="@{eclipse}"/>
-
<property name="eclipse.plugins" value="@{eclipse}/plugins"/>
<property name="launcher.jar" value="${eclipse.plugins}/org.eclipse.equinox.launcher.jar"/>
@@ -44,14 +36,18 @@ Contributors:
</copy>
<!-- start Eclipse with java -->
- <java classpath="${launcher.jar}" fork="true"
+ <java classpath="${launcher.jar}"
classname="org.eclipse.equinox.launcher.Main"
failonerror="true">
<arg value="-nosplash"/>
- <arg value="-data @{data}"/>
- <arg value="-application org.eclipse.emf.texo.eclipse.generator.TexoCodeGenerator"/>
- <arg value="${project.arg}"/>
- <arg value="-modelLocation @{modelLocation}"/>
+ <arg value="-application"/>
+ <arg value="org.eclipse.emf.texo.eclipse.generator.TexoCodeGenerator"/>
+ <arg value="-data"/>
+ <arg value="@{data}"/>
+ <arg value="-modelLocation"/>
+ <arg value="@{modelLocation}"/>
+ <arg value="-projectName"/>
+ <arg value="@{projectName}"/>
<arg value="${jpa.arg}"/>
<arg value="${dao.arg}"/>
</java>
diff --git a/generator/org.eclipse.emf.texo.eclipse.generator/src/org/eclipse/emf/texo/eclipse/generator/TexoGeneratorApplication.java b/generator/org.eclipse.emf.texo.eclipse.generator/src/org/eclipse/emf/texo/eclipse/generator/TexoGeneratorApplication.java
index 67667751..093548db 100755
--- a/generator/org.eclipse.emf.texo.eclipse.generator/src/org/eclipse/emf/texo/eclipse/generator/TexoGeneratorApplication.java
+++ b/generator/org.eclipse.emf.texo.eclipse.generator/src/org/eclipse/emf/texo/eclipse/generator/TexoGeneratorApplication.java
@@ -59,7 +59,7 @@ import org.eclipse.jdt.launching.JavaRuntime;
*/
public class TexoGeneratorApplication implements IApplication {
- private static final String ARG_PROJECT = "-project";
+ private static final String ARG_PROJECT_NAME = "-projectName";
private static final String ARG_JPA = "-jpa";
private static final String ARG_DAO = "-dao";
private static final String ARG_MODEL_LOCATION = "-modelLocation";
@@ -84,7 +84,7 @@ public class TexoGeneratorApplication implements IApplication {
modelLocation = arg;
nextArgIsModelLocation = false;
}
- if (ARG_PROJECT.equals(arg)) {
+ if (ARG_PROJECT_NAME.equals(arg)) {
nextArgIsProject = true;
} else if (ARG_MODEL_LOCATION.equals(arg)) {
nextArgIsModelLocation = true;
@@ -106,6 +106,11 @@ public class TexoGeneratorApplication implements IApplication {
println("jpa: " + doJpa);
println("dao: " + doDao);
+ // always use null in this case also
+ if (projectName != null && projectName.trim().length() == 0) {
+ projectName = null;
+ }
+
if (doJpa) {
if (projectName != null) {
ORMUtils.setORMMappingOptionsFromProjectProperties(EclipseGeneratorUtils.getProject(projectName));
@@ -206,7 +211,7 @@ public class TexoGeneratorApplication implements IApplication {
throw new RuntimeException("No model files (ecore, xsd) found in location " + modelLocation);
}
} else {
- if (!modelLocation.endsWith("xsd") && !modelLocation.endsWith("xsd")) {
+ if (!modelLocation.endsWith("xsd") && !modelLocation.endsWith("ecore")) {
throw new RuntimeException("Model location " + modelLocation
+ " is not a model file, supported file extensions are xsd or ecore");
}

Back to the top