blob: 3736a7c9ef54dc25858f9e5c96a0372380fc953e [file] [log] [blame]
Alexander Afanasyevccb373d2016-01-25 11:28:18 -08001buildscript {
2 repositories {
3 mavenLocal()
4 jcenter()
5 mavenCentral()
6 }
7}
8
9plugins {
Alexander Afanasyevb7e4f9b2019-06-24 16:13:01 -040010 id 'org.sonarqube' version '2.6.2'
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040011 id 'net.saliman.cobertura' version '2.5.4'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080012}
13
14apply plugin: 'java'
15apply plugin: 'maven'
16apply plugin: 'signing'
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080017apply plugin: 'checkstyle'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080018
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040019// group = 'com.intel.jndn.management'
20group = 'net.named-data.jndn-extra'
Alexander Afanasyevffd1f712019-06-24 16:47:55 -040021version = '1.2.2'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080022
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040023sourceCompatibility = JavaVersion.VERSION_1_8
24targetCompatibility = JavaVersion.VERSION_1_8
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080025compileJava.options.encoding = 'UTF-8'
26
27repositories {
28 mavenLocal()
29 jcenter()
30 mavenCentral()
31 maven {
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040032 url "https://oss.sonatype.org/content/repositories/releases/"
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080033 }
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 {
Alexander Afanasyevb7e4f9b2019-06-24 16:13:01 -040059 compile 'net.named-data:jndn:0.22'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080060
61 testCompile 'junit:junit:4.12'
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040062 testCompile 'net.named-data.jndn-extra:jndn-mock:1.1.1'
Alexander Afanasyevb7e4f9b2019-06-24 16:13:01 -040063 testRuntime 'org.slf4j:slf4j-api:1.7.26'
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080064
Alexander Afanasyevb7e4f9b2019-06-24 16:13:01 -040065 checkstyleConfig "com.puppycrawl.tools:checkstyle:8.22"
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'
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040080 group = 'verification'
81
82 testClassesDirs = sourceSets.integrationTest.output.classesDirs
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080083 classpath = sourceSets.integrationTest.runtimeClasspath
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040084
85 mustRunAfter test
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080086}
87
88tasks.withType(Test) {
89 reports.html.destination = file("${reporting.baseDir}/${name}")
90 testLogging {
91 events "passed", "skipped", "failed"
92 showStandardStreams = true
93 exceptionFormat = "full"
94 }
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040095 outputs.upToDateWhen { false }
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080096}
97
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080098tasks.withType(Checkstyle) {
99 checkstyleClasspath = project.configurations.checkstyleConfig
100 checkstyleMain {
101 exclude 'com/intel/jndn/management/enums/NfdTlv.java'
102 }
103 checkstyleTest {
104 configFile file('config/checkstyle/checkstyle-test.xml')
105 }
106 checkstyleIntegrationTest {
107 configFile file('config/checkstyle/checkstyle-test.xml')
108 }
109}
110
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800111if (JavaVersion.current().isJava8Compatible()) {
112 allprojects {
113 tasks.withType(Javadoc) {
114 options.addStringOption('Xdoclint:none', '-quiet')
115 }
116 }
117}
118
119artifacts {
120 archives javadocJar, sourcesJar
121}
122
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800123signing {
124 required { gradle.taskGraph.hasTask("uploadArchives") }
125 sign configurations.archives
126}
127
128uploadArchives {
129 repositories {
130 mavenDeployer {
131 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
132
133 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
134 try {
135 authentication(userName: ossrhUsername, password: ossrhPassword)
136 }
137 catch (Exception e) {
138 }
139 }
140
141 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
142 try {
143 authentication(userName: ossrhUsername, password: ossrhPassword)
144 }
145 catch (Exception e) {
146 }
147 }
148
149 pom.project {
150 name 'jndn-management'
151 packaging 'jar'
152 description 'Tools for managing an NDN forwarding daemon'
153 url 'https://github.com/01org/jndn-management'
154
155 scm {
156 connection 'scm:git:https://github.com/cawka/jndn-management'
157 developerConnection 'scm:git:https://github.com/01org/jndn-management'
158 url 'https://github.com/01org/jndn-management'
159 }
160
161 licenses {
162 license {
163 name 'GNU Lesser General Public License, Version 3.0+'
164 url 'http://www.gnu.org/licenses/lgpl.html'
165 }
166 }
167
168 developers {
169 developer {
170 id 'andrewbrown'
171 name 'Andrew Brown'
172 url 'https://github.com/andrewsbrown'
173 }
174 developer {
175 id 'cawka'
176 name 'Alexander Afanasyev'
177 email 'aa@cs.ucla.edu'
178 }
179 }
180 }
181 }
182 }
183}
184
185cobertura {
186 coverageFormats = ['html', 'xml']
187}