This repository was archived by the owner on Mar 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.gradle
More file actions
87 lines (78 loc) · 2.69 KB
/
Copy pathpush.gradle
File metadata and controls
87 lines (78 loc) · 2.69 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
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
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
import org.apache.tools.ant.taskdefs.condition.Os
// bintray
Properties properties = new Properties()
boolean isHasFile = false
if (project.rootProject.file('local.properties') != null && project.rootProject.file('local.properties').exists()) {
isHasFile = true
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
def bintrayUser = isHasFile ? properties.getProperty("bintray.user") : System.getenv("BINTRAY_USER")
def bintrayKey = isHasFile ? properties.getProperty("bintray.apikey") : System.getenv("BINTRAY_KEY")
version POM_VERSION
group POM_GROUP_ID
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/logs-release.aar")
groupId POM_GROUP_ID
artifactId POM_ARTIFACT_ID
version POM_VERSION
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included in the pom.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
bintray {
user = bintrayUser
key = bintrayKey
publications = ['Production']
configurations = ['archives']
override = true
pkg {
repo = POM_REPO_NAME
name = POM_UPLOAD_NAME
description = POM_DESC
publish = true
publicDownloadNumbers = true
licenses = ['Apache-2.0']
vcsUrl = POM_WEBSITE + '.git'
userOrg = POM_USER_ORG
websiteUrl = POM_WEBSITE
version {
name = POM_VERSION
released = new Date()
}
}
}
task fuck(group: 'publishing') {
doFirst {
if (null == bintrayUser || null == bintrayKey) {
throw new Exception('missing bintray.users or bintray.apikey in local.properties')
}
}
doLast {
exec {
commandLine "../${getGradlewName()}", 'clean', 'build', 'bintrayUpload'
}
}
}
static def getGradlewName() {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
return "gradlew.bat"
} else {
return "gradlew"
}
}