blob: 1f498c823dad6376380d6cbffa5537ce66f987a2 [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'
58 compile 'com.intel.jndn.utils:jndn-utils:1.0.0'
59
60 testCompile 'junit:junit:4.12'
61 testCompile 'com.intel.jndn.mock:jndn-mock:1.0.1'
62 testRuntime 'org.slf4j:slf4j-api:1.7.16'
63}
64
65task javadocJar(type: Jar) {
66 classifier = 'javadoc'
67 from javadoc
68}
69
70task sourcesJar(type: Jar) {
71 classifier = 'sources'
72 from sourceSets.main.allSource
73}
74
75task integrationTest(type: Test) {
76 description 'Compile and run integration tests'
77 testClassesDir = sourceSets.integrationTest.output.classesDir
78 classpath = sourceSets.integrationTest.runtimeClasspath
79}
80
81tasks.withType(Test) {
82 reports.html.destination = file("${reporting.baseDir}/${name}")
83 testLogging {
84 events "passed", "skipped", "failed"
85 showStandardStreams = true
86 exceptionFormat = "full"
87 }
88 outputs.upToDateWhen { false }
89}
90
91if (JavaVersion.current().isJava8Compatible()) {
92 allprojects {
93 tasks.withType(Javadoc) {
94 options.addStringOption('Xdoclint:none', '-quiet')
95 }
96 }
97}
98
99artifacts {
100 archives javadocJar, sourcesJar
101}
102
103publishing {
104 publications {
105 mavenJava(MavenPublication) {
106 artifact javadocJar
107 artifact sourcesJar
108 }
109 }
110}
111
112signing {
113 required { gradle.taskGraph.hasTask("uploadArchives") }
114 sign configurations.archives
115}
116
117uploadArchives {
118 repositories {
119 mavenDeployer {
120 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
121
122 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
123 try {
124 authentication(userName: ossrhUsername, password: ossrhPassword)
125 }
126 catch (Exception e) {
127 }
128 }
129
130 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
131 try {
132 authentication(userName: ossrhUsername, password: ossrhPassword)
133 }
134 catch (Exception e) {
135 }
136 }
137
138 pom.project {
139 name 'jndn-management'
140 packaging 'jar'
141 description 'Tools for managing an NDN forwarding daemon'
142 url 'https://github.com/01org/jndn-management'
143
144 scm {
145 connection 'scm:git:https://github.com/cawka/jndn-management'
146 developerConnection 'scm:git:https://github.com/01org/jndn-management'
147 url 'https://github.com/01org/jndn-management'
148 }
149
150 licenses {
151 license {
152 name 'GNU Lesser General Public License, Version 3.0+'
153 url 'http://www.gnu.org/licenses/lgpl.html'
154 }
155 }
156
157 developers {
158 developer {
159 id 'andrewbrown'
160 name 'Andrew Brown'
161 url 'https://github.com/andrewsbrown'
162 }
163 developer {
164 id 'cawka'
165 name 'Alexander Afanasyev'
166 email 'aa@cs.ucla.edu'
167 }
168 }
169 }
170 }
171 }
172}
173
174cobertura {
175 coverageFormats = ['html', 'xml']
176}