diff --git a/Modulefile b/Modulefile new file mode 100644 index 0000000..6cd70bf --- /dev/null +++ b/Modulefile @@ -0,0 +1,24 @@ +#%Module###################################################################### +## +## Project Module +## +proc ModulesHelp { } { + puts stderr "\tThe TGFS-CG Project Module\n" + puts stderr "\tThis module loads PATHs and variables for accessing Verilator." +} + + +#set distro [exec /bin/lsb_release -i -s] +#if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env(PCP_DIR)] } { +# puts stderr "Don't forget to execute 'scl enable devtoolset-7 bash'" +#} + +if {![info exists ::env(PROJECT)] && [file exists $::env(HOME)/.sdkman/candidates/java/11.0.9.hs-adpt/] != 1} { + puts stderr "Please install java via 'sdk install java 11.0.9.hs-adpt'!" + prereq java/11.0.9 +} else { + prepend-path PATH $::env(HOME)/.sdkman/candidates/java/11.0.9.hs-adpt/bin +} + +setenv PROJECT RDL-Editor + diff --git a/com.minres.rdl.parent/com.minres.rdl.platform.feature/feature.xml b/com.minres.rdl.parent/com.minres.rdl.platform.feature/feature.xml index 54fda20..6ed890d 100644 --- a/com.minres.rdl.parent/com.minres.rdl.platform.feature/feature.xml +++ b/com.minres.rdl.parent/com.minres.rdl.platform.feature/feature.xml @@ -760,13 +760,6 @@ version="0.0.0" unpack="false"/> - - + @@ -23,80 +24,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/com.minres.rdl.parent/com.minres.rdl.standalone/assemble.groovy b/com.minres.rdl.parent/com.minres.rdl.standalone/assemble.groovy index 5ea2a9c..1279350 100644 --- a/com.minres.rdl.parent/com.minres.rdl.standalone/assemble.groovy +++ b/com.minres.rdl.parent/com.minres.rdl.standalone/assemble.groovy @@ -1,20 +1,95 @@ import static groovy.io.FileType.FILES +import java.nio.file.Files +import java.nio.file.Paths +import java.util.zip.ZipEntry + +def needed_jars = [ + /org\.eclipse\.xtext/, + /org\.eclipse\.emf\.ecore\.xmi/, + /org\.eclipse\.emf\.ecore/, + /org\.eclipse\.emf\.common/, + /org\.antlr\.runtime/, + /com\.google\.inject/, + /org\.eclipse\.emf\.mwe\.core/, + /org\.apache\.commons\.cli/, + /org\.eclipse\.emf\.mwe2\.runtime/, + /org\.eclipse\.emf\.mwe\.utils/, + /org\.eclipse\.xtext\.util/, + /com\.google\.guava/, + /javax\.inject/, + /org\.eclipse\.xtext\.xbase/, + /org\.eclipse\.xtext\.common\.types/, + /org\.eclipse\.xtend\.lib/, + /org\.eclipse\.xtext\.xbase\.lib/, + /org\.eclipse\.xtend\.lib\.macro/, + /org\.eclipse\.equinox\.common/, + /eclipse-trace/, + /groovy-eclipse/, + /ivy-2\.5\.0\.jar/, + /groovy-3\.0\.\d-indy/, + /groovy-templates-3\.0\.\d/, + /org\.eclipse\.xtext\.xtext\.generator/, + /org\.eclipse\.emf\.codegen\.ecore/, + /org\.eclipse\.emf\.codegen/, + /org\.eclipse\.emf\.mwe2\.launch/, + /org\.eclipse\.emf\.mwe2\.language/, + /org\.eclipse\.emf\.mwe2\.lib/, + /org\.objectweb\.asm/, + /org\.apache\.commons\.logging/, + /org\.apache\.log4j/, + /com\.ibm\.icu/, + /org\.json/, + /com\.minres\.rdl/ +] + // Collect all jars. def jars = [] def root = new File(project.getBasedir(), 'target/classes') def libs = new File(project.getBasedir(), 'target/classes/lib') +def meta_inf = new File(project.getBasedir(), 'target/classes/META-INF') libs.eachFileRecurse (FILES) { file -> - jars << root.toURI().relativize(file.toURI()).toString() + if(file.name =~/org\.codehaus\.groovy_/) { // we need to unpack this one sinc it is already jar in jar + println("Unpacking ${file}") + def zipFile = new java.util.zip.ZipFile(file) + zipFile.entries().findAll {ZipEntry entry -> !entry.directory && entry.name =~/\.jar$/}.each {ZipEntry entry -> + def outFile = new File(libs, entry.name.split(/\//)[-1]) + println "Extracting file ${entry.name} to ${outFile.path} with size ${entry.size}bytes (${entry.compressedSize}bytes)" + Files.copy(zipFile.getInputStream(entry), outFile.toPath()) + } + } +} +libs.eachFileRecurse (FILES) { file -> + def fileName = file.name.split("/")[-1] + if(needed_jars.find{fileName =~ it}) { + println "Adding $file to the included jars" + jars << root.toURI().relativize(file.toURI()).toString() + } else { + file.delete() + } +} +def zipFile = new java.util.zip.ZipFile(new File(project.getBasedir(), 'jar-in-jar-loader.zip')) +zipFile.entries().each {ZipEntry it -> + def path = Paths.get("${root}/", it.name) + if(it.directory){ + Files.createDirectories(path) + } else { + def parentDir = path.getParent() + if (!Files.exists(parentDir)) { + Files.createDirectories(parentDir) + } + Files.deleteIfExists(path) + println "Extracting file ${it.name} to ${path} with size ${it.size}bytes (${it.compressedSize}bytes)" + Files.copy(zipFile.getInputStream(it), path) + } } // Write the manifest file. -def manifest = new File(project.getBasedir(), 'target/classes/META-INF/MANIFEST.MF') - -manifest.write '' - -manifest << 'Manifest-Version: 1.0\n' -manifest << 'Class-Path: . ' + jars.join(' ') + '\n' -manifest << 'Rsrc-Main-Class: com.minres.rdl.generator.Main\n' -manifest << 'Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader\n' \ No newline at end of file +Files.createDirectories( Paths.get(meta_inf.absolutePath)) +def mf = new File(project.getBasedir(), 'target/classes/META-INF/MANIFEST.MF') +mf.write '' +mf << 'Manifest-Version: 1.0\n' +mf << 'Rsrc-Class-Path: ./ ' + jars.join(' ') + '\n' +mf << 'Rsrc-Main-Class: com.minres.rdl.generator.Main\n' +mf << 'Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader\n' diff --git a/com.minres.rdl.parent/com.minres.rdl.standalone/jar-in-jar-loader.zip b/com.minres.rdl.parent/com.minres.rdl.standalone/jar-in-jar-loader.zip new file mode 100644 index 0000000..3c6c9bf Binary files /dev/null and b/com.minres.rdl.parent/com.minres.rdl.standalone/jar-in-jar-loader.zip differ diff --git a/com.minres.rdl.parent/com.minres.rdl.target/com.minres.rdl.target.target b/com.minres.rdl.parent/com.minres.rdl.target/com.minres.rdl.target.target index 01fc01f..3763e2d 100644 --- a/com.minres.rdl.parent/com.minres.rdl.target/com.minres.rdl.target.target +++ b/com.minres.rdl.parent/com.minres.rdl.target/com.minres.rdl.target.target @@ -1,39 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/wizard/Messages.java b/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/wizard/Messages.java index 33fa588..61a44ef 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/wizard/Messages.java +++ b/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/wizard/Messages.java @@ -14,7 +14,7 @@ public class Messages extends NLS { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } - + private Messages() { } } diff --git a/com.minres.rdl.parent/com.minres.rdl/lib/groovy-templates_3.0.10.jar b/com.minres.rdl.parent/com.minres.rdl/lib/groovy-templates_3.0.10.jar new file mode 100644 index 0000000..1586085 Binary files /dev/null and b/com.minres.rdl.parent/com.minres.rdl/lib/groovy-templates_3.0.10.jar differ diff --git a/com.minres.rdl.parent/com.minres.rdl/lib/groovy-xml_3.0.10.jar b/com.minres.rdl.parent/com.minres.rdl/lib/groovy-xml_3.0.10.jar new file mode 100644 index 0000000..051427f Binary files /dev/null and b/com.minres.rdl.parent/com.minres.rdl/lib/groovy-xml_3.0.10.jar differ diff --git a/com.minres.rdl.parent/com.minres.rdl/lib/groovy_3.0.10.jar b/com.minres.rdl.parent/com.minres.rdl/lib/groovy_3.0.10.jar new file mode 100644 index 0000000..3b224db Binary files /dev/null and b/com.minres.rdl.parent/com.minres.rdl/lib/groovy_3.0.10.jar differ diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/ModuleGenerator.xtend b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/ModuleGenerator.xtend index f3d9ac0..7392cfb 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/ModuleGenerator.xtend +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/ModuleGenerator.xtend @@ -6,7 +6,6 @@ import com.minres.rdl.rdl.ComponentDefinitionType import static extension com.minres.rdl.RdlUtil.* import com.minres.rdl.rdl.ExplicitPropertyAssignment import com.minres.rdl.rdl.PropertyEnum -import com.minres.rdl.services.RDLGrammarAccess.PropertyRvalueConstantElements import com.minres.rdl.rdl.RValueConstant class ModuleGenerator extends RdlBaseGenerator { diff --git a/com.minres.rdl.parent/pom.xml b/com.minres.rdl.parent/pom.xml index dfec007..9a2d754 100644 --- a/com.minres.rdl.parent/pom.xml +++ b/com.minres.rdl.parent/pom.xml @@ -33,10 +33,6 @@ com.minres.rdl.repository com.minres.rdl.tests com.minres.rdl.ui.tests - com.minres.rdl.product - com.minres.rdl.product.feature - com.minres.rdl.platform.feature - com.minres.rdl.product.releng com.minres.rdl.standalone