blob: 944a7f85e398e64c5de8b8d9ec39b875b05666cb [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'
14 id 'org.sonarqube' version '2.7.1'
15 id 'net.saliman.cobertura' version '2.6.1'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080016}
17
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040018group = 'net.named-data.jndn-extra'
Alexander Afanasyevffd1f712019-06-24 16:47:55 -040019version = '1.2.2'
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 Afanasyevb7e4f9b2019-06-24 16:13:01 -040057 compile 'net.named-data:jndn:0.22'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080058
59 testCompile 'junit:junit:4.12'
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040060 testCompile 'net.named-data.jndn-extra:jndn-mock:1.1.1'
Davide Pesaventob6df5132019-09-24 14:05:00 -040061 testRuntime 'org.slf4j:slf4j-api:1.7.28'
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
86tasks.withType(Test) {
87 reports.html.destination = file("${reporting.baseDir}/${name}")
88 testLogging {
89 events "passed", "skipped", "failed"
90 showStandardStreams = true
91 exceptionFormat = "full"
92 }
Alexander Afanasyevd2bb7af2018-07-24 19:18:32 -040093 outputs.upToDateWhen { false }
Alexander Afanasyevccb373d2016-01-25 11:28:18 -080094}
95
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080096tasks.withType(Checkstyle) {
97 checkstyleClasspath = project.configurations.checkstyleConfig
98 checkstyleMain {
99 exclude 'com/intel/jndn/management/enums/NfdTlv.java'
100 }
101 checkstyleTest {
102 configFile file('config/checkstyle/checkstyle-test.xml')
103 }
104 checkstyleIntegrationTest {
105 configFile file('config/checkstyle/checkstyle-test.xml')
106 }
107}
108
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800109if (JavaVersion.current().isJava8Compatible()) {
110 allprojects {
111 tasks.withType(Javadoc) {
112 options.addStringOption('Xdoclint:none', '-quiet')
113 }
114 }
115}
116
117artifacts {
118 archives javadocJar, sourcesJar
119}
120
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800121signing {
122 required { gradle.taskGraph.hasTask("uploadArchives") }
123 sign configurations.archives
124}
125
126uploadArchives {
127 repositories {
128 mavenDeployer {
129 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
130
131 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
132 try {
133 authentication(userName: ossrhUsername, password: ossrhPassword)
134 }
135 catch (Exception e) {
136 }
137 }
138
139 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
140 try {
141 authentication(userName: ossrhUsername, password: ossrhPassword)
142 }
143 catch (Exception e) {
144 }
145 }
146
147 pom.project {
148 name 'jndn-management'
149 packaging 'jar'
150 description 'Tools for managing an NDN forwarding daemon'
Davide Pesaventob6df5132019-09-24 14:05:00 -0400151 url 'https://github.com/named-data/jndn-management'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800152
153 scm {
Davide Pesaventob6df5132019-09-24 14:05:00 -0400154 connection 'scm:git:https://github.com/named-data/jndn-management.git'
155 developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-management.git'
156 url 'https://github.com/named-data/jndn-management'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800157 }
158
159 licenses {
160 license {
161 name 'GNU Lesser General Public License, Version 3.0+'
Davide Pesaventob6df5132019-09-24 14:05:00 -0400162 url 'https://www.gnu.org/licenses/lgpl-3.0.html'
Alexander Afanasyevccb373d2016-01-25 11:28:18 -0800163 }
164 }
165
166 developers {
167 developer {
168 id 'andrewbrown'
169 name 'Andrew Brown'
170 url 'https://github.com/andrewsbrown'
171 }
172 developer {
173 id 'cawka'
174 name 'Alexander Afanasyev'
175 email 'aa@cs.ucla.edu'
176 }
177 }
178 }
179 }
180 }
181}
182
183cobertura {
184 coverageFormats = ['html', 'xml']
185}