-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
96 lines (82 loc) · 2.62 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
92
93
94
95
96
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
plugins {
id "com.github.spotbugs" version "4.0.5"
id "com.github.johnrengelman.shadow" version "5.2.0"
id "de.undercouch.download" version "4.0.4"
id "net.researchgate.release" version "2.8.0"
}
ext.ballerinaLangVersion = project.ballerinaLangVersion
allprojects {
group = project.group
version = project.version
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
}
subprojects {
apply plugin: 'java'
}
def artifactCacheParent = file("${project.projectDir}/build/cache_parent/")
def packageName = "microsoft.excel"
def packageOrg = "ballerinax"
def pathToBala = file("${project.projectDir}/excel/target/bala")
def platform = "java11"
task createBalaDirectory {
mkdir "${project.projectDir}/excel/target/bala"
}
task build {
dependsOn('excel:build')
}
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}/excel/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-microsoft.excel")
credentials {
username = System.getenv("publishUser")
password = System.getenv("publishPAT")
}
}
}
}
publish.dependsOn copyDistribution