Skip to content

Commit 446b5f8

Browse files
committed
Switch to nexus plugin from adapted gradle-mvn-push.
1 parent 5f852a4 commit 446b5f8

39 files changed

Lines changed: 44 additions & 116 deletions

.travis.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ android:
66
- extra-google-m2repository
77
- android-21
88
jdk:
9-
- oraclejdk8
9+
- oraclejdk8
1010
before_install:
11-
- export TERM=dumb
12-
- chmod +x gradlew
13-
- ./gradlew -v
14-
- uname -a
11+
- export TERM=dumb
12+
- chmod +x gradlew
13+
- ./gradlew -v
14+
- uname -a
1515
sudo: false
1616
cache:
1717
directories:
18-
- $HOME/.gradle/caches/
18+
- $HOME/.gradle/caches/
1919
script:
20-
- ./gradlew clean :library:assemble :library:test :library:jacocoTestReport :library:coveralls
20+
- ./gradlew clean :sixpack-java:assemble :sixpack-java:test :sixpack-java:jacocoTestReport
21+
:sixpack-java:coveralls
2122
after_success:
22-
- coveralls
23-
- buildscripts/deploy_snapshot.sh
23+
- coveralls
24+
- buildscripts/deploy_snapshot.sh
2425
env:
2526
global:
26-
- secure: bBWD+V35Tfso9UM51CvGCeUsg8h5pm8tGVLe+nFBMLcZCTOSPVtoGZMMns5xxNNVL2zMkyeGQ1q8lMzLmg63qxyuXxUHTokm5CBa1Z+4N+JMuV42q8fPhC7pfMKVH1/CBTEEmtFI7xyfAD7w/fcLkckfjdxjkLGPLmRsV0PXjkw=
27-
- secure: iJMMcetxmGBcZpRGs2x4QULJjjtFwqJrPtYuZc+2MwypIlEfbvFiAi2zJf7+RT9+V60iqDgCofDjrvQQH9T4FmKuAeedtp8tpNVWVG9Dhw9eVM7uaSOwhQ+vOgxL1g9vm5CLMzZQBKvZGflMBNX9TFc6+FmUHKgbTSPiCiemdos=
27+
- secure: WSZRCzEkUw8MlG2Fgjj+yonnjEtcWI67U2Q+U01GKd/Yz01X1xnN55HuSvDp4rUn8mn2aKg/kUsaOzjVEnHFJF4UJ0SOqzNAm7oC6EemG/gdKcrlvJ6TL5WBIoE/lCanQVL7FJqt3wPH6JN5/A/0JLUujWeJGORL62t9PyabXP8=
28+
- secure: PoUWqyvwj+tIpu1iG7M24Z9qh32Ise2AeEiy+rN0FUNTimha/0ddXFSVMXnwmJ6m/+cZjOJKCPVWvZXuChlNLDNrU2pdAGJzUoMJ+9R9+4D7y3Xk1GJ6HbhSrSrioM9GiZ8C6DnScVWrSmZ/iQDjpja/IXPHtqblBh7UsUy0Nd0=

buildscripts/deploy_snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
2222
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
2323
else
2424
echo "Deploying snapshot..."
25-
./gradlew -PNEXUS_USERNAME="$NEXUS_USERNAME" -PNEXUS_PASSWORD="$NEXUS_PASSWORD" :library:uploadArchives
25+
./gradlew -PnexusUsername="$nexusUsername" -PnexusPassword="$nexusPassword" :sixpack-java:uploadArchives
2626
echo "Snapshot deployed!"
2727
fi

example-android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android {
2626
}
2727

2828
dependencies {
29-
compile project(':library')
29+
compile project(':sixpack-java')
3030
compile 'com.android.support:appcompat-v7:21.0.3'
3131
compile 'com.android.support:support-v4:21.0.3'
3232
compile 'com.jakewharton:butterknife:6.0.0'

example-java/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ targetCompatibility = 1.8
55
version = '1.0'
66

77
dependencies {
8-
compile project(':library')
9-
}
8+
compile project(':sixpack-java')
9+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ VERSION_NAME=0.0.1-SNAPSHOT
22
VERSION_CODE=1
33
GROUP=com.seatgeek
44

5-
POM_DESCRIPTION=A Java client for the sixpack A/B testing framework
5+
POM_DESCRIPTION=A Java client for the Sixpack A/B testing framework
66
POM_URL=https://github.com/seatgeek/sixpack-java/
77
POM_SCM_URL=https://github.com/seatgeek/sixpack-java/
88
POM_SCM_CONNECTION=scm:git@github.com:seatgeek/sixpack-java.git

library/gradle.properties

Lines changed: 0 additions & 3 deletions
This file was deleted.

settings.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
rootProject.name = 'sixpack-java'
22

3-
include ':library',
3+
include ':sixpack-java',
44
':example-android',
55
':example-java'
6-
File renamed without changes.
Lines changed: 24 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
buildscript {
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

119
apply plugin: 'java'
1210
apply plugin: 'jacoco'
1311
apply 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

1815
sourceCompatibility = 1.5
1916

20-
repositories {
21-
mavenCentral()
22-
jcenter();
23-
}
24-
2517
dependencies {
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

sixpack-java/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
POM_NAME=Sixpack Java Client
2+
POM_PACKAGING=jar

0 commit comments

Comments
 (0)