blob: 4d059fed27affb6881f9d61cdd5243e8491eb33b [file] [log] [blame]
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -08001buildscript {
2 repositories {
Davide Pesaventoc2a65702020-04-17 23:30:27 -04003 mavenLocal()
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -08004 jcenter()
5 mavenCentral()
6 }
7}
8
Alexander Afanasyev71904a12016-02-17 14:50:13 -08009plugins {
Davide Pesaventoc2a65702020-04-17 23:30:27 -040010 id 'java'
11 id 'maven'
12 id 'signing'
13 //id 'checkstyle'
14 id 'org.sonarqube' version '2.8'
15 id 'net.saliman.cobertura' version '3.0.0'
Alexander Afanasyev71904a12016-02-17 14:50:13 -080016}
17
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040018group = 'net.named-data.jndn-extra'
19version = '1.1.1'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080020
Davide Pesavento188529c2020-04-18 00:03:22 -040021sourceCompatibility = JavaVersion.VERSION_1_8
22targetCompatibility = JavaVersion.VERSION_1_8
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080023compileJava.options.encoding = 'UTF-8'
24
25repositories {
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080026 mavenLocal()
Davide Pesaventoc2a65702020-04-17 23:30:27 -040027 jcenter()
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080028 mavenCentral()
Davide Pesaventoc2a65702020-04-17 23:30:27 -040029 maven {
30 url "https://oss.sonatype.org/content/repositories/releases/"
31 }
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080032}
33
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080034configurations {
35 checkstyleConfig
36}
37
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080038dependencies {
Davide Pesaventoe5acb8d2020-04-18 00:22:45 -040039 compile 'net.named-data:jndn:0.24'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080040
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080041 testCompile 'junit:junit:4.12'
Davide Pesaventoe5acb8d2020-04-18 00:22:45 -040042 testRuntime 'org.slf4j:slf4j-api:1.7.30'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080043
Davide Pesaventoe5acb8d2020-04-18 00:22:45 -040044 checkstyleConfig 'com.puppycrawl.tools:checkstyle:8.23'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080045}
46
47task javadocJar(type: Jar) {
48 classifier = 'javadoc'
49 from javadoc
50}
51
52task sourcesJar(type: Jar) {
53 classifier = 'sources'
54 from sourceSets.main.allSource
55}
56
57tasks.withType(Test) {
58 reports.html.destination = file("${reporting.baseDir}/${name}")
59 testLogging {
60 events "passed", "skipped", "failed"
61 showStandardStreams = true
62 exceptionFormat = "full"
63 }
64 outputs.upToDateWhen { false }
65}
66
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080067tasks.withType(Checkstyle) {
68 checkstyleClasspath = project.configurations.checkstyleConfig
69 checkstyleTest {
70 configFile file('config/checkstyle/checkstyle-test.xml')
71 }
72}
73
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080074if (JavaVersion.current().isJava8Compatible()) {
75 allprojects {
76 tasks.withType(Javadoc) {
77 options.addStringOption('Xdoclint:none', '-quiet')
78 }
79 }
80}
81
82artifacts {
83 archives javadocJar, sourcesJar
84}
85
86signing {
87 required { gradle.taskGraph.hasTask("uploadArchives") }
88 sign configurations.archives
89}
90
91uploadArchives {
92 repositories {
93 mavenDeployer {
94 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
95
96 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
97 try {
98 authentication(userName: ossrhUsername, password: ossrhPassword)
99 }
100 catch (Exception e) {
101 }
102 }
103
104 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
105 try {
106 authentication(userName: ossrhUsername, password: ossrhPassword)
107 }
108 catch (Exception e) {
109 }
110 }
111
112 pom.project {
113 name 'jndn-mock'
114 packaging 'jar'
115 description 'Tools for testing NDN Java code without using network IO'
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400116 url 'https://github.com/named-data/jndn-mock'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800117
118 scm {
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400119 connection 'scm:git:https://github.com/named-data/jndn-mock.git'
120 developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git'
121 url 'https://github.com/named-data/jndn-mock'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800122 }
123
124 licenses {
125 license {
126 name 'GNU Lesser General Public License, Version 3.0+'
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400127 url 'https://www.gnu.org/licenses/lgpl-3.0.html'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800128 }
129 }
130
131 developers {
132 developer {
133 id 'andrewbrown'
134 name 'Andrew Brown'
135 url 'https://github.com/andrewsbrown'
136 }
137 developer {
138 id 'cawka'
139 name 'Alexander Afanasyev'
140 email 'aa@cs.ucla.edu'
141 }
142 }
143 }
144 }
145 }
146}
Alexander Afanasyev71904a12016-02-17 14:50:13 -0800147
148cobertura {
149 coverageFormats = ['html', 'xml']
150}