11buildscript {
2- repositories {
3- jcenter()
4- }
2+ repositories {
3+ jcenter()
4+ }
55
6- dependencies {
7- classpath ' eu.appsatori:gradle-fatjar-plugin:0.3'
8- }
6+ dependencies {
7+ classpath ' eu.appsatori:gradle-fatjar-plugin:0.3'
8+ }
99}
1010
1111apply plugin : ' java'
1212apply plugin : ' findbugs'
1313apply plugin : ' pmd'
1414apply plugin : ' checkstyle'
1515apply plugin : ' eu.appsatori.fatjar'
16+ apply plugin : ' maven'
17+ apply plugin : ' signing'
1618
1719sourceCompatibility = 1.7
1820targetCompatibility = 1.7
19- version = ' 4.0.0'
2021
21- repositories {
22- mavenCentral()
23- }
22+ group = " com.blockscore "
23+ archivesBaseName = " blockscore-java "
24+ version = " 4.0.0 "
2425
25- checkstyle {
26- toolVersion = " 6.7 "
26+ repositories {
27+ jcenter()
2728}
2829
2930dependencies {
30- compile ' com.squareup.retrofit:retrofit:+ '
31- compile ' com.squareup.retrofit:converter-jackson:+ '
32- compile ' com.squareup.okhttp:okhttp:+ '
33- compile ' com.squareup.okhttp:okhttp-urlconnection:+ '
31+ compile ' com.squareup.retrofit:retrofit:1.9.0 '
32+ compile ' com.squareup.retrofit:converter-jackson:1.9.0 '
33+ compile ' com.squareup.okhttp:okhttp:2.4.0 '
34+ compile ' com.squareup.okhttp:okhttp-urlconnection:2.4.0 '
3435
35- // Used for static analysis
36- compile ' com.intellij:annotations:+'
37- compile ' com.google.code.findbugs:annotations:+'
36+ compile ' com.intellij:annotations:12.0'
37+ compile ' com.google.code.findbugs:annotations:2.0.2'
3838
39- // Used for testing only.
40- testCompile ' junit:junit:+'
39+ testCompile ' junit:junit:4.12'
4140}
4241
43- task docs (type : Javadoc ) {
44- source = sourceSets. main. allJava
45- options {
46- links(" http://docs.oracle.com/javase/7/docs/api/" );
47- }
42+ tasks. withType(JavaCompile ) {
43+ options. compilerArgs << " -Xlint"
4844}
4945
5046jar {
5753
5854test {
5955 testLogging {
60- // Show that tests are run in the command-line output
6156 events ' started' , ' passed'
6257 showStandardStreams true
6358 }
@@ -74,10 +69,76 @@ pmd {
7469 sourceSets = [sourceSets. main]
7570}
7671
77- checkstyleTest. exclude ' **/src/test/**'
72+ checkstyle {
73+ toolVersion = " 6.7"
74+ sourceSets = [ sourceSets. main ]
75+ }
76+
77+ task javadocJar (type : Jar ) {
78+ classifier = ' javadoc'
79+ from javadoc
80+ }
7881
82+ task sourcesJar (type : Jar ) {
83+ classifier = ' sources'
84+ from sourceSets. main. allSource
85+ }
7986
80- // Use java's linting facilities
81- tasks. withType(JavaCompile ) {
82- options. compilerArgs << " -Xlint"
83- }
87+ artifacts {
88+ archives javadocJar, sourcesJar
89+ }
90+
91+ uploadArchives {
92+ repositories {
93+ mavenDeployer {
94+ beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
95+
96+ repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
97+ authentication(userName : ' ' , password : ' ' )
98+ }
99+
100+ snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
101+ authentication(userName : ' ' , password : ' ' )
102+ }
103+
104+ pom. project {
105+ name ' Blockscore API'
106+ packaging ' jar'
107+ description ' The Blockscore API wrapper for java.'
108+ url ' http://docs.blockscore.com/v4.0/java/#introduction'
109+
110+ scm {
111+ connection ' scm:git:git@github.com:BlockScore/blockscore-java.git'
112+ developerConnection ' scm:git:git@github.com:BlockScore/blockscore-java.git'
113+ url ' git@github.com:BlockScore/blockscore-java.git'
114+ }
115+
116+ licenses {
117+ license {
118+ name ' MIT License'
119+ url ' http://opensource.org/licenses/MIT'
120+ }
121+ }
122+
123+ developers {
124+ developer {
125+ id ' dgollahon'
126+ name ' Daniel Gollahon'
127+ email ' Daniel.Gollahon@gmail.com'
128+ }
129+
130+ developer {
131+ id ' ameier'
132+ name ' Alain Meier'
133+ email ' Alain@blockscore.com'
134+ }
135+ }
136+ }
137+ }
138+ }
139+ }
140+
141+ signing {
142+ required { gradle. taskGraph. hasTask(" uploadArchives" ) }
143+ sign configurations. archives
144+ }
0 commit comments