blob: 54a5a7b9a4e9d0189266d8616da580ad27572576 [file] [log] [blame]
Alexander Afanasyevccb373d2016-01-25 11:28:18 -08001plugins {
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -05002 id 'java-library'
3 id 'maven' // TODO: migrate to 'maven-publish'
Davide Pesaventob6df5132019-09-24 14:05:00 -04004 id 'signing'
5 id 'checkstyle'
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -05006 id 'org.sonarqube' version '3.0'
7 id 'net.saliman.cobertura' version '4.0.0'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -08008}
9
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040010group = 'net.named-data.jndn-extra'
Alexander Afanasyev238bfc72020-05-18 21:49:47 -040011version = '1.3.0'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080012
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080013repositories {
14 mavenLocal()
15 jcenter()
16 mavenCentral()
17 maven {
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050018 url 'https://oss.sonatype.org/content/repositories/releases'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080019 }
20}
21
22sourceSets {
23 test {
24 java {
25 exclude '**/*IT.java'
26 }
27 }
28 integrationTest {
29 java {
30 compileClasspath += main.output + test.output
31 runtimeClasspath += main.output + test.output
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050032 srcDir 'src/test/java'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080033 include '**/*IT.java'
34 }
35 }
36}
37
38configurations {
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050039 integrationTestImplementation.extendsFrom testImplementation
40 integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080041}
42
43dependencies {
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050044 api 'net.named-data:jndn:0.24'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080045
Davide Pesaventodd1fe9f2020-11-03 20:48:24 -050046 testImplementation 'junit:junit:4.13.1'
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050047 testImplementation 'net.named-data.jndn-extra:jndn-mock:1.2.0'
48 testRuntimeOnly 'org.slf4j:slf4j-api:1.7.30'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080049}
50
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050051java {
52 sourceCompatibility = JavaVersion.VERSION_1_8
53 targetCompatibility = JavaVersion.VERSION_1_8
54 withJavadocJar()
55 withSourcesJar()
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080056}
57
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050058tasks.withType(JavaCompile) {
59 options.deprecation = true
60 options.encoding = 'UTF-8'
61}
62
63tasks.withType(Javadoc) {
64 options.addBooleanOption('Xdoclint:none', true)
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080065}
66
67task integrationTest(type: Test) {
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050068 description 'Runs integration tests.'
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040069 group = 'verification'
70
71 testClassesDirs = sourceSets.integrationTest.output.classesDirs
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080072 classpath = sourceSets.integrationTest.runtimeClasspath
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040073
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050074 shouldRunAfter test
Davide Pesaventob5f84d22019-09-24 14:55:48 -040075}
76
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080077tasks.withType(Test) {
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040078 outputs.upToDateWhen { false }
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050079 testLogging {
80 events "passed", "failed", "skipped"
81 exceptionFormat "full"
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080082 }
83}
84
Davide Pesaventoa6fd9ab2020-11-01 20:51:36 -050085checkstyle {
86 toolVersion '8.23'
87}
88checkstyleMain {
89 exclude 'com/intel/jndn/management/enums/NfdTlv.java'
90}
91checkstyleTest {
92 configFile file('config/checkstyle/checkstyle-test.xml')
93}
94checkstyleIntegrationTest {
95 configFile file('config/checkstyle/checkstyle-test.xml')
96}
97
98cobertura {
99 coverageFormats = ['html', 'xml']
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800100}
101
102artifacts {
103 archives javadocJar, sourcesJar
104}
105
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800106signing {
107 required { gradle.taskGraph.hasTask("uploadArchives") }
108 sign configurations.archives
109}
110
111uploadArchives {
112 repositories {
113 mavenDeployer {
114 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
115
116 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
117 try {
118 authentication(userName: ossrhUsername, password: ossrhPassword)
119 }
120 catch (Exception e) {
121 }
122 }
123
124 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
125 try {
126 authentication(userName: ossrhUsername, password: ossrhPassword)
127 }
128 catch (Exception e) {
129 }
130 }
131
132 pom.project {
133 name 'jndn-management'
134 packaging 'jar'
135 description 'Tools for managing an NDN forwarding daemon'
Davide Pesaventob6df5132019-09-24 14:05:00 -0400136 url 'https://github.com/named-data/jndn-management'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800137
138 scm {
Davide Pesaventob6df5132019-09-24 14:05:00 -0400139 connection 'scm:git:https://github.com/named-data/jndn-management.git'
140 developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-management.git'
141 url 'https://github.com/named-data/jndn-management'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800142 }
143
144 licenses {
145 license {
146 name 'GNU Lesser General Public License, Version 3.0+'
Davide Pesaventob6df5132019-09-24 14:05:00 -0400147 url 'https://www.gnu.org/licenses/lgpl-3.0.html'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800148 }
149 }
150
151 developers {
152 developer {
153 id 'andrewbrown'
154 name 'Andrew Brown'
155 url 'https://github.com/andrewsbrown'
156 }
157 developer {
158 id 'cawka'
159 name 'Alexander Afanasyev'
160 email 'aa@cs.ucla.edu'
161 }
162 }
163 }
164 }
165 }
166}