-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
80 lines (67 loc) · 2.17 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
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
plugins {
id "biz.aQute.bnd" version "6.1.0" apply false
}
apply from: gradle.oshCoreDir + '/common.gradle'
version = oshCoreVersion
description = 'OSH Add-ons'
subprojects {
version = oshCoreVersion
// inject all repositories from included builds if any
repositories.addAll(rootProject.repositories)
// add project dependency to proper configuration depending on version
// this is used to build different zip distributions
afterEvaluate { p ->
rootProject.dependencies {
def dep = p.version.endsWith('SNAPSHOT') ? dev(p) : stable(p)
dep.exclude group: 'org.sensorhub'
dep.exclude group: 'org.vast.opengis'
}
// publish to repo
task publishBundle(type:Exec) {
def bundleFile = osgi.outputs.files.singleFile
//commandLine 'curl', '-s', '-X', 'POST', '-H', """artifactUrl: file://${bundleFile}""", 'http://localhost:8181/cave/repository/api/repositories/osh-addons/artifact'
commandLine 'kubectl', 'cp', "${bundleFile}", 'osh-addons-69497bf779-4q65x:/opt/osh-node/data/addons'
}
}
/*// publish to maven repo
publishing {
repositories {
maven {
name = 'GitHubPackages'
url = 'https://maven.pkg.github.com/opensensorhub/osh-addons'
credentials {
username = ''
password = ''
}
}
}
}*/
}
// create one configuration for each distribution
configurations {
stable
dev
}
// task to generate OSGi bundle index
task osgiIndex(type: aQute.bnd.gradle.Index) {
//repositoryName 'OpenSensorHub Bundle Repository'
destinationDirectory = layout.buildDirectory.dir('osgi')
//base = '.'//'https://repo.opensensorhub.org/'
gzip = false
bundles = fileTree('.') {
include '**/build/libs/*bundle.jar'
}
}
task osgiIndexOnline(type: Copy) {
dependsOn osgiIndex
from "$buildDir/osgi/index.xml"
into "$buildDir/osgi"
rename 'index.xml','index_online.xml'
filter { line -> line.replaceAll('value=".*/build/libs/', 'value="') }
doLast {
exec {
commandLine 'kubectl', 'cp', "$buildDir/osgi/index_online.xml", 'osh-addons-69497bf779-4q65x:/opt/osh-node/data/addons/index.xml'
}
}
}
apply from: gradle.oshCoreDir + '/release.gradle'