blob: aed58dbd8febacd47582663b6aa34fcd125b7865 [file] [log] [blame]
Alexander Afanasyevccb373d2016-01-25 11:28:18 -08001buildscript {
2 repositories {
3 mavenLocal()
4 jcenter()
5 mavenCentral()
6 }
7}
8
9plugins {
10 id "org.sonarqube" version "1.2"
11 id 'net.saliman.cobertura' version '2.3.0'
12}
13
14apply plugin: 'java'
15apply plugin: 'maven'
16apply plugin: 'signing'
17apply plugin: 'maven-publish'
18
19group = 'com.intel.jndn.management'
20version = '1.0.1-SNAPSHOT'
21
22sourceCompatibility = JavaVersion.VERSION_1_7
23targetCompatibility = JavaVersion.VERSION_1_7
24compileJava.options.encoding = 'UTF-8'
25
26repositories {
27 mavenLocal()
28 jcenter()
29 mavenCentral()
30 maven {
31 url "https://oss.sonatype.org/content/repositories/snapshots/"
32 }
33}
34
35sourceSets {
36 test {
37 java {
38 exclude '**/*IT.java'
39 }
40 }
41 integrationTest {
42 java {
43 compileClasspath += main.output + test.output
44 runtimeClasspath += main.output + test.output
45 srcDir file('src/test/java')
46 include '**/*IT.java'
47 }
48 }
49}
50
51configurations {
52 integrationTestCompile.extendsFrom testCompile
53 integrationTestRuntime.extendsFrom testRuntime
54}
55
56dependencies {
57 compile 'net.named-data:jndn:0.10'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080058
59 testCompile 'junit:junit:4.12'
60 testCompile 'com.intel.jndn.mock:jndn-mock:1.0.1'
61 testRuntime 'org.slf4j:slf4j-api:1.7.16'
62}
63
64task javadocJar(type: Jar) {
65 classifier = 'javadoc'
66 from javadoc
67}
68
69task sourcesJar(type: Jar) {
70 classifier = 'sources'
71 from sourceSets.main.allSource
72}
73
74task integrationTest(type: Test) {
75 description 'Compile and run integration tests'
76 testClassesDir = sourceSets.integrationTest.output.classesDir
77 classpath = sourceSets.integrationTest.runtimeClasspath
78}
79
80tasks.withType(Test) {
81 reports.html.destination = file("${reporting.baseDir}/${name}")
82 testLogging {
83 events "passed", "skipped", "failed"
84 showStandardStreams = true
85 exceptionFormat = "full"
86 }
87 outputs.upToDateWhen { false }
88}
89
90if (JavaVersion.current().isJava8Compatible()) {
91 allprojects {
92 tasks.withType(Javadoc) {
93 options.addStringOption('Xdoclint:none', '-quiet')
94 }
95 }
96}
97
98artifacts {
99 archives javadocJar, sourcesJar
100}
101
102publishing {
103 publications {
104 mavenJava(MavenPublication) {
105 artifact javadocJar
106 artifact sourcesJar
107 }
108 }
109}
110
111signing {
112 required { gradle.taskGraph.hasTask("uploadArchives") }
113 sign configurations.archives
114}
115
116uploadArchives {
117 repositories {
118 mavenDeployer {
119 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
120
121 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
122 try {
123 authentication(userName: ossrhUsername, password: ossrhPassword)
124 }
125 catch (Exception e) {
126 }
127 }
128
129 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
130 try {
131 authentication(userName: ossrhUsername, password: ossrhPassword)
132 }
133 catch (Exception e) {
134 }
135 }
136
137 pom.project {
138 name 'jndn-management'
139 packaging 'jar'
140 description 'Tools for managing an NDN forwarding daemon'
141 url 'https://github.com/01org/jndn-management'
142
143 scm {
144 connection 'scm:git:https://github.com/cawka/jndn-management'
145 developerConnection 'scm:git:https://github.com/01org/jndn-management'
146 url 'https://github.com/01org/jndn-management'
147 }
148
149 licenses {
150 license {
151 name 'GNU Lesser General Public License, Version 3.0+'
152 url 'http://www.gnu.org/licenses/lgpl.html'
153 }
154 }
155
156 developers {
157 developer {
158 id 'andrewbrown'
159 name 'Andrew Brown'
160 url 'https://github.com/andrewsbrown'
161 }
162 developer {
163 id 'cawka'
164 name 'Alexander Afanasyev'
165 email 'aa@cs.ucla.edu'
166 }
167 }
168 }
169 }
170 }
171}
172
173cobertura {
174 coverageFormats = ['html', 'xml']
175}