-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
49 lines (43 loc) · 1.56 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
version = '1.0'
repositories {
mavenLocal()
mavenCentral()
maven {
url "http://cobra.cs.uni-duesseldorf.de/artifactory/libs-snapshot-local"
}
}
dependencies {
//testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'org.coreasm', name: 'org.coreasm.engine', version: '1.6.5-SNAPSHOT'
}
jar {
def getRuntimeDependencyEntities = { configurations.runtime.resolve() } // list of included dependencies
def entityName = { it.isDirectory() ? it.name : it.name[0..<it.name.lastIndexOf('.')] } // internal directory name is source directory name or jar file name (sans .jar)
manifest {
attributes "Main-Class" : 'WebASM'
attributes "Class-Path" : getRuntimeDependencyEntities().collect { entityName(it) } // set classpath to list of internal directories created
}
// copy each dependency into separate internal directory
doFirst {
getRuntimeDependencyEntities().each {
def dest = entityName(it)
if ( it.isDirectory() ) {
from (it) {
into dest
}
} else {
// remove manifests and the security files from jar contents.
from (zipTree(it)) {
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
into dest
}
}
}
}
}