-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
91 lines (74 loc) · 2.24 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
81
82
83
84
85
86
87
88
89
90
91
plugins {}
ext.ballerinaLangVersion = project.ballerinaLangVersion
allprojects {
group = project.group
version = project.version
apply plugin: 'maven-publish'
repositories {
mavenLocal()
maven {
url = 'https://maven.wso2.org/nexus/content/groups/wso2-public/'
}
maven {
url = 'https://repo.maven.apache.org/maven2'
}
maven {
url = 'https://maven.pkg.github.com/ballerina-platform/ballerina-lang'
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
}
}
}
}
subprojects {
apply plugin: 'java'
dependencies {}
}
def artifactCacheParent = file("${project.projectDir}/build/cache_parent/")
def packageName = "asb"
def packageOrg = "ballerinax"
def pathToBala = file("${project.projectDir}/asb-ballerina/target/bala")
def platform = "java11"
task createBalaDirectory {
mkdir "${project.projectDir}/asb-ballerina/target/bala"
}
task copyDistribution {
inputs.dir file(project.projectDir)
pathToBala.eachFileMatch(~/.*.bala/) { balaFile ->
copy {
from zipTree(balaFile)
into file("${artifactCacheParent}/bala/${packageOrg}/${packageName}/${project.version}/${platform}")
}
}
copy {
from file("${project.projectDir}/asb-ballerina/target/cache")
exclude '**/*-testable.jar'
exclude '**/tests_cache/'
into file("${artifactCacheParent}/cache/")
}
outputs.dir artifactCacheParent
}
task createArtifactZip(type: Zip) {
from "${buildDir}/cache_parent"
archiveName 'distribution.zip'
destinationDir(file("${buildDir}/distribution"))
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact source: createArtifactZip, extension: 'zip'
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ballerina-platform/module-ballerinax-azure-service-bus")
credentials {
username = System.getenv("publishUser")
password = System.getenv("publishPAT")
}
}
}
}
publish.dependsOn copyDistribution