blob: 48d82bf2c8ac476f697aaf8e86f1b3e62317f80e [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'
Alexander Afanasyev20fb7b42020-05-18 21:12:32 -040019version = '1.2.0'
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
Davide Pesaventob8a7f022020-04-18 00:28:22 -040057tasks.withType(JavaCompile) {
58 options.deprecation = true
59}
60
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080061tasks.withType(Test) {
62 reports.html.destination = file("${reporting.baseDir}/${name}")
63 testLogging {
64 events "passed", "skipped", "failed"
65 showStandardStreams = true
66 exceptionFormat = "full"
67 }
68 outputs.upToDateWhen { false }
69}
70
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080071tasks.withType(Checkstyle) {
72 checkstyleClasspath = project.configurations.checkstyleConfig
73 checkstyleTest {
74 configFile file('config/checkstyle/checkstyle-test.xml')
75 }
76}
77
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -080078if (JavaVersion.current().isJava8Compatible()) {
79 allprojects {
80 tasks.withType(Javadoc) {
81 options.addStringOption('Xdoclint:none', '-quiet')
82 }
83 }
84}
85
86artifacts {
87 archives javadocJar, sourcesJar
88}
89
90signing {
91 required { gradle.taskGraph.hasTask("uploadArchives") }
92 sign configurations.archives
93}
94
95uploadArchives {
96 repositories {
97 mavenDeployer {
98 beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
99
100 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
101 try {
102 authentication(userName: ossrhUsername, password: ossrhPassword)
103 }
104 catch (Exception e) {
105 }
106 }
107
108 snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
109 try {
110 authentication(userName: ossrhUsername, password: ossrhPassword)
111 }
112 catch (Exception e) {
113 }
114 }
115
116 pom.project {
117 name 'jndn-mock'
118 packaging 'jar'
119 description 'Tools for testing NDN Java code without using network IO'
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400120 url 'https://github.com/named-data/jndn-mock'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800121
122 scm {
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400123 connection 'scm:git:https://github.com/named-data/jndn-mock.git'
124 developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git'
125 url 'https://github.com/named-data/jndn-mock'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800126 }
127
128 licenses {
129 license {
130 name 'GNU Lesser General Public License, Version 3.0+'
Davide Pesaventoc2a65702020-04-17 23:30:27 -0400131 url 'https://www.gnu.org/licenses/lgpl-3.0.html'
Alexander Afanasyev8e9330f2016-01-25 19:13:40 -0800132 }
133 }
134
135 developers {
136 developer {
137 id 'andrewbrown'
138 name 'Andrew Brown'
139 url 'https://github.com/andrewsbrown'
140 }
141 developer {
142 id 'cawka'
143 name 'Alexander Afanasyev'
144 email 'aa@cs.ucla.edu'
145 }
146 }
147 }
148 }
149 }
150}
Alexander Afanasyev71904a12016-02-17 14:50:13 -0800151
152cobertura {
153 coverageFormats = ['html', 'xml']
154}