blob: c9756afe00e3eddc6a4aecfefce90e3a98fa126f [file] [log] [blame]
Alexander Afanasyevccb373d2016-01-25 11:28:18 -08001buildscript {
2 repositories {
3 mavenLocal()
4 jcenter()
5 mavenCentral()
6 }
7}
8
9plugins {
Davide Pesaventob6df5132019-09-24 14:05:00 -040010 id 'java'
11 id 'maven'
12 id 'signing'
13 id 'checkstyle'
Davide Pesavento399f0b92020-04-17 18:31:26 -040014 id 'org.sonarqube' version '2.8'
15 id 'net.saliman.cobertura' version '3.0.0'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080016}
17
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040018group = 'net.named-data.jndn-extra'
Alexander Afanasyev238bfc72020-05-18 21:49:47 -040019version = '1.3.0'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080020
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040021sourceCompatibility = JavaVersion.VERSION_1_8
22targetCompatibility = JavaVersion.VERSION_1_8
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080023compileJava.options.encoding = 'UTF-8'
24
25repositories {
26 mavenLocal()
27 jcenter()
28 mavenCentral()
29 maven {
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040030 url "https://oss.sonatype.org/content/repositories/releases/"
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080031 }
32}
33
34sourceSets {
35 test {
36 java {
37 exclude '**/*IT.java'
38 }
39 }
40 integrationTest {
41 java {
42 compileClasspath += main.output + test.output
43 runtimeClasspath += main.output + test.output
44 srcDir file('src/test/java')
45 include '**/*IT.java'
46 }
47 }
48}
49
50configurations {
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080051 checkstyleConfig
52 integrationTestCompile.extendsFrom testCompile
53 integrationTestRuntime.extendsFrom testRuntime
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080054}
55
56dependencies {
Alexander Afanasyev238bfc72020-05-18 21:49:47 -040057 compile 'net.named-data:jndn:0.24'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080058
59 testCompile 'junit:junit:4.12'
Alexander Afanasyev238bfc72020-05-18 21:49:47 -040060 testCompile 'net.named-data.jndn-extra:jndn-mock:1.2.0'
61 testRuntime 'org.slf4j:slf4j-api:1.7.30'
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080062
Davide Pesaventob6df5132019-09-24 14:05:00 -040063 checkstyleConfig 'com.puppycrawl.tools:checkstyle:8.23'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080064}
65
66task javadocJar(type: Jar) {
67 classifier = 'javadoc'
68 from javadoc
69}
70
71task sourcesJar(type: Jar) {
72 classifier = 'sources'
73 from sourceSets.main.allSource
74}
75
76task integrationTest(type: Test) {
77 description 'Compile and run integration tests'
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040078 group = 'verification'
79
80 testClassesDirs = sourceSets.integrationTest.output.classesDirs
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080081 classpath = sourceSets.integrationTest.runtimeClasspath
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040082
83 mustRunAfter test
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080084}
85
Davide Pesaventob5f84d22019-09-24 14:55:48 -040086tasks.withType(JavaCompile) {
87 options.deprecation = true
88}
89
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080090tasks.withType(Test) {
91 reports.html.destination = file("${reporting.baseDir}/${name}")
92 testLogging {
93 events "passed", "skipped", "failed"
94 showStandardStreams = true
95 exceptionFormat = "full"
96 }
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040097 outputs.upToDateWhen { false }
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080098}
99
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800100tasks.withType(Checkstyle) {
101 checkstyleClasspath = project.configurations.checkstyleConfig
102 checkstyleMain {
103 exclude 'com/intel/jndn/management/enums/NfdTlv.java'
104 }
105 checkstyleTest {
106 configFile file('config/checkstyle/checkstyle-test.xml')
107 }
108 checkstyleIntegrationTest {
109 configFile file('config/checkstyle/checkstyle-test.xml')
110 }
111}
112
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800113if (JavaVersion.current().isJava8Compatible()) {
114 allprojects {
115 tasks.withType(Javadoc) {
116 options.addStringOption('Xdoclint:none', '-quiet')
117 }
118 }
119}
120
121artifacts {
122 archives javadocJar, sourcesJar
123}
124
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800125signing {
126 required { gradle.taskGraph.hasTask("uploadArchives") }
127 sign configurations.archives
128}
129
130uploadArchives {
131 repositories {
132 mavenDeployer {
133 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
134
135 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
136 try {
137 authentication(userName: ossrhUsername, password: ossrhPassword)
138 }
139 catch (Exception e) {
140 }
141 }
142
143 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
144 try {
145 authentication(userName: ossrhUsername, password: ossrhPassword)
146 }
147 catch (Exception e) {
148 }
149 }
150
151 pom.project {
152 name 'jndn-management'
153 packaging 'jar'
154 description 'Tools for managing an NDN forwarding daemon'
Davide Pesaventob6df5132019-09-24 14:05:00 -0400155 url 'https://github.com/named-data/jndn-management'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800156
157 scm {
Davide Pesaventob6df5132019-09-24 14:05:00 -0400158 connection 'scm:git:https://github.com/named-data/jndn-management.git'
159 developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-management.git'
160 url 'https://github.com/named-data/jndn-management'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800161 }
162
163 licenses {
164 license {
165 name 'GNU Lesser General Public License, Version 3.0+'
Davide Pesaventob6df5132019-09-24 14:05:00 -0400166 url 'https://www.gnu.org/licenses/lgpl-3.0.html'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800167 }
168 }
169
170 developers {
171 developer {
172 id 'andrewbrown'
173 name 'Andrew Brown'
174 url 'https://github.com/andrewsbrown'
175 }
176 developer {
177 id 'cawka'
178 name 'Alexander Afanasyev'
179 email 'aa@cs.ucla.edu'
180 }
181 }
182 }
183 }
184 }
185}
186
187cobertura {
188 coverageFormats = ['html', 'xml']
189}