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