Repository navigation
Expand file tree
/
Copy pathpublish.gradle
More file actions
57 lines (51 loc) · 2.03 KB
/
Copy pathpublish.gradle
File metadata and controls
57 lines (51 loc) · 2.03 KB
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
/*
* Copyright (c) 2022(-0001) STMicroelectronics.
* All rights reserved.
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*/
apply plugin: 'maven-publish'
def LIB_GROUP_ID = 'com.st.plot'
def LIB_ARTIFACT_ID = 'st-plot'
tasks.register('sourceJar', Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set('sources')
}
afterEvaluate {
publishing {
repositories {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/PRG-SWP/Android_App_STBLESensors")
credentials {
username = System.getenv('GPR_USER') ?: project.properties['GPR_USER']
password = System.getenv('GPR_API_KEY') ?: project.properties['GPR_API_KEY']
}
}
maven {
name = 'Local'
url = "file://${buildDir}/repo"
}
}
publications {
blueStSdk(MavenPublication) {
groupId LIB_GROUP_ID
artifactId LIB_ARTIFACT_ID
version = project.properties['stExportedLibVersion']
artifact("$buildDir/outputs/aar/st_plot-release.aar")
artifact(sourceJar)
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.api.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}