Permalink
Browse files

move all est in package test and add core17 to SDMLib

  • Loading branch information...
Stefan Lindel
Stefan Lindel committed Jul 7, 2015
1 parent c6a82a1 commit 3da46b20c255c779e132df5db696a32f57317ae0
Showing 1,016 changed files with 76,748 additions and 76,679 deletions.
View
@@ -3,11 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: SDMLib
Bundle-SymbolicName: SDMLib;singleton:=true
Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: SDMLib.jar,
- christian/.gradle/caches/modules-2/files-2.1/junit/junit/4.12-beta-2/eb899c93c162058b6ae990e7e279507803edd1fb/junit-4.12-beta-2.jar,
- christian/.gradle/caches/modules-2/files-2.1/org.beanshell/bsh/2.0b5/fdc2ab6ae8b53e0d4761b296c116df747cd85199/bsh-2.0b5.jar,
- christian/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar,
- .
+Bundle-ClassPath: SDMLib.jar
+Main-Class: org.sdmlib.models.classes.gui.SDMDiagramEditor
Require-Bundle: NetworkParser;bundle-version="1.0.0";visibility:=reexport
Export-Package: org.sdmlib,
org.sdmlib.codegen,
View
@@ -41,7 +41,7 @@
<attribute name="Built-By" value="${user.name}" />
<attribute name="Version" value="${revisionVersion}" />
<attribute name="Implementation-Version" value="4.2.23.${revisionVersion} ${TODAY}" />
- <attribute name="Main-Class" value="org.sdmlib.models.classes.SDMDiagramEditor" />
+ <attribute name="Main-Class" value="org.sdmlib.models.classes.gui.SDMDiagramEditor" />
</manifest>
<fileset dir="build/temp/" />
<fileset dir="./src/main/java">
View
@@ -7,23 +7,13 @@ task javadocJar(type: Jar) {
from javadoc.outputs.files;
classifier = 'javadoc'
}
-
+//copying all dependencies attached to 'compile' into a specific folder
+task copyAllDependencies(type: Copy) {
+ //referring to the 'compile' configuration
+ from configurations.compile
+ into 'build/allLibs'
+}
task fatJar(type: Jar) {
- manifest {
- attributes 'Specification-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
- 'Implementation-Title': 'SDMLib',
- 'Specification-Title': 'SDMLib',
- 'Built-Time': gitVersion.buildTime,
- 'Created-By': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision+" "+System.properties['user.name'],
- 'Built-By': "${System.properties['user.name']}",
- 'Location': "${System.properties['user.language']}",
- 'Version': gitVersion.revision,
- 'Implementation-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
- 'GIT-Revision': gitVersion.revision,
- 'Java-Version': "${System.properties['java.version']}",
- 'Bundle-Description': 'SDMLib',
- 'Bundle-ClassPath': '.'
- }
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
with sourceJar
@@ -33,28 +23,34 @@ task fatJar(type: Jar) {
exclude('org/junit/**')
exclude('META-INF/MANIFEST.MF')
classifier = 'all'
+ getManifest(gitVersion)
}
+task compileJava17(type: JavaCompile) {
+ println "Compile 1.7"
+ source = fileTree(dir: 'src', exclude: ['**/gui/**', '**/test/**'])
+ destinationDir = file('build/classes/main17')
+ sourceCompatibility = '1.7'
+ targetCompatibility = '1.7'
+ classpath = fileTree(dir: 'build/allLibs', include: '*.jar')
+}
+classes.dependsOn compileJava17
+compileJava17.dependsOn copyAllDependencies
+//compileJava.dependsOn compileJava17
+
+
+task coreJar17(type: Jar) {
+ from fileTree(dir: 'build/classes/main17'); classifier = 'core17'
+ getManifest(gitVersion)
+}
+
task pmJar(type: Jar) {
from {(
sourceSets.main.output + sourceSets.main.allSource + javadoc.outputs.files +
configurations.compile.filter({it.name.indexOf("NetworkParser")>=0 && it.name.indexOf("source")>=0}).collect({println "BLA: "+it;it.isDirectory() ? it : zipTree(it)})
)}
manifest {
- attributes 'Specification-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
- 'Implementation-Title': 'SDMLib',
- 'Specification-Title': 'SDMLib',
- 'Built-Time': gitVersion.buildTime,
- 'Created-By': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision+" "+System.properties['user.name'],
- 'Built-By': "${System.properties['user.name']}",
- 'Location': "${System.properties['user.language']}",
- 'Version': gitVersion.revision,
- 'Author': 'Stefan Lindel',
- 'Implementation-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
- 'GIT-Revision': gitVersion.revision,
- 'Java-Version': "${System.properties['java.version']}",
- 'Bundle-Description': 'SDMLib',
- 'Bundle-ClassPath': '.'
+
}
exclude('META-INF/MANIFEST.MF')
exclude('org/sdmlib/models/transformations/**')
@@ -124,4 +120,23 @@ task pomFile(type: Jar) {
stringsFile = new FileWriter("build/maven-metadata.xml")
stringsFile.write(sw.toString())
stringsFile.close()
+}
+
+def getManifest(gitVersion) {
+ manifest {
+ attributes 'Specification-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
+ 'Implementation-Title': 'SDMLib',
+ 'Specification-Title': 'SDMLib',
+ 'Built-Time': gitVersion.buildTime,
+ 'Created-By': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision+" "+System.properties['user.name'],
+ 'Built-By': "${System.properties['user.name']}",
+ 'Location': "${System.properties['user.language']}",
+ 'Version': gitVersion.revision,
+ 'Author': 'Stefan Lindel',
+ 'Implementation-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
+ 'GIT-Revision': gitVersion.revision,
+ 'Java-Version': "${System.properties['java.version']}",
+ 'Bundle-Description': 'SDMLib',
+ 'Bundle-ClassPath': '.'
+ }
}
@@ -1,76 +0,0 @@
-package org.sdmlib.models.classes;
-
-import org.sdmlib.StrUtil;
-
-import de.uniks.networkparser.gui.javafx.window.DiagramEditor;
-import de.uniks.networkparser.gui.javafx.window.FXStageController;
-import de.uniks.networkparser.json.JsonArray;
-import de.uniks.networkparser.json.JsonObject;
-import javafx.scene.Parent;
-
-public class SDMDiagramEditor extends DiagramEditor{
- public static void main(String[] args) {
- launch(args);
- }
-
- @Override
- public void generate(JsonObject model) {
-// super.generate(model);
- if(!model.has("nodes")) {
- System.err.println("no Nodes");
- System.out.println("no Nodes");
- return;
- }
- JsonObject nodes = model.getJsonObject("nodes");
- ClassModel classModel=new ClassModel(model.getString("package"));
- for (int i = 0; i < nodes.size(); i++) {
- Object item = nodes.getValueByIndex(i);
- if (item instanceof JsonObject) {
- JsonObject node = (JsonObject) item;
- Clazz clazz = classModel.createClazz(node.getString("id"));
- if(node.has("attributes")) {
- JsonArray attributes = node.getJsonArray("attributes");
- for (Object entity : attributes) {
- if (entity instanceof String) {
- String attribute = (String) entity;
- int pos = attribute.indexOf(":");
- if (pos > 0) {
- clazz.withAttribute(attribute.substring(0, pos),
- DataType.ref(attribute.substring(pos + 1)));
- }
- }
- }
- }
- }
- }
- if(model.has("edges")){
- JsonArray edges = model.getJsonArray("edges");
- for(Object entity : edges) {
- if(entity instanceof JsonObject) {
- JsonObject edge = (JsonObject) entity;
- JsonObject source = (JsonObject) edge.getJsonObject("source");
- JsonObject target = (JsonObject) edge.getJsonObject("target");
- if(edge.getString("typ").equalsIgnoreCase("edge")) {
- Clazz fromClazz = classModel.getClazz(source.getString("id"));
- Clazz toClazz = classModel.getClazz(target.getString("id"));
-
- fromClazz.withAssoc(toClazz, target.getString("property"), Card.ONE, source.getString("property"), Card.ONE);
- }
- }
- }
- }
-
-
- String genModel = classModel.getName() + ".genModel";
- classModel.getGenerator().insertModelCreationCodeHere("gen", genModel, "testGenModel");
- classModel.generate("gen");
- }
-
- @Override
- protected Parent createContents(FXStageController controller, Parameters args) {
- Parent parent = super.createContents(controller, args);
-
- controller.withIcon(StrUtil.class.getResource("sdmlib.png"));
- return parent;
- }
-}
@@ -0,0 +1,80 @@
+package org.sdmlib.models.classes.gui;
+
+import org.sdmlib.StrUtil;
+import org.sdmlib.models.classes.Card;
+import org.sdmlib.models.classes.ClassModel;
+import org.sdmlib.models.classes.Clazz;
+import org.sdmlib.models.classes.DataType;
+
+import de.uniks.networkparser.gui.javafx.window.DiagramEditor;
+import de.uniks.networkparser.gui.javafx.window.FXStageController;
+import de.uniks.networkparser.json.JsonArray;
+import de.uniks.networkparser.json.JsonObject;
+import javafx.scene.Parent;
+
+public class SDMDiagramEditor extends DiagramEditor{
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+ @Override
+ public void generate(JsonObject model) {
+// super.generate(model);
+ if(!model.has("nodes")) {
+ System.err.println("no Nodes");
+ System.out.println("no Nodes");
+ return;
+ }
+ JsonObject nodes = model.getJsonObject("nodes");
+ ClassModel classModel=new ClassModel(model.getString("package"));
+ for (int i = 0; i < nodes.size(); i++) {
+ Object item = nodes.getValueByIndex(i);
+ if (item instanceof JsonObject) {
+ JsonObject node = (JsonObject) item;
+ Clazz clazz = classModel.createClazz(node.getString("id"));
+ if(node.has("attributes")) {
+ JsonArray attributes = node.getJsonArray("attributes");
+ for (Object entity : attributes) {
+ if (entity instanceof String) {
+ String attribute = (String) entity;
+ int pos = attribute.indexOf(":");
+ if (pos > 0) {
+ clazz.withAttribute(attribute.substring(0, pos),
+ DataType.ref(attribute.substring(pos + 1)));
+ }
+ }
+ }
+ }
+ }
+ }
+ if(model.has("edges")){
+ JsonArray edges = model.getJsonArray("edges");
+ for(Object entity : edges) {
+ if(entity instanceof JsonObject) {
+ JsonObject edge = (JsonObject) entity;
+ JsonObject source = (JsonObject) edge.getJsonObject("source");
+ JsonObject target = (JsonObject) edge.getJsonObject("target");
+ if(edge.getString("typ").equalsIgnoreCase("edge")) {
+ Clazz fromClazz = classModel.getClazz(source.getString("id"));
+ Clazz toClazz = classModel.getClazz(target.getString("id"));
+
+ fromClazz.withAssoc(toClazz, target.getString("property"), Card.ONE, source.getString("property"), Card.ONE);
+ }
+ }
+ }
+ }
+
+
+ String genModel = classModel.getName() + ".genModel";
+ classModel.getGenerator().insertModelCreationCodeHere("gen", genModel, "testGenModel");
+ classModel.generate("gen");
+ }
+
+ @Override
+ protected Parent createContents(FXStageController controller, Parameters args) {
+ Parent parent = super.createContents(controller, args);
+
+ controller.withIcon(StrUtil.class.getResource("sdmlib.png"));
+ return parent;
+ }
+}
Oops, something went wrong.

0 comments on commit 3da46b2

Please sign in to comment.