blob: fa80ca36bb27469211e96733df3e425bbb18dae5 [file] [log] [blame]
Alexander Afanasyev71904a12016-02-17 14:50:13 -08001plugins {
Davide Pesaventoa7362da2020-10-30 20:16:42 -04002 id 'java-library'
3 id 'maven' // TODO: migrate to 'maven-publish'
Davide Pesaventoc2a65702020-04-17 23:30:27 -04004 id 'signing'
Davide Pesavento8cda2f92020-11-01 23:08:09 -05005 id 'checkstyle'
Davide Pesaventoa7362da2020-10-30 20:16:42 -04006 id 'org.sonarqube' version '3.0'
7 id 'net.saliman.cobertura' version '4.0.0'
Alexander Afanasyev71904a12016-02-17 14:50:13 -08008}
9
Alexander Afanasyev288fcc92018-07-24 17:28:14 -040010group = 'net.named-data.jndn-extra'
Alexander Afanasyev20fb7b42020-05-18 21:12:32 -040011version = '1.2.0'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080012
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080013repositories {
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080014 mavenLocal()
Davide Pesaventoc2a65702020-04-17 23:30:27 -040015 jcenter()
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080016 mavenCentral()
Davide Pesaventoc2a65702020-04-17 23:30:27 -040017 maven {
Davide Pesaventoa7362da2020-10-30 20:16:42 -040018 url 'https://oss.sonatype.org/content/repositories/releases'
Davide Pesaventoc2a65702020-04-17 23:30:27 -040019 }
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080020}
21
22dependencies {
Davide Pesaventoa7362da2020-10-30 20:16:42 -040023 api 'net.named-data:jndn:0.24'
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080024
Davide Pesavento7b351152020-11-03 15:56:24 -050025 testImplementation 'junit:junit:4.13.1'
Davide Pesaventoa7362da2020-10-30 20:16:42 -040026 testRuntimeOnly 'org.slf4j:slf4j-api:1.7.30'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080027}
28
Davide Pesaventoa7362da2020-10-30 20:16:42 -040029java {
30 sourceCompatibility = JavaVersion.VERSION_1_8
31 targetCompatibility = JavaVersion.VERSION_1_8
32 withJavadocJar()
33 withSourcesJar()
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080034}
35
Davide Pesaventob8a7f022020-04-18 00:28:22 -040036tasks.withType(JavaCompile) {
37 options.deprecation = true
Davide Pesaventoa7362da2020-10-30 20:16:42 -040038 options.encoding = 'UTF-8'
39}
40
41tasks.withType(Javadoc) {
42 options.addBooleanOption('Xdoclint:none', true)
Davide Pesaventob8a7f022020-04-18 00:28:22 -040043}
44
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080045tasks.withType(Test) {
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080046 outputs.upToDateWhen { false }
Davide Pesaventoa7362da2020-10-30 20:16:42 -040047 testLogging {
48 events "passed", "failed", "skipped"
49 exceptionFormat "full"
50 }
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080051}
52
Davide Pesavento8cda2f92020-11-01 23:08:09 -050053checkstyle {
54 toolVersion '8.23'
55}
56checkstyleTest {
57 configFile file('config/checkstyle/checkstyle-test.xml')
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080058}
59
Davide Pesaventoa7362da2020-10-30 20:16:42 -040060cobertura {
61 coverageFormats = ['html', 'xml']
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080062}
63
64artifacts {
65 archives javadocJar, sourcesJar
66}
67
68signing {
69 required { gradle.taskGraph.hasTask("uploadArchives") }
70 sign configurations.archives
71}
72
73uploadArchives {
74 repositories {
75 mavenDeployer {
76 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
77
78 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
79 try {
80 authentication(userName: ossrhUsername, password: ossrhPassword)
81 }
82 catch (Exception e) {
83 }
84 }
85
86 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
87 try {
88 authentication(userName: ossrhUsername, password: ossrhPassword)
89 }
90 catch (Exception e) {
91 }
92 }
93
94 pom.project {
95 name 'jndn-mock'
96 packaging 'jar'
97 description 'Tools for testing NDN Java code without using network IO'
Davide Pesaventoc2a65702020-04-17 23:30:27 -040098 url 'https://github.com/named-data/jndn-mock'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080099
100 scm {
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400101 connection 'scm:git:https://github.com/named-data/jndn-mock.git'
102 developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git'
103 url 'https://github.com/named-data/jndn-mock'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800104 }
105
106 licenses {
107 license {
108 name 'GNU Lesser General Public License, Version 3.0+'
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400109 url 'https://www.gnu.org/licenses/lgpl-3.0.html'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800110 }
111 }
112
113 developers {
114 developer {
115 id 'andrewbrown'
116 name 'Andrew Brown'
117 url 'https://github.com/andrewsbrown'
118 }
119 developer {
120 id 'cawka'
121 name 'Alexander Afanasyev'
122 email 'aa@cs.ucla.edu'
123 }
124 }
125 }
126 }
127 }
128}