Archived
0

Всё есть bundles

Всё же лучше вернуться к изначальной идее, когда модули и
юиюлиотеки подгружаются как bundles, т.к. на данном этапе
ясно, что разные модули могут использовать одни и теже
бибилиотеки.
This commit is contained in:
2017-04-27 05:48:00 +03:00
parent 2117b440ff
commit 8b725d0f69
4 changed files with 16 additions and 29 deletions

View File

@@ -1,10 +1,15 @@
group = 'asys'
version = '0.1.1-SNAPSHOT'
version = '0.2-SNAPSHOT'
apply plugin: 'application'
mainClassName = "asys.core.Main"
configurations {
included
compile.extendsFrom included
}
jar {
manifest {
attributes 'Implementation-Title': 'ASys Core',
@@ -12,12 +17,13 @@ jar {
'Main-Class': mainClassName
}
baseName = project.group + '.' + project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from { configurations.included.collect { it.isDirectory() ? it : zipTree(it) } }
}
dependencies {
included group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
runtime group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion
compile group: 'org.apache.felix', name: 'org.apache.felix.framework', version: '5.6.1'
included group: 'org.apache.felix', name: 'org.apache.felix.framework', version: '5.6.1'
compile group: 'com.google.guava', name: 'guava', version: '21.0'
}

View File

@@ -63,10 +63,11 @@ public class Core {
private String extraPackages() {
StringJoiner sj = new StringJoiner(",");
sj.add("com.sun.net.httpserver");
sj.add("sun.misc");
sj.add("sun.nio.ch");
sj.add("asys.api");
sj.add("org.slf4j;version=1.7.21");
sj.add("org.slf4j.helpers;version=1.7.21");
sj.add("com.google.common.collect;version=21.0");
return sj.toString();
}

View File

@@ -1,23 +1,13 @@
group = 'asys'
version = '0.4-SNAPSHOT'
version = '0.5-SNAPSHOT'
apply plugin: 'osgi'
configurations {
included
compile.extendsFrom included
}
jar {
dependsOn configurations.included
manifest {
name = 'ASys MC server manager'
instruction 'Bundle-Activator', 'asys.mcsmanager.Activator'
instruction 'Import-Package', '!io.netty.*', 'javax.security.cert', 'org.slf4j.helpers', '*'
}
from { configurations.included.collect { it.isDirectory() ? it : zipTree(it).matching{exclude{it.path.contains('META-INF')} } } }
}
ext {
@@ -27,5 +17,5 @@ ext {
dependencies {
compile project(':core')
compile project(':webinterface')
included group: 'io.netty', name: 'netty-codec', version: nettyVersion
compile group: 'io.netty', name: 'netty-codec', version: nettyVersion
}

View File

@@ -1,5 +1,5 @@
group = 'asys'
version = '0.16-SNAPSHOT'
version = '0.17-SNAPSHOT'
buildscript {
repositories {
@@ -12,16 +12,6 @@ buildscript {
apply plugin: 'org.dm.bundle'
configurations {
included
compile.extendsFrom included
}
jar {
dependsOn configurations.included
from { configurations.included.collect { it.isDirectory() ? it : zipTree(it).matching{exclude{it.path.contains('META-INF')} } } }
}
bundle {
instructions << [
'Bundle-Name': 'ASys Web interface',
@@ -35,6 +25,6 @@ bundle {
dependencies {
compile project(':core')
included group: 'com.google.code.gson', name: 'gson', version: '2.7'
included group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
}