-
Notifications
You must be signed in to change notification settings - Fork 434
/
Copy pathpublish.gradle
74 lines (62 loc) · 2.2 KB
/
publish.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
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
//./gradlew clean ./gradlew build ./gradlew bintrayUpload
group = project.GROUP_ID
version = project.VERSION
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/libs/$project.name-${version}.jar")
groupId project.GROUP_ID
artifactId project.ARTIFACT_ID
version project.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)
}
}
}
}
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourcesJar
}
bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def bintrayUser = properties.getProperty('bintrayUser')
def bintrayApiKey = properties.getProperty('bintrayApiKey')
user = bintrayUser
key = bintrayApiKey
publications = ['Production']
configurations = ['archives']
override = true
pkg {
repo = "maven"
name = project.NAME
licenses = ["Apache-2.0"]
publish = true
description = "Java socket library"
publicDownloadNumbers = true
vcsUrl = 'https://github.com/xuuhaoo/OkSocket.git'
dryRun = false
version {
name = project.VERSION
desc = "Java socket library"
released = new Date()
vcsTag = project.VERSION
}
}
}