parent
96c8c1310e
commit
1c9c0ee340
@ -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 |
||||
|
@ -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' |
||||
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' |
||||
|
Binary file not shown.
@ -1,39 +1,43 @@ |
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<?pde version="3.8"?> |
||||
<target name="com.minres.rdl.target" sequenceNumber="1"> |
||||
<locations> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/> |
||||
<repository location="https://download.eclipse.org/releases/2021-03"/> |
||||
</location> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/> |
||||
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.12.1/"/> |
||||
</location> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/> |
||||
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.25.0/"/> |
||||
</location> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="com.google.gson" version="2.8.6.v20201231-1626"/> |
||||
<unit id="org.antlr.runtime" version="3.2.0.v201101311130"/> |
||||
<unit id="org.junit" version="4.12.0.v201504281640"/> |
||||
<unit id="org.junit.jupiter.api" version="5.7.1.v20210222-1948"/> |
||||
<unit id="org.junit.jupiter.engine" version="5.7.1.v20210222-1948"/> |
||||
<unit id="org.junit.platform.commons" version="1.7.1.v20210222-1948"/> |
||||
<unit id="org.junit.platform.engine" version="1.7.1.v20210222-1948"/> |
||||
<unit id="org.junit.platform.launcher" version="1.7.1.v20210222-1948"/> |
||||
<unit id="org.junit.platform.runner" version="1.7.1.v20210222-1948"/> |
||||
<unit id="org.opentest4j" version="1.2.0.v20190826-0900"/> |
||||
<unit id="org.objectweb.asm" version="9.1.0.v20210209-1849"/> |
||||
<unit id="org.objectweb.asm.tree" version="9.1.0.v20210209-1849"/> |
||||
<unit id="io.github.classgraph" version="4.8.35.v20190528-1517"/> |
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/2021-03"/> |
||||
</location> |
||||
</locations> |
||||
<target name="com.minres.coredsl.target" sequenceNumber="1"> |
||||
<locations> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/> |
||||
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/> |
||||
<repository location="https://download.eclipse.org/releases/2022-03"/> |
||||
</location> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/> |
||||
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.12.2/"/> |
||||
</location> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/> |
||||
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.26.0/"/> |
||||
</location> |
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> |
||||
<unit id="com.google.gson" version="2.8.9.v20220111-1409"/> |
||||
<unit id="com.google.inject" version="5.0.1.v20210324-2015"/> |
||||
<unit id="javax.inject" version="1.0.0.v20091030"/> |
||||
<unit id="org.antlr.runtime" version="3.2.0.v201101311130"/> |
||||
<unit id="org.junit" version="4.13.2.v20211018-1956"/> |
||||
<unit id="org.apiguardian" version="1.1.2.v20211018-1956"/> |
||||
<unit id="org.junit.jupiter.api" version="5.8.1.v20211018-1956"/> |
||||
<unit id="org.junit.jupiter.engine" version="5.8.1.v20211018-1956"/> |
||||
<unit id="org.junit.platform.commons" version="1.8.1.v20211018-1956"/> |
||||
<unit id="org.junit.platform.engine" version="1.8.1.v20211018-1956"/> |
||||
<unit id="org.junit.platform.launcher" version="1.8.1.v20211018-1956"/> |
||||
<unit id="org.junit.platform.runner" version="1.8.1.v20211018-1956"/> |
||||
<unit id="org.junit.platform.suite.commons" version="1.8.1.v20211018-1956"/> |
||||
<unit id="org.opentest4j" version="1.2.0.v20211018-1956"/> |
||||
<unit id="org.objectweb.asm" version="9.2.0.v20210813-1119"/> |
||||
<unit id="org.objectweb.asm.tree" version="9.2.0.v20210813-1119"/> |
||||
<unit id="io.github.classgraph" version="4.8.138.v20211212-1642"/> |
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/2022-03"/> |
||||
</location> |
||||
</locations> |
||||
</target> |
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue