11apply plugin : ' maven'
22
3- version = VERSION_NAME
4- group = GROUP // Maven Group ID for the artifact
5-
3+ // project.archivesBaseName is added by the Maven plugin to the project, the value defaults to the
4+ // project.name property, but since project.name is basically the current folder name the desired
5+ // archive name is often different hence the explicit assignment.
6+ project. archivesBaseName = ARTIFACT_ID
7+ project. version = VERSION
8+ project. group = GROUP
69
710install {
8- repositories. mavenInstaller {
9- // This generates POM.xml with proper parameters
10- pom {
11-
12- groupId = GROUP
13- artifactId = POM_ARTIFACT_ID
14- version = VERSION_NAME
15-
16- project {
17- packaging POM_PACKAGING
18-
19-
20- // Add your description here
21- name POM_NAME
22- description POM_DESCRIPTION
23- url POM_URL
24-
25- // Set your license
26- licenses {
27- license {
28- name POM_LICENCE_NAME
29- url POM_LICENCE_URL
11+ repositories{
12+ mavenInstaller {
13+ // This generates POM.xml with proper parameters
14+ pom {
15+ groupId = GROUP
16+ artifactId = ARTIFACT_ID
17+ version = VERSION
18+
19+ project {
20+ packaging PACKAGING
21+ name NAME
22+ description DESCRIPTION
23+ url PROJECT_WEBSITE
24+
25+ licenses {
26+ license {
27+ name LICENCE_NAME
28+ url LICENCE_URL
29+ }
3030 }
31- }
32- developers {
33- developer {
34- id POM_DEVELOPER_ID
35- name POM_DEVELOPER_NAME
36- email POM_DEVELOPER_EMAIL
31+ developers {
32+ developer {
33+ id DEVELOPER_ID
34+ name DEVELOPER_NAME
35+ email DEVELOPER_EMAIL
36+ }
37+ }
38+ scm {
39+ connection SCM_CONNECTION
40+ developerConnection SCM_DEV_CONNECTION
41+ url SCM_URL
3742 }
38- }
39- scm {
40- connection POM_SCM_CONNECTION
41- developerConnection POM_SCM_DEV_CONNECTION
42- url POM_SCM_URL
43-
4443 }
4544 }
4645 }
4746 }
4847}
4948
50- apply plugin : ' com.jfrog.bintray'
51-
5249if (project. getPlugins(). hasPlugin(' com.android.application' ) || project. getPlugins(). hasPlugin(' com.android.library' )) {
5350 // Android libraries
5451
@@ -81,7 +78,6 @@ if (project.getPlugins().hasPlugin('com.android.application') || project.getPlug
8178 }
8279}
8380
84-
8581artifacts {
8682 if (project. getPlugins(). hasPlugin(' com.android.application' ) || project. getPlugins(). hasPlugin(' com.android.library' )) {
8783 archives androidSourcesJar
@@ -93,28 +89,33 @@ artifacts {
9389}
9490
9591// Bintray
92+ apply plugin : ' com.jfrog.bintray'
93+
9694Properties properties = new Properties ()
97- properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
95+ properties. load(project. rootProject. file(" local.properties" ). newDataInputStream())
9896
9997bintray {
10098 user = properties. getProperty(" bintray.user" )
10199 key = properties. getProperty(" bintray.apikey" )
102100
103- configurations = [' archives' ]
101+ publish = true
102+ configurations = [" archives" ]
104103
105- // Bintry package information
104+ // Package information
106105 pkg {
107- repo = BINTRAY_REPO
108- name = POM_ARTIFACT_ID
109- desc = POM_DESCRIPTION
110- websiteUrl = POM_URL
111- vcsUrl = POM_SCM_URL
112- licenses = [BINTRAY_LICENCE ]
113- publish = true
114- publicDownloadNumbers = true
106+ repo = " maven"
107+ name = ARTIFACT_ID
108+ desc = DESCRIPTION
109+ websiteUrl = PROJECT_WEBSITE
110+ vcsUrl = SCM_URL
111+ licenses = [LICENCE ]
115112 version {
116- name = VERSION_NAME
113+ name = VERSION
114+ vcsTag = VERSION
117115 released = new Date ();
118116 }
119117 }
120- }
118+ }
119+
120+ // Make sure clean and install are executed before upload.
121+ bintrayUpload. dependsOn clean, install
0 commit comments