11buildscript {
2- repositories {
3- mavenCentral()
4- }
52 dependencies {
63 classpath ' org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.1.0'
4+ classpath ' com.bmuschko:gradle-nexus-plugin:2.3.1'
75 // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
86 }
97}
108
119apply plugin : ' java'
1210apply plugin : ' jacoco'
1311apply plugin : ' com.github.kt3k.coveralls'
14- apply plugin : ' maven'
15- apply plugin : ' signing'
12+ apply plugin : ' com.bmuschko.nexus'
1613// apply plugin: 'com.jfrog.bintray'
1714
1815sourceCompatibility = 1.5
1916
20- repositories {
21- mavenCentral()
22- jcenter();
23- }
24-
2517dependencies {
2618 testCompile ' junit:junit:4.11'
2719 testCompile ' org.mockito:mockito-core:1.10.19'
@@ -37,99 +29,36 @@ jacocoTestReport {
3729 }
3830}
3931
40- // custom tasks for creating source/javadoc jars
41- task sourcesJar (type : Jar , dependsOn : classes) {
42- classifier = ' sources'
43- from sourceSets. main. allSource
44- }
45-
46- task javadocJar (type : Jar , dependsOn : javadoc) {
47- classifier = ' javadoc'
48- from javadoc. destinationDir
49- }
50-
51- // add javadoc/source jar tasks as artifacts
52- artifacts {
53- archives sourcesJar, javadocJar
54- }
55-
56- signing {
57- required { isReleaseBuild() }
58- sign configurations. archives
59- }
60-
61- // Adapted from https://github.com/chrisbanes/gradle-mvn-push/blob/master/gradle-mvn-push.gradle
62- // Modificaions made to make it not rely on android project
63- uploadArchives {
64- repositories {
65- mavenDeployer {
66- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
67-
68- repository(url : getReleaseRepositoryUrl()) {
69- authentication(userName : getRepositoryUsername(), password : getRepositoryPassword())
70- }
32+ modifyPom {
33+ project {
34+ name POM_NAME
35+ packaging POM_PACKAGING
36+ description POM_DESCRIPTION
37+ url POM_URL
38+
39+ scm {
40+ url POM_SCM_URL
41+ connection POM_SCM_CONNECTION
42+ developerConnection POM_SCM_DEV_CONNECTION
43+ }
7144
72- snapshotRepository(url : getSnapshotRepositoryUrl()) {
73- authentication(userName : getRepositoryUsername(), password : getRepositoryPassword())
45+ licenses {
46+ license {
47+ name POM_LICENCE_NAME
48+ url POM_LICENCE_URL
49+ distribution POM_LICENCE_DIST
7450 }
51+ }
7552
76- pom. groupId = GROUP
77- pom. artifactId = POM_ARTIFACT_ID
78- pom. version = VERSION_NAME
79-
80- pom. project {
81- name POM_NAME
82- packaging POM_PACKAGING
83- description POM_DESCRIPTION
84- url POM_URL
85-
86- scm {
87- url POM_SCM_URL
88- connection POM_SCM_CONNECTION
89- developerConnection POM_SCM_DEV_CONNECTION
90- }
91-
92- licenses {
93- license {
94- name POM_LICENCE_NAME
95- url POM_LICENCE_URL
96- distribution POM_LICENCE_DIST
97- }
98- }
99-
100- developers {
101- developer {
102- id POM_DEVELOPER_ID
103- name POM_DEVELOPER_NAME
104- }
105- }
53+ developers {
54+ developer {
55+ id POM_DEVELOPER_ID
56+ name POM_DEVELOPER_NAME
10657 }
10758 }
10859 }
10960}
11061
111- def isReleaseBuild () {
112- return VERSION_NAME . contains(" SNAPSHOT" ) == false
113- }
114-
115- def getReleaseRepositoryUrl () {
116- return hasProperty(' RELEASE_REPOSITORY_URL' ) ? RELEASE_REPOSITORY_URL
117- : " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
118- }
119-
120- def getSnapshotRepositoryUrl () {
121- return hasProperty(' SNAPSHOT_REPOSITORY_URL' ) ? SNAPSHOT_REPOSITORY_URL
122- : " https://oss.sonatype.org/content/repositories/snapshots/"
123- }
124-
125- def getRepositoryUsername () {
126- return hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : " "
127- }
128-
129- def getRepositoryPassword () {
130- return hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : " "
131- }
132-
13362//
13463// bintray {
13564// user = BINTRAY_USER //this usually comes from gradle.properties file in ~/.gradle
0 commit comments