Browse Source

removed submodule

Kenneth Lausdahl 6 years ago
parent
commit
a4d4c77565

+ 0 - 3
.gitmodules

@@ -1,3 +0,0 @@
-[submodule "DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib/src/resources/hybridCosimulation-framework"]
-	path = DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib/src/resources/hybridCosimulation-framework
-	url = https://github.com/into-cps/hybridCosimulation-framework.git

+ 0 - 33
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib/pom.xml

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project>
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<relativePath>../pom.xml</relativePath>
-		<groupId>be.uantwerpen.ansymo.semanticadaptation</groupId>
-		<artifactId>parent</artifactId>
-		<version>1.0.0-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib</artifactId>
-	<packaging>jar</packaging>
-
-	<name>be.uantwerpen.ansymo.semanticadaptation Code Generation to C++ Framework</name>
-
-	<build>
-
-		<resources>
-			<resource>
-				<directory>src/resources/hybridCosimulation-framework/semantic-adaptation</directory>
-				<targetPath>${project.build.directory}/classes/hybridCosimulation-framework</targetPath>
-				<filtering>false</filtering>
-				<includes>
-					<include>**/*</include>
-				</includes>
-			</resource>
-		</resources>
-
-  </build>
-
-
-</project>

+ 22 - 31
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/pom.xml

@@ -33,7 +33,8 @@
 
 
 			<plugin>
-				<!-- Remember that these tests only run in integration so between package and install http://www.vogella.com/tutorials/EclipseTycho/article.html -->
+				<!-- Remember that these tests only run in integration so between package 
+					and install http://www.vogella.com/tutorials/EclipseTycho/article.html -->
 				<groupId>org.eclipse.tycho</groupId>
 				<artifactId>tycho-surefire-plugin</artifactId>
 				<version>${tycho-version}</version>
@@ -42,36 +43,26 @@
 					<useUIThread>false</useUIThread>
 				</configuration>
 			</plugin>
-			
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy</id>
-						<phase>pre-integration-test</phase>
-						<goals>
-							<goal>copy</goal>
-						</goals>
-						<configuration>
-							<artifactItems>
-								<artifactItem>
-									<groupId>be.uantwerpen.ansymo.semanticadaptation</groupId>
-									<artifactId>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib</artifactId>
-									<type>jar</type>
-									<version>${project.version}</version>
-									<overWrite>true</overWrite>
-									<destFileName>cppFramework.jar</destFileName>
-								</artifactItem>
-							</artifactItems>
-							<outputDirectory>${project.basedir}/jars</outputDirectory>
-							<overWriteReleases>false</overWriteReleases>
-							<overWriteSnapshots>false</overWriteSnapshots>
-							<overWriteIfNewer>true</overWriteIfNewer>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
+
+			<!-- plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> 
+				<executions> <execution> <id>copy</id> <phase>pre-integration-test</phase> 
+				<goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> 
+				<groupId>be.uantwerpen.ansymo.semanticadaptation</groupId> <artifactId>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib</artifactId> 
+				<type>jar</type> <version>${project.version}</version> <overWrite>true</overWrite> 
+				<destFileName>cppFramework.jar</destFileName> </artifactItem> </artifactItems> 
+				<outputDirectory>${project.basedir}/jars</outputDirectory> <overWriteReleases>false</overWriteReleases> 
+				<overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> 
+				</configuration> </execution> </executions> </plugin -->
+
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-surefire-plugin</artifactId>
+					<configuration>
+						<!-- the tests use std out a lot so we dont want that in the console -->
+						<redirectTestOutputToFile>true</redirectTestOutputToFile>
+
+					</configuration>
+				</plugin>
 		</plugins>
 	</build>
 </project>

+ 2 - 2
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppBasicTest.xtend

@@ -162,8 +162,8 @@ class CgCppBasicTest extends AbstractSemanticAdaptationTest {
 		val cMakeToolChain = StaticGenerators.generateToolChainCmake();
 		BuildUtilities.writeToFile(new File(saRootDir, "msys-toolchain.cmake"), cMakeToolChain);
 		
-		(new BuildUtilities()).copyNativeLibFiles(saFrameworkPath);
-		System.out.println("Stored framework at: " + saFrameworkPath);
+//		(new BuildUtilities()).copyNativeLibFiles(saFrameworkPath);
+//		System.out.println("Stored framework at: " + saFrameworkPath);
 		
 				
 	}

+ 4 - 4
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/pom.xml

@@ -20,13 +20,13 @@
 
 	<dependencies>
 
-		<dependency>
+		<!--  dependency>
 			<groupId>be.uantwerpen.ansymo.semanticadaptation</groupId>
 			<artifactId>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib</artifactId>
 			<type>jar</type>
 			<version>${project.version}</version>
 			<scope>compile</scope>
-		</dependency>
+		</dependency-->
 	</dependencies>
 
 	<build>
@@ -36,7 +36,7 @@
 					<artifactId>xtend-maven-plugin</artifactId>
 				</plugin>
 	
-				<plugin>
+				<!--  plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-dependency-plugin</artifactId>
 					<executions>
@@ -64,7 +64,7 @@
 							</configuration>
 						</execution>
 					</executions>
-				</plugin>
+				</plugin-->
 				
 			</plugins>
 	</build>

+ 61 - 61
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/generation/BuildUtilities.java

@@ -14,67 +14,67 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
 public class BuildUtilities {
-	public List<File> copyNativeLibFiles(File outfolder) {
-		List<File> libFiles;
-		File outputFile = null;
-		InputStream jarfile = null;
-		FileOutputStream fos = null;
-		JarInputStream jarstream = null;
-		JarEntry filejarentry = null;
-
-		if (!outfolder.exists()) {
-			outfolder.mkdir();
-		}
-
-		libFiles = new LinkedList<>();
-
-		try {
-			jarfile = new FileInputStream(new File("jars/cppFramework.jar"));
-			jarstream = new JarInputStream(jarfile);
-			filejarentry = jarstream.getNextJarEntry();
-
-			// Extract the framework files
-			while (filejarentry != null) {
-				System.out.println("Extracting file: " + filejarentry.getName());
-				if (!filejarentry.getName().contains("hybridCosimulation-framework") || filejarentry.isDirectory()) {
-					filejarentry = jarstream.getNextJarEntry();
-					continue;
-				}
-
-				// Ignore these files
-				if (filejarentry.getName().contains(".gitignore") || filejarentry.getName().contains(".gitmodules")
-						/*|| filejarentry.getName().contains("README.md")*/ || filejarentry.getName().contains("LICENSE")) {
-					filejarentry = jarstream.getNextJarEntry();
-					continue;
-				}
-				String tmpFileName = filejarentry.getName().replace("hybridCosimulation-framework/", "");
-
-				outputFile = new File(outfolder.toString() + File.separator + tmpFileName);
-
-				libFiles.add(new File(outfolder.getName() + File.separator + tmpFileName));
-
-				outputFile.getParentFile().mkdirs();
-				fos = new FileOutputStream(outputFile);
-
-				while (jarstream.available() > 0) {
-					int b = jarstream.read();
-					if (b >= 0) {
-						fos.write(b);
-					}
-				}
-				fos.flush();
-				fos.close();
-				jarstream.closeEntry();
-				filejarentry = jarstream.getNextJarEntry();
-			}
-			jarstream.close();
-			jarfile.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		return libFiles;
-	}
+//	public List<File> copyNativeLibFiles(File outfolder) {
+//		List<File> libFiles;
+//		File outputFile = null;
+//		InputStream jarfile = null;
+//		FileOutputStream fos = null;
+//		JarInputStream jarstream = null;
+//		JarEntry filejarentry = null;
+//
+//		if (!outfolder.exists()) {
+//			outfolder.mkdir();
+//		}
+//
+//		libFiles = new LinkedList<>();
+//
+//		try {
+//			jarfile = new FileInputStream(new File("jars/cppFramework.jar"));
+//			jarstream = new JarInputStream(jarfile);
+//			filejarentry = jarstream.getNextJarEntry();
+//
+//			// Extract the framework files
+//			while (filejarentry != null) {
+//				System.out.println("Extracting file: " + filejarentry.getName());
+//				if (!filejarentry.getName().contains("hybridCosimulation-framework") || filejarentry.isDirectory()) {
+//					filejarentry = jarstream.getNextJarEntry();
+//					continue;
+//				}
+//
+//				// Ignore these files
+//				if (filejarentry.getName().contains(".gitignore") || filejarentry.getName().contains(".gitmodules")
+//						/*|| filejarentry.getName().contains("README.md")*/ || filejarentry.getName().contains("LICENSE")) {
+//					filejarentry = jarstream.getNextJarEntry();
+//					continue;
+//				}
+//				String tmpFileName = filejarentry.getName().replace("hybridCosimulation-framework/", "");
+//
+//				outputFile = new File(outfolder.toString() + File.separator + tmpFileName);
+//
+//				libFiles.add(new File(outfolder.getName() + File.separator + tmpFileName));
+//
+//				outputFile.getParentFile().mkdirs();
+//				fos = new FileOutputStream(outputFile);
+//
+//				while (jarstream.available() > 0) {
+//					int b = jarstream.read();
+//					if (b >= 0) {
+//						fos.write(b);
+//					}
+//				}
+//				fos.flush();
+//				fos.close();
+//				jarstream.closeEntry();
+//				filejarentry = jarstream.getNextJarEntry();
+//			}
+//			jarstream.close();
+//			jarfile.close();
+//		} catch (IOException e) {
+//			e.printStackTrace();
+//		}
+//
+//		return libFiles;
+//	}
 
 	public static void writeToFile(File file, String content) throws IOException
 	{

+ 9 - 1
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.testframework/src/be/uantwerpen/ansymo/semanticadaptation/testframework/StaticGenerators.xtend

@@ -206,7 +206,15 @@ class StaticGenerators {
 		#  objdump -p binaries/win64/window-sa.dll |  grep 'DLL Name:'
 		#
 		
-		
+			# Checkout the hcf sources
+				set(HCF_DIR hcf)
+				if(EXISTS ${HCF_DIR})
+					execute_process(COMMAND git pull WORKING_DIRECTORY ${HCF_DIR})
+				else()
+					execute_process(COMMAND git clone --depth 1 git@github.com:into-cps/hybridCosimulation-framework.git ${HCF_DIR} )
+					execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${HCF_DIR})
+				endif()
+				add_subdirectory(${HCF_DIR}/semantic-adaptation)
 		
 		if (WIN32)
 			#windows, becuase windows just cannot figure out to do it correct. 

+ 1 - 1
DSL_SemanticAdaptation/pom.xml

@@ -16,7 +16,7 @@
 		<module>be.uantwerpen.ansymo.semanticadaptation.tests</module>
 		<module>be.uantwerpen.ansymo.semanticadaptation.ide</module>
 		<module>be.uantwerpen.ansymo.semanticadaptation.ui</module>
-	  <module>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib</module>
+	  <!--module>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.lib</module-->
 		<module>be.uantwerpen.ansymo.semanticadaptation.cg.cpp</module>
 	  <module>be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests</module>
 		<!--module>../my.mavenized.herolanguage.ui</module>