Newer
Older
apply plugin: 'application'
apply plugin: 'osgi'
apply plugin: 'war'
apply plugin: 'eclipse'
sourceCompatibility = '1.8'
version = '0.2.0'
repositories {
maven {
url "http://repo.dotcms.com/artifactory/libs-release"
}
}
dependencies {
compile fileTree(dir: "${getFelixDirPath()}/load", include: '*.jar')
compile (group: 'com.dotcms', name: 'dotcms', version: '3.3.2'){
transitive = true
}
providedCompile "javax.servlet:servlet-api:2.5"
}
jar {
manifest {
name = 'Structural Integrity StructuresSnapshotServiceTool'
instruction 'Bundle-Vendor', 'ANRTS Web Services'
instruction 'Bundle-Description', 'Viewtool providing the Structural Integrity StructuresSnapshotService.'
instruction 'Bundle-DocURL', ''
instruction 'Bundle-Activator', "${applicationName}.Activator"
instruction 'DynamicImport-Package', '*'
instruction 'Import-Package', '' +
'edu.msu.anr.osgi.structuralintegrity.service;version=1.1.0,' +
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
'*;version=0'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.8'
}
def getBundleName() {
return project.properties.get("applicationName")
}
def getFelixDirPath() {
def felixDirPath = System.getenv('FELIXDIR')
if (felixDirPath == null) {
throw new GradleException('Please set and export $FELIXDIR environment variable.')
}
def felixDir = file(felixDirPath)
if (!felixDir.isDirectory()) {
throw new GradleException('Unable to get directory ' + felixDir.absolutePath + '.')
}
return felixDir.absolutePath
}
def getUndeployedDir() {
return fileTree(dir: "${getFelixDirPath()}/undeployed")
}
def getLoadDir() {
return fileTree(dir: "${getFelixDirPath()}/load")
}
task deleteUndeployed(type: Delete) {
delete getUndeployedDir().matching {
include "${getBundleName()}-*.jar"
}.getFiles()
}
task copyLoadedToUndeploy(type: Copy, dependsOn: [deleteUndeployed]) {
from getLoadDir().getDir()
into getUndeployedDir().getDir()
include "**/${getBundleName()}-*.jar"
}
task deleteLoaded(type: Delete, dependsOn: [copyLoadedToUndeploy]) {
delete getLoadDir().matching {
include "${getBundleName()}-*.jar"
}.getFiles()
}
task undeploy(dependsOn: [copyLoadedToUndeploy, deleteLoaded])
task load(type: Copy, dependsOn: [clean, jar, undeploy]) {
from project.properties.get("libsDir")
into getLoadDir().getDir()
include "${getBundleName()}-*.jar"
}